Cách thực hiện - Các nút thông báo
Tìm hiểu cách tạo các nút thông báo bằng CSS.
Hộp thư đến 3
Cách tạo nút thông báo
Bước 1) Thêm HTML:
Thí dụ
<a href="#" class="notification">
<span>Inbox</span>
<span
class="badge">3</span>
</a>
Bước 2) Thêm CSS:
Thí dụ
.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;
}
Đi tới Hướng dẫn về các nút CSS của chúng tôi để tìm hiểu thêm về cách tạo kiểu cho các nút.