Home >Web Front-end >Front-end Q&A >What is outline in css

What is outline in css

青灯夜游
青灯夜游Original
2022-07-27 20:39:255286browse

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.

What is outline in css

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.

What is outline in css

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

What is outline in css

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

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