今天写个简单的小demo,关于CSS实现头像右上角消息数字提示,样式如下如图所示,在微信和扣扣消息里面比较常见。
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
.alarm {
position: relative;
width: 60px;
height: 60px;
margin: 60px;
}
.alarm img {
width: 60px;
height: 60px;
}
.divright {
position: absolute;
color: white;
font-size: 17px;
background-color: red;
width: 23px;
height: 23px;
line-height: 23px;
left: 80%;
top: -12px