<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style type="text/css">
/*要想看到边框的颜色,就必须设置边框的样式,否则看不到效果。
border也可以简写:border:1px solid Red 意思是设置边框border宽度为1px,样式为solid,颜色为Red*/
.d1{ border-width:1px; border-style:solid;border-color:Red; background-color:Gray; text-align:center; }
</style>
</head>
<body>
<div class="d1">div1测试</div>
<div>
border-left 设置左边框,一般单独设置左边框样式使用
border-right 设置右边框,一般单独设置右边框样式使用
border-top 设置上边框,一般单独设置上边框样式使用
border-bottom 设置下边框,一般单独设置下边框样式使用,有时可将下边框样式作为css下划线效果应用。
四边相同边框border简写
#divcss5{border:1px solid #00F}
设置了divcss5对象盒子1px像素蓝色实线边框
</div>
</body>
</html>
原文地址:http://blog.csdn.net/fanbin168/article/details/37740549