Horizontal Lines on HTML
Horizontal Lines :
• Horizontal lines are used to visually break-up sections of a document.• The <hr> tag creates a line from the current position in the document to theright margin and breaks the line accordingly.• <hr /> tag is also an example of the empty element, where you do not needopening and closing tags, as there is nothing to go in between them.• The <hr /> element has a space between the characters hr and the forward slash. If you omit thisspace, older browsers will have trouble rendering the horizontal line, while if you miss the forward slash character and just use <hr> it is not valid in XHTML.
Example :
<!DOCTYPE html>
<html>
<head>
<title>Horizontal Line Example</title>
</head>
<body>
<p>This is paragraph one and should be on top</p>
<hr />
<p>This is paragraph two and should be at bottom</p>
</body>
</html>
OUTPUT:
This is paragraph one and should be on top
This is paragraph two and should be at bottom
Comments
Post a Comment