css卡券锯齿效果
效果图:
html
<div class="box2"></div>
<div class="box3"></div>
css
.box2 {
width: 370px;
height: 86px;
padding: 30px;
margin-top: 24px;
font-size: 42px;
font-weight: bold;
background-color: #fd4908;
background-image: radial-gradient(#6699ff 35%,#f9f215 35%);
background-size: 24px 24px;
background-position: -10px 0;
background-repeat: repeat-y;
}
.box3 {
width: 13px;
height: 146px;
background-image: radial-gradient(#6699ff 35%,#f9f215 35%);
background-size: 24px 24px;
background-position: 0px 0;
background-repeat: repeat-y;
position: relative;
top: -146px;
left: 417px;
}
-webkit-background-clip:text(仅chrome)
效果图:
HTML
<div class="box">
<p>Lorem ipsum</p>
</div>
css
.box {
width: 400px;
height: 200px;
padding: 30px;
font-size: 60px;
font-weight: bold;
background: url(1.jpg) no-repeat;
background-size: 100% 100%;
color: transparent;
-webkit-background-clip: text; /*目前只有Chrome支持*/
}
background-clip
.box4{
width: 250px;
height: 60px;
padding: 20px;
background-color: #ff6699;
border: 10px dotted black;
}
.box4{
width: 250px;
height: 60px;
padding: 20px;
background-color: #ff6699;
background-clip: padding-box;
}
.box4{
width: 250px;
height: 60px;
padding: 20px;
background-color: #ff6699;
background-clip: content-box;
}