0
点赞
收藏
分享

微信扫一扫

css样式修改-悬浮数字

代码实现

css样式修改-悬浮数字_前端知识

 


 

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
* {
margin: 0;
padding: 0;
}

body {
text-align: center;
}
div{
position: relative;
width:100px;
height:100px;
background:blue;
margin-top: 10px;
margin-left: 20px;
box-shadow: 10px 10px 5px #888888;
}

.tip {
position: absolute;
min-width: 20px;
height: 20px;
background: red;
box-sizing: border-box;
color: white;
font-size: 10px;
text-align: center;
line-height: 20px;
padding: 0 5px;
border-radius: 10px;
display: inline-block;
margin-left: 35px;
top:-5px;
}
</style>
</head>

<body>
<div>
<p class="tip">25</p>
</div>
</body>

</html>

 

心有猛虎,细嗅蔷薇

举报

相关推荐

0 条评论