border-style类型
solid: 实线
dashed: 虚线,Chrome和Firefox显示的比较稀疏,IE显示的比较密集
dotted: 点线,Chrome和Firefox显示的是肖方,IE显示的是小圆
double:双线,兼容性很好,计算规则:双线宽度永远相等,中间间隔+/-1,1px: 0(左实线)+1(中间区域)+0(右实线), 2px:1+0+1, 3px:1+1+1,4px:1+2+1,5px: 2+1+2,6px:2+2+2,7px:2+3+2
inset: 内凹
outset:外凸
groove:沟槽
ridge:山脊
border-style
1、border-style:solid; 实线
2、border-style:dashed; 虚线
3、border-style:dotted; 点线
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Document</title> <style> .radius_container { position: relative; } .box { position: absolute; width: 150px; height: 150px; overflow: hidden; } .dotted { width: 100%; height: 100%; border: 150px dotted #EF2424; } .radius-right_top { top: 0; left: 400px; } .radius_right_bottom { left: 400px; top: 200px; } .radius_left_bottom { left: 0; top: 200px; } .row { position: absolute; top: 75px; width: 550px; height: 200px; background: rgba(30,50,190,0.5); color: #ffffff; z-index: 3; font-size: 100px; line-height: 200px; text-align: center; } .col { position: absolute; left: 75px; width: 400px; height: 350px; background: rgba(30,50,190,0.5); z-index: 2; } </style> </head> <body> <div class="radius_container"> <div class="row">按钮</div> <div class="col"></div> <div class="box"> <div class="dotted"></div> </div> <div class="box radius-right_top"> <div class="dotted"></div> </div> <div class="box radius_right_bottom"> <div class="dotted"></div> </div> <div class="box radius_left_bottom"> <div class="dotted"></div> </div> </div> </body> </html>
4、border-style:double; 双线(兼容性非常好)
规律:双线宽度永远相等,中间间隔±1
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Document</title> <style> /*border-style设为double,实现三道杠*/ .double { width: 120px; height: 20px; background: rgba(0,0,0,0.1); border-top: 60px double #CE2424; border-bottom: 20px solid #CE2424; } </style> </head> <body> <!-- border-style设为double,实现三道杠 --> <div class="double"></div> </body> </html>
5、border-style:inset; 内凹(风格过时,兼容性差)
6、border-style:outset; 外凸(风格过时,兼容性差)
7、border-style:groove; 沟槽(风格过时,兼容性差)
8、border-style:ridge; 山脊(风格过时,兼容性差)
border-style:double类型
border-style:double;
border-style: dotted在chrome和IE下是有区别的。
三条杠---------------------
dashed
border-style:solid;dashed;dotted
利用border:double实现三条杠效果
实线 border-style:solid; 虚线 border-style:dashed; chrome/firefox: 宽3:高1 视觉上较稀疏 IE: 宽2:高1 视觉上较密集 点线 border-style:dotted; chrome/firefox: 小方 IE: 小圆
border-style : solid(实线) | dashed(虚线) | dotted(点线) | double(双实线) | inset(内凹) | outset(外凸) | groove(沟槽) | ridge(山脊)
.icon1{ display:inline-block;width:120px;height:20px;color:#ccc; border-top:60px double; border-bottom:20px solid; } .icon1:hover{ color:red;}
<span class="icon1"></span>
solid(单线边框) ,实现圆角边框。
double(双线边框),