Home >Web Front-end >CSS Tutorial >How to use css outline-color property
The outline is a line drawn around the element, located outside the edge of the border. The outline-color attribute is used to set the color of the visible part of the entire outline of an element. The outline-style attribute must always be declared before the outline-color attribute; an element cannot change its color until it has an outline.
How to use the css outline-color property?
outline-color property sets the color of the visible portion of the entire outline of an element. Remember, the outline style cannot be none, otherwise the outline will not appear.
Note:
Always declare the outline-style attribute before the outline-color attribute. The color of an element's outline can only be changed after it has obtained its outline.
Note:
outline is the margin around the element; however, it comes from a different border attribute.
The outline is not part of the element's dimensions, so the element's width and height properties do not include the width of the outline. Contours do not take up space and are not necessarily rectangular.
css outline-color property example
<!DOCTYPE> <html> <head> <meta charset="UTF-8"> <style type="text/css"> p { border: red solid thin; outline-style: dotted; outline-color: #00ff00; } </style> </head> <body> <p><b>注释:</b>只有在规定了 !DOCTYPE 时,Internet Explorer 8 (以及更高版本) 才支持 outline-color 属性。</p> </body> </html>
Rendering:
The above is the detailed content of How to use css outline-color property. For more information, please follow other related articles on the PHP Chinese website!