您的位置:首页 > Web前端 > CSS

css实现两边有缺口的卡券效果

2015-10-09 16:45 811 查看
自己项目用到优惠券的样式,特拿来分享。主要用到了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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  absolute