To create a horizontal line in HTML, use the
tag. It is a self-closing tag and does not require a closing tag. By default, it creates a horizontal line that spans the width of the container. Here’s an example:
You can also customize the appearance of the horizontal line using CSS, such as changing its color, width, or style:
This will create a black line that is 50% the width of its container. The
tag is commonly used for separating sections of content.