How to set the div border in css: first create an HTML sample file; then define the div block; and finally set the border style through the "border-style" attribute.
The operating environment of this article: Windows7 system, HTML5&&CSS3 version, DELL G3 computer
The border attribute is an abbreviated attribute, which can set all in one statement border properties. Example: border width, border style, border color.
You can set the following attributes in order:
border-width: Specifies the width of the border.
border-style: Specifies the style of the border.
border-color: Specifies the color of the border.
If you do not set one of the values, there will be no problem. For example, border:solid #ff0000; is also allowed.
Browser support
The number in the table indicates the first browser version number that supports this attribute.
All browsers support the border attribute.
Example:
Rendering:
Recommended study: "css video tutorial"
The above is the detailed content of How to set div border with css. For more information, please follow other related articles on the PHP Chinese website!