返回到:CSS 边框 | CSS教程
属性定义及使用说明
border-left 简写属性把左边框的所有属性设置到一个声明中。
可以按顺序设置如下属性: border-left-width, border-left-style, and border-left-color.
如果不设置其中的某个值,也不会出问题,比如 border-left:solid #ff0000; 也是允许的。
| 默认值: | not specified |
|---|---|
| 继承性: | no |
| 版本: | CSS1 |
| JavaScript 语法: | object.style.borderLeft=”3px solid blue” |
属性值
| 值 | 描述 |
|---|---|
| border-left-width | 规定左边框的宽度。参阅:border-left-width 中可能的值。 |
| border-left-style | 规定左边框的样式。参阅:border-left-style 中可能的值。 |
| border-left-color | 规定左边框的颜色。参阅:border-left-color 中可能的值。 |
| inherit | 规定应该从父元素继承 border-left 属性的设置。 |
浏览器支持
表格中的数字表示支持该属性的第一个浏览器版本号。
| 属性 | 谷歌 | IE | 火狐 | 苹果 | opera |
|---|---|---|---|---|---|
| border-left | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
实例
设置左边框的样式:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Web176教程(web176.com)</title>
<style>
p
{
border-style:solid;
border-left:thick double #ff0000;
}
</style>
</head>
<body>
<p>This is some text in a paragraph.</p>
</body>
</html>作者:terry,如若转载,请注明出处:https://www.web176.com/cssprop/5599.html
支付宝
微信