61,112
社区成员
发帖
与我相关
我的任务
分享
.putton-org:before {
content: "";
width: 8px;
height: 22px;
position: absolute;
left: -8px;
background-image: url(../images/putton-org.png);
background-position: 0px 0px;
}
.putton-blue:after {
content: "";
width: 8px;
height: 22px;
position: absolute;
right: -8px;
background-image: url(../images/putton.png);
background-position: -12px 0;
}
<style type="text/css">
#butt {
position: relative;
width: 100px;
height: 30px;
background-color: #66f;
margin: 20px;
}
#butt:after {
content: "";
position: absolute;
left: 100%;
top: 0;
width: 10px;
height: 30px;
background-color: #f99;
}
#butt:before {
content: "";
position: absolute;
right: 100%;
top: 0;
width: 10px;
height: 30px;
background-color: #f00;
}
</style>
<div id="butt"></div>
<style type="text/css">
.btn{
height: 22px;
width: 46px;
text-align: center;
line-height: 22px;
color: rgb(255, 255, 255);
position: relative;
font-size: 12px;
font-family: 微软雅黑;
padding: 0px 5px;
background: rgb(169, 205, 249);
border-radius:8px;
}
</style>
<div class="btn">去报名</div>
不用伪类,用CSS3,不支持的浏览器就平角。
或者用图片背景。