
- HTML中文网
- 联系QQ:88526
- QQ交流群
- 微信公众号

border-left属性
含义:
border-left 简写属性把左边框的所有属性设置到一个声明中。
可以按顺序设置如下属性: border-left-width, border-left-style, and border-left-color.
如果不设置其中的某个值,也不会出问题,比如 border-left:solid #ff0000; 也是允许的
浏览器支持:
表格中的数字表示支持该属性的第一个浏览器版本号
| 属性 | ![]() | ![]() | ![]() | ![]() | ![]() |
|---|---|---|---|---|---|
| border-left | 4.0 | 1.0 | 1.0 | 3.5 | 1.0 |
CSS语法:
border-left :width|style|color|inherit;
属性值:
| 值 | 描述 |
| border-left-width | 规定左边框的宽度 |
| border-left-style | 规定左边框的样式 |
| border-left-color | 规定左边框的颜色 |
| inherit | 规定应该从父元素继承 border-left 属性的设置 |
p{
width:100px;
height: 100px;
line-height: 100px;
text-align: center;
border:1px solid #ccc;
border-left:5px solid pink;
}点击 "运行实例" 按钮查看在线实例
效果图:

推荐手册