html:
<a href="index.html" class="nav">未讀留言<div class="nav-counter nav-counter-blue">4</div></a>
css:
.nav{
width:100px;
display:block;
position:relative;
}
.nav-counter {
position: absolute;
top: 2px;
right: -8px;
min-width: 8px;
height: 20px;
line-height: 20px;
margin-top: -11px;
padding: 0 6px;
font-weight: normal;
color: white;
text-align: center;
text-shadow: 0 1px rgba(0, 0, 0, 0.2);
background: #e23442;
border: 1px solid #911f28;
border-radius: 11px;
background-image: -webkit-linear-gradient(top, #e8616c, #dd202f);
background-image: -moz-linear-gradient(top, #e8616c, #dd202f);
background-image: -o-linear-gradient(top, #e8616c, #dd202f);
background-image: linear-gradient(to bottom, #e8616c, #dd202f);
-webkit-box-shadow: inset 0 0 1px 1px rgba(255, 255, 255, 0.1), 0 1px rgba(0, 0, 0, 0.12);
box-shadow: inset 0 0 1px 1px rgba(255, 255, 255, 0.1), 0 1px rgba(0, 0, 0, 0.12);
}
.nav-counter-blue {
background: #e8616c;
border: 1px solid #dd202f;
background-image: -webkit-linear-gradient(top, #e8616c, #dd202f);
background-image: -moz-linear-gradient(top, #e8616c, #dd202f);
background-image: -o-linear-gradient(top, #e8616c, #dd202f);
background-image: linear-gradient(to bottom, #e8616c, #dd202f);
}