Home  >  Article  >  Web Front-end  >  Does css3 support border attribute?

Does css3 support border attribute?

WBOY
WBOYOriginal
2022-06-23 16:08:521616browse

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;}".

Does css3 support border attribute?

The operating environment of this tutorial: Windows 10 system, CSS3&&HTML5 version, Dell G3 computer.

css3 supports the border attribute

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:

Does css3 support border attribute?

##(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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn