操作指南 - 通知按鈕
學習如何使用 CSS 建立通知按鈕。
收件箱 3
如何建立通知按鈕
步驟 1) 新增 HTML
示例
<a href="#" class="notification">
<span>收件箱</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 按鈕教程,瞭解更多關於如何樣式化按鈕的資訊。