Home >Web Front-end >Front-end Q&A >Does css3 support border attribute?
css3 supports the border attribute, which has been supported since css1; the border attribute is the abbreviation attribute of the border attribute, which can be used to specify the style, width and color of the element border. The attribute value only sets one value , other values will be set to the initial values of the corresponding attributes, and the syntax is "element {border:border-width,,border-style,border-color;}".
The operating environment of this tutorial: Windows 10 system, CSS3&&HTML5 version, Dell G3 computer.
border is the abbreviation of the border attribute.
CSS border property is used to specify the style, width and color of the element border.
The properties that can be set are (in order): border-width, border-style and border-color.
You can also set only one value. For example, border: #FF0000; is correct, and other values will be set to the initial values of the corresponding properties.
Syntax format
You can use one, two or three values listed below to specify the border attribute. The order of the values does not matter:
/* 边框样式 */ border: solid; /* 边框宽度 | 边框样式 */ border: 2px dotted; /* 边框样式 | 边框颜色 */ border: outset #f33; /* 边框宽度 | 边框样式 | 边框颜色 */ border: medium dashed green; /* 全局值 */ border: inherit; border: initial; border: unset;
If the border style Undefined, it will not be visible. This is because styles default to none.
The example is as follows:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>123</title> <style> p { border:5px solid red; } </style> </head> <body> <p>段落中的一些文本。</p> </body> </html>
Output result:
##(Learning video sharing:css video tutorial, html video tutorial)
The above is the detailed content of Does css3 support border attribute?. For more information, please follow other related articles on the PHP Chinese website!