通知按钮
创建于 2024-12-03 /
26
字体:
[默认]
[大]
[更大]
了解如何使用 CSS 创建通知按钮。
Inbox 3
如何创建通知按钮
步骤 1) 添加 HTML:
实例
<a href="#" class="notification"><span>Inbox</span>
<span class="badge">3</span>
</a>
步骤 2) 添加 CSS:
实例
.notification {background-color: #555;
color: white;
text-decoration: none;
padding: 15px 26px;
position: relative;
display: inline-block;
border-radius: 2px;
}
.notification:hover {
background: red;
}
.notification .badge {
position: absolute;
top: -10px;
right: -10px;
padding: 5px 10px;
border-radius: 50%;
background: red;
color: white;
} 亲自试一试 »
转到我们的 CSS 按钮教程,了解有关如何设置按钮样式的更多信息。
0 人点赞过