border
2017-01-20 本文已影响0人
Candy374
border-width is not support percent
no meaning (desktop or mobile use the same border)
-
default value is 3px
-- thin(1px)
-- medium(3px) . (need to implement border-style: double)
-- thick (5px)
boder-style
- dash
![](https://img.haomeiwen.com/i4168720/4e4cc551fd4c1051.png)
- doted
Only in IE
.box {
width: 150px; height: 150px;
overflow: hidden;
}
.dotted {
width: 100%; height: 100%;
border: 149px dotted #cd0000;
}
![](https://img.haomeiwen.com/i4168720/13325da25be09858.png)
- double
{
width: 120px;
height:20px;
border-top: 60px double;
border-bottom: 20px solid;
}
![](https://img.haomeiwen.com/i4168720/536c2d6164e66f66.png)
![](https://img.haomeiwen.com/i4168720/a4400e135bf71258.png)
boder color
color is boder-color
same as box-shadow, text-shadow ...
![](https://img.haomeiwen.com/i4168720/2a605f22394081c5.png)
<a class="add"/>
.add{
border: 1px solid #ccc;
}
.add:before, .add:after {
background: #ccc;
}
.add:hover{
border-color: #06c;
}
.add:hover:before, .add:hover:after {
background: #06c;
}
.add {
color: #ccc;
transition: color .25s;
border: 1px solid;
}
.add:before {
border-top: 10px solid;
}
.add:after {
border-left: 10px solid;
}
border position
background-position has limitation in CSS2.1, it can only position related to the left top
so we can use a transparent border as right padding
![](https://img.haomeiwen.com/i4168720/e69785a417c2d092.png)
border & triangle
![](https://img.haomeiwen.com/i4168720/f3e76f503735be97.png)
![](https://img.haomeiwen.com/i4168720/409f67e212a3ede7.png)
![](https://img.haomeiwen.com/i4168720/48b8ae994dbea4a4.png)
boder transparent
![](https://img.haomeiwen.com/i4168720/c4b8f74a93dd4903.png)
![](https://img.haomeiwen.com/i4168720/d8a305b7fcea02f0.png)
but chrome can not use above solution
![](https://img.haomeiwen.com/i4168720/648c576baa22c595.png)
boder layout
same height sider bar
but this solution can not support %
![](https://img.haomeiwen.com/i4168720/441b9e3451230f5f.png)