自己项目用到优惠券的样式,特拿来分享。主要用到了css的position: absolute属性。
效果如下图:
废话不多说,直接上代码
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<title>验证券样式</title>
<style>
body{
background-color: #E2DFDF;
}
.div{
position: relative;
width: 200px;
height: 100px;
margin:100px auto;
background-color: #fff;
}
.yuan1{
position: absolute;
width: 20px;
height: 20px;
border-radius: 20px;
background-color: #E2DFDF;
left: -10px;
top:40px;
}
.yuan2{
position: absolute;
width: 20px;
height: 20px;
border-radius: 20px;
background-color: #E2DFDF;
right: -10px;
top:40px;
}
</style>
</head>
<body>
<div class="div">
<div class="yuan1"></div>
<div class="yuan2"></div>
</div>
</body>
</html>