1.代码
1-1
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
/*通用类样式
*********************************/
.stamp {
width: 387px;
height: 140px;
padding: 0 10px;
position: relative;
overflow: hidden;
}
.stamp:before {
content: '';
position: absolute;
top: 0;
bottom: 0;
left: 10px;
right: 10px;
z-index: -1;
}
.stamp:after {
content: '';
position: absolute;
left: 10px;
top: 10px;
right: 10px;
bottom: 10px;
box-shadow: 0 0 20px 1px rgba(0, 0, 0, 0.5);
z-index: -2;
}
.stamp i {
position: absolute;
left: 20%;
top: 45px;
height: 190px;
width: 390px;
background-color: rgba(255,255,255,.15);
transform: rotate(-30deg);
}
.stamp .par {
float: left;
padding: 16px 15px;
width: 220px;
border-right: 2px dashed rgba(255,255,255,.3);
text-align: left;
}
.stamp .par p { color: #fff; margin:6px 0; }
.stamp .par span {
font-size: 50px;
color: #fff;
margin-right: 5px;
}
.stamp .par .sign { font-size: 34px; }
.stamp .par sub {
position: relative;
top: -5px;
color: rgba(255,255,255,.8);
}
.stamp .copy {
display: inline-block;
padding: 21px 14px;
width: 100px;
vertical-align: text-bottom;
font-size: 30px;
color: rgb(255,255,255);
padding: 10px 6px 10px 12px;
font-size: 24px;
}
.stamp .copy p {
font-size: 13px;
margin-top: 12px;
margin-bottom: 16px;
}
.stamp .copy a {
background-color: #fff;
color: #333;
font-size: 14px;
text-decoration: none;
text-align:center;
padding: 5px 10px;
border-radius: 4px;
display: block;
}
/*设计风格
*********************************/
/*鹅黄*/
.stamp_yellow {
background: #F39B00;
background: radial-gradient(rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 5px, #F39B00 5px);
background-size: 15px 15px;
background-position: 9px 3px;
}
.stamp_yellow:before { background-color: #F39B00; }
</style>
</head>
<body>
<div class="stamp stamp_yellow">
<div class="par">
<p>上品折扣店</p>
<sub class="sign">¥</sub><span>50.00</span><sub>优惠券</sub>
<p>订单满100.00元</p>
</div>
<div class="copy">副券
<p>2018-06-01<br>
2018-06-18</p>
<a href="#">立即使用</a></div>
<i></i></div>
</body>
</html>
1-2
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
/*通用类样式
*********************************/
.stamp {
width: 387px;
height: 140px;
padding: 0 10px;
position: relative;
overflow: hidden;
}
.stamp:before {
content: '';
position: absolute;
top: 0;
bottom: 0;
left: 10px;
right: 10px;
z-index: -1;
}
.stamp:after {
content: '';
position: absolute;
left: 10px;
top: 10px;
right: 10px;
bottom: 10px;
box-shadow: 0 0 20px 1px rgba(0, 0, 0, 0.5);
z-index: -2;
}
.stamp i {
position: absolute;
left: 20%;
top: 45px;
height: 190px;
width: 390px;
background-color: rgba(255,255,255,.15);
transform: rotate(-30deg);
}
.stamp .par {
float: left;
padding: 16px 15px;
width: 220px;
border-right: 2px dashed rgba(255,255,255,.3);
text-align: left;
}
.stamp .par p { color: #fff; margin:6px 0; }
.stamp .par span {
font-size: 50px;
color: #fff;
margin-right: 5px;
}
.stamp .par .sign { font-size: 34px; }
.stamp .par sub {
position: relative;
top: -5px;
color: rgba(255,255,255,.8);
}
.stamp .copy {
display: inline-block;
padding: 21px 14px;
width: 100px;
vertical-align: text-bottom;
font-size: 30px;
color: rgb(255,255,255);
padding: 10px 6px 10px 12px;
font-size: 24px;
}
.stamp .copy p {
font-size: 13px;
margin-top: 12px;
margin-bottom: 16px;
}
.stamp .copy a {
background-color: #fff;
color: #333;
font-size: 14px;
text-decoration: none;
text-align:center;
padding: 5px 10px;
border-radius: 4px;
display: block;
}
/*设计风格
*********************************/
/*鹅黄*/
.stamp_yellow {
background: #F39B00;
background: radial-gradient(rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 5px, #F39B00 5px);
background-size: 15px 15px;
background-position: 9px 3px;
}
.stamp_yellow:before { background-color: #F39B00; }
/*浅红*/
.stamp_red {
background: #D24161;
background: radial-gradient(transparent 0, transparent 5px, #D24161 5px);
background-size: 15px 15px;
background-position: 9px 3px;
}
.stamp_red:before { background-color: #D24161; }
/*浅绿*/
.stamp_green {
background: #7EAB1E;
background: radial-gradient(transparent 0, transparent 5px, #7EAB1E 5px);
background-size: 15px 15px;
background-position: 9px 3px;
}
.stamp_green:before { background-color: #7EAB1E; }
/*天蓝*/
.stamp_blue {
width: 390px;
background: #50ADD3;
background: radial-gradient(rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 4px, #50ADD3 4px);
background-size: 12px 8px;
background-position: -5px 10px;
}
.stamp_blue:before { background-color: #50ADD3; }
/*非核心样式*/
.stamp { float:left; margin:6px;}
</style>
</head>
<body>
<div class="stamp stamp_yellow">
<div class="par">
<p>上品折扣店</p>
<sub class="sign">¥</sub><span>50.00</span><sub>优惠券</sub>
<p>订单满100.00元</p>
</div>
<div class="copy">副券
<p>2018-06-01<br>
2018-06-18</p>
<a href="#">立即使用</a></div>
<i></i></div>
<div class="stamp stamp_red">
<div class="par">
<p>上品折扣店</p>
<sub class="sign">¥</sub><span>50.00</span><sub>优惠券</sub>
<p>订单满100.00元</p>
</div>
<div class="copy">副券
<p>2018-06-01<br>
2018-06-18</p>
<a href="#">立即使用</a></div>
<i></i> </div>
<div class="stamp stamp_green">
<div class="par">
<p>上品折扣店</p>
<sub class="sign">¥</sub><span>50.00</span><sub>优惠券</sub>
<p>订单满100.00元</p>
</div>
<div class="copy">副券
<p>2018-06-01<br>
2018-06-18</p>
<a href="#">立即使用</a></div>
<i></i> </div>
<div class="stamp stamp_blue">
<div class="par">
<p>上品折扣店</p>
<sub class="sign">¥</sub><span>50.00</span><sub>优惠券</sub>
<p>订单满100.00元</p>
</div>
<div class="copy">副券
<p>2018-06-01<br>
2018-06-18</p>
<a href="#">立即使用</a></div>
<i></i> </div>
</body>
</html>
2.运行效果