Friday, January 24, 2025
HomeProgrammingHow to add horizontal line in HTML

How to add horizontal line in HTML

To add a horizontal line in HTML, you can use the <hr> tag. This tag is self-closing and doesn’t require a closing tag. Here’s a simple example:

<hr>

You can also customize its appearance using CSS. For example, to change its color, thickness, and style, you can do something like this:

<hr style="border: 1px solid #000; width: 50%; margin: 20px auto;">

This will create a horizontal line that is 1px thick, solid, black in color, and 50% the width of its container, with some space around it.

RELATED ARTICLES
0 0 votes
Article Rating

Leave a Reply

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
- Advertisment -

Most Popular

Recent Comments

0
Would love your thoughts, please comment.x
()
x