样式表可以是外部的、内联的、嵌入的、链接的, 譬如下面的内联样式将作用于所有 ID=Test 的标签:
<style> #Test {...} </style>
border border-width border-style border-color border-top border-top-width border-top-style border-top-color border-bottom border-bottom-width border-bottom-style border-bottom-color border-left border-left-width border-left-style border-left-color border-right border-right-width border-right-style border-right-color border-collapse border-spacing
border: 宽度 样式 颜色;
![](https://www.cnblogs.com/images/cnblogs_com/del/171104/o_091282.png)
border 的宽度有三个常数值: medium(默认)、thick(粗)、thin(细).
![](https://www.cnblogs.com/images/cnblogs_com/del/171104/o_091283.png)
![](https://www.cnblogs.com/images/cnblogs_com/del/171104/o_091284.png)
![](https://www.cnblogs.com/images/cnblogs_com/del/171104/o_091285.png)
自定义宽度最麻烦的就是宽度的单位(in、cm、mm、em、ex、pt、pc、px), 我喜欢用像素(px).
![](https://www.cnblogs.com/images/cnblogs_com/del/171104/o_091286.png)
border 的样式: none(默认)、solid、double、dotted、dashed、groove、ridge、inset、outset.
![](https://www.cnblogs.com/images/cnblogs_com/del/171104/o_091287.png)
![](https://www.cnblogs.com/images/cnblogs_com/del/171104/o_091288.png)
![](https://www.cnblogs.com/images/cnblogs_com/del/171104/o_091289.png)
![](https://www.cnblogs.com/images/cnblogs_com/del/171104/o_091290.png)
![](https://www.cnblogs.com/images/cnblogs_com/del/171104/o_091291.png)
![](https://www.cnblogs.com/images/cnblogs_com/del/171104/o_091292.png)
![](https://www.cnblogs.com/images/cnblogs_com/del/171104/o_091293.png)
![](https://www.cnblogs.com/images/cnblogs_com/del/171104/o_091294.png)
![](https://www.cnblogs.com/images/cnblogs_com/del/171104/o_091295.png)
后四种 3D 样式, 如果使用默认的 3D 着色颜色效果会更好:
![](https://www.cnblogs.com/images/cnblogs_com/del/171104/o_091296.png)
![](https://www.cnblogs.com/images/cnblogs_com/del/171104/o_091297.png)
![](https://www.cnblogs.com/images/cnblogs_com/del/171104/o_091298.png)
![](https://www.cnblogs.com/images/cnblogs_com/del/171104/o_091299.png)
指定颜色有五种方法(譬如蓝色): RGB(0,0,255); #0000FF; #00F; Blue; RGB(0,0,100%).
![](https://www.cnblogs.com/images/cnblogs_com/del/171104/o_0912900.png)
![](https://www.cnblogs.com/images/cnblogs_com/del/171104/o_0912901.png)
![](https://www.cnblogs.com/images/cnblogs_com/del/171104/o_0912902.png)
![](https://www.cnblogs.com/images/cnblogs_com/del/171104/o_0912903.png)
![](https://www.cnblogs.com/images/cnblogs_com/del/171104/o_09129031.png)
border: 宽度 样式 颜色; 可以从后向前省略, 也可以用 border-width、border-style、border-color 分开表达.
![](https://www.cnblogs.com/images/cnblogs_com/del/171104/o_0912904.png)
可以用 border-top、border-bottom、border-left、border-right 分别描述四个边;
并可用 border-top-width、border-top-style、border-top-color 等描述各边的: 宽度、样式、颜色.
![](https://www.cnblogs.com/images/cnblogs_com/del/171104/o_0912905.png)
上面列出的边框相关的样式还有: border-collapse、border-spacing; 这是表格相关的.
border-collapse 有两个常数值: collapse、separate, 决定边框是否分开:
![](https://www.cnblogs.com/images/cnblogs_com/del/171104/o_0912906.png)
![](https://www.cnblogs.com/images/cnblogs_com/del/171104/o_0912907.png)
border-spacing: 用来设置表格中单元格的间距; 这个好像 IE(8) 不支持, 不过这和表格的 cellspacing 属性是一样的.