CSS3 - 有通知泡影的箱子 [英] CSS3 - box with notification bubble

查看:203
本文介绍了CSS3 - 有通知泡影的箱子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何制作包含无图像通知气泡的方块,例如

How can i make box with image-less notification bubble like this one for example

,您可以看到这是框和图像在它的中心,图像可以更改为另一个图像在悬停它,还有通知气泡(无图像),可能显示数量的任何。

as you can see this is box and image in center of it and image can be changed to another image on hover it, Also there is notification bubble (image-less) that might shows number of whatever.

如何写在html / css。 〜感谢

How can i write it in html/css. ~ Thanks

推荐答案

尝试:

CSS:

.outer{
    width: 100px;
    height: 100px;
    border: 1px solid black;
    background: url(http://us.123rf.com/400wm/400/400/prolific/prolific1206/prolific120600020/14161811-pencil--edit--icon.jpg);
    background-size: 100px 100px;
}

.num_notifs {
    border-radius: 5px;
    width: 50%;
    margin-left: 25%;
    margin-top: 2px;
    background: #00b7ea; /* Old browsers */
    background: -moz-linear-gradient(top,  #00b7ea 0%, #0052bf 100%); /* FF3.6+ */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#00b7ea), color-stop(100%,#0052bf)); /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(top,  #00b7ea 0%,#0052bf 100%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(top,  #00b7ea 0%,#0052bf 100%); /* Opera 11.10+ */
    background: -ms-linear-gradient(top,  #00b7ea 0%,#0052bf 100%); /* IE10+ */
    background: linear-gradient(to bottom,  #00b7ea 0%,#0052bf 100%); /* W3C */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00b7ea', endColorstr='#0052bf',GradientType=0 ); /* IE6-9 */
    text-align: center;
}

HTML: b

<div class="outer">
    <div class="num_notifs">
        4329
    </div>
</div>

小提琴。

这篇关于CSS3 - 有通知泡影的箱子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆