Home > Article > Web Front-end > Explore the use of the border-top attribute in CSS
We introduced the usage of the CSS top attribute in the previous section, so it will be easier to learn the usage of the CSS border-top attribute in this section. The border-top abbreviation attribute sets all the attributes of the top border into one statement.
This article describes to you the usage of the CSS border-top property. The border-top abbreviation property sets all the properties of the top border into one statement. I believe that the introduction in this article will definitely help you gain something.
CSS border-top property
Definition and Usage
border-top shorthand property sets all properties of the top border into one statement.
You can set the following properties in order:
border-top-width border-top-style border-top-color
If you don’t set one of the values, there will be no problem. For example, border-top:solid #ff0000; is also allowed.
Default value: | not specified |
---|---|
Inheritance: | no |
Version: | CSS1 |
JavaScript syntax: | object.style.borderTop="3px solid blue" |
Instances
Set the style of the top border:
p { border-style:solid; border-top:thick double #ff0000; }
Browser support
All browsers support border-top property.
Note: The attribute value "inherit" is not supported in any version of Internet Explorer (including IE8).
Possible values
Value | Description |
---|---|
border-top-width | Specifies the width of the top border. See: border-top-width for possible values. |
border-top-style | Specifies the style of the top border. See: border-top-style for possible values. |
border-top-color | Specifies the color of the top border. See: border-top-color for possible values. |
inherit | Specifies that the setting of the border-top attribute should be inherited from the parent element. |
Reference reading: http://www.manongjc.com/article/1188.html