Home > Article > Web Front-end > How to set the length of hr in css
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.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer. The
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.
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; }
(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!