1、关键词:border
边框的组成
![](http://upload-images.jianshu.io/upload_images/2263167-cd30f32611b4d8b2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
第一个是边框的粗细 1px
第二个是边框的样式 solid 实线 dashed 虚线 dotted 点画线 (不兼容 在不同的浏览器上显示的不一样)
第三个是边框的颜色 red 直接用英文单词表示颜色 #f00 颜色的十六进制表示法 rgb(255,0,0) rgb表示法
2、复合样式
/*border: 1px solid red; /*复合样式*/
![](http://upload-images.jianshu.io/upload_images/2263167-08019dfea8db338e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
3、单一设置
![](http://upload-images.jianshu.io/upload_images/2263167-f90e8095d29311b4.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
这样代表上边框 右边框 下边框 左边框 分别对四条边框进行设置
![](http://upload-images.jianshu.io/upload_images/2263167-133fac911d0a6042.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
两个值代表:上下边框 左右边框
![](http://upload-images.jianshu.io/upload_images/2263167-d91770232bbc6297.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
三个值代表:上边框 左右边框 下边框 (小编不懂为啥是这样分的 可能就是统一的吧)
也可以对每一个边框单独设置
![](http://upload-images.jianshu.io/upload_images/2263167-de95b2fb2c4f71b8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
但是工作中应该不要这么细分 因为不仅工作量大 而且也很怪异 不美观