【问题标题】:CSS3 - box with notification bubble [closed]CSS3 - 带有通知气泡的框[关闭]
【发布时间】:2013-06-16 10:53:06
【问题描述】:

例如,我如何制作带有无图像通知气泡的框

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

如何在 html/css 中编写它。 ~ 谢谢

【问题讨论】:

  • 带有数字的蓝色框显然是带有渐变背景的div。谷歌gradient background css。它也有圆角。谷歌rounded corners css。文本和框也有阴影。谷歌dropshadow css.

标签: html css


【解决方案1】:

试试这个:

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:

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

Fiddle.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多