Home > Article > Web Front-end > What is outline in css
In CSS, outline refers to the attribute that sets the outline of an element. You can specify the style, color, and width of the element outline. outline is a shorthand attribute. You can set the style, color and width simultaneously in one statement in order. The syntax is "outline:outline-color outline-style outline-width;"; if one of the values is not set, no error will occur. question.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
CSS outline (outline)
The outline (outline) is a line drawn around the element, located outside the edge of the border, which can To highlight the role of elements.
The outline (outline) attribute specifies the style, color and width of the element's outline.
#outline shorthand property sets all outline properties in one declaration.
The attributes that can be set are (in order): outline-color, outline-style, outline-width
Value | Description |
---|---|
outline-color | Specifies the color of the border. |
outline-style | Specifies the style of the border. |
outline-width | Specifies the width of the border. |
If you do not set one of the values, there will be no problem. For example, outline:solid #ff0000;
is also allowed.
Example: Setting the outline around the element
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <style> p { border: 1px solid red; outline: green dotted thick; } </style> </head> <body> <p>测试文本, outline属性样式。</p> </body> </html>
(Learning video sharing: Getting started with web front-end)
The above is the detailed content of What is outline in css. For more information, please follow other related articles on the PHP Chinese website!