上周五在大前端中看到一种写优惠券的样式。在本地测试了一把,个人觉得还不错。现在很多活动页面中都会有优惠券,以后可以在页面中试一下......
HTML代码:
<div class="stamp stamp01"> <div class="par"> <p>XXXXXX折扣店</p> <sub class="sign">¥</sub> <span>50.00</span> <sub>优惠券</sub> <p>订单满100.00元</p> </div> <div class="copy">副券 <p>2015-08-13<br>2016-08-13</p> </div> <i></i> </div>
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; } .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); } .stamp .copy p{ font-size: 16px; margin-top: 15px; } .stamp01{ 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; } .stamp01:before{ background-color:#F39B00; }
效果图:
时间: 2024-10-14 08:52:29