How to set the length of hr in css

青灯夜游
Release: 2021-11-10 16:23:50
Original
8337 people have browsed it

In CSS, you can use the width attribute to set the length of the hr horizontal line. You only need to add the "hr{width: width value;}" style to the hr element; the width value can be in pixels or percentages.

How to set the length of hr in css

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


tag creates a horizontal line in an HTML page.

Horizontal rule (horizontal rule) can visually separate the document into various parts.

The default length (width) of the hr horizontal line is the width of the browser window, which will change as the width of the window changes.

How to set the length of hr in css

But, you can also set it yourself!

We can use the css width attribute to change the length (width) of the hr horizontal line. The width attribute specifies the width of the horizontal line, in pixels or as a percentage.

hr{
	width: 100px;
}
Copy after login

How to set the length of hr in css

(Learning video sharing: css video tutorial

The above is the detailed content of How to set the length of hr in css. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!