G
Glam Ledger

How do you create a horizontal line in HTML?

Author

David Mack

Published Apr 19, 2026

Unless it's just a border what you want, then you can use a combination of padding, border and margin, to get the desired bound. In HTML5, the <hr> tag defines a thematic break. In HTML 4.01, the <hr> tag represents a horizontal rule. If you really want a thematic break, by all means use the <hr> tag.

Likewise, how do I make a horizontal line in HTML?

The <hr> tag in HTML stands for horizontal rule and is used to insert a horizontal rule or a thematic break in an HTML page to divide or separate document sections. The <hr> tag is an empty tag and it does not require an end tag. Used to specify the alignment of the horizontal rule.

Secondly, how do I make a horizontal line in HTML w3schools? In HTML 4.01, the <hr> tag represents a horizontal rule. However, the <hr> tag may still be displayed as a horizontal rule in visual browsers, but is now defined in semantic terms, rather than presentational terms. All the layout attributes are removed in HTML5. Use CSS instead.

One may also ask, how do I make a horizontal line in CSS?

Its simple to add a horizontal line in your markup, just add: <hr>. Browsers draw a line across the entire width of the container, which can be the entire body or a child element. Originally the HR element was styled using attributes.

What is horizontal line?

A horizontal line is one which runs left-to-right across the page. In geometry, a horizontal line is one which runs from left to right across the page. It comes from the word 'horizon', in the sense that horizontal lines are parallel to the horizon.

Related Question Answers

What is horizontal line in HTML?

Horizontal lines are a way to separate content and can be done using the HTML HR element or CSS border rules. HTML has the hr tag to declare a thematic break for content.

Is there a vertical rule in HTML?

There isn't a vertical rule in HTML, only a horizontal rule <hr>. You will have to use an image or a CSS border to create one. CSS is easier.

How do you draw a vertical and horizontal line in HTML?

To make a vertical line, use border-left or border-right property. The height property is used to set the height of border (vertical line) element. Position property is used to set the position of vertical line. Example 1: It creates a vertical line using border-left, height and position property.

What is BR tag?

Definition and Usage The <br> tag inserts a single line break. The <br> tag is an empty tag which means that it has no end tag.

What is the HTML code for a line break?

To add a line break to your HTML code, you use the <br> tag. The <br> tag does not have an end tag. You can also add additional lines between paragraphs by using the <br> tags. Each <br> tag you enter creates another blank line.

How do I indent in HTML?

Many developers choose to use 4-space or 2-space indentation. In HTML, each nested tag should be indented exactly once inside of its parent tag. Place a line break after every block element. Do not place more than one block element on the same line.

How do you insert a straight line in Word?

To insert a line into a Word document using the built-in Horizontal Line tool:
  1. Place the cursor where you want to insert a line.
  2. Go to the Home tab.
  3. In the Paragraph group, select the Borders drop-down arrow and choose Horizontal Line.
  4. To change the look of the line, double-click the line in the document.

How do you change the height of a horizontal line in HTML?

The HORIZONTAL RULE tag is used to divide subjects within a web page. You can specify the height of an HTML horizontal rule <HR> by adding the SIZE attribute to your horizontal rule HTML tag. Edit the text indicated in bold to suit your needs. Edit the text indicated in bold to suit your needs.

How do I change the color of a horizontal line in HTML?

You can use border-color to change the color of <hr> tag. You just need to add below line of code to your css file to change the color to any desired color. Alternatively, you can use “border-color: inherit” to set the border color to its parent element's color.

What does hr /> mean?

Human resources

How do I add a vertical separator in HTML?

Vertical line left to the div To add a vertical line you need to style an hr. This will position it to the left, you can inverse it to position it to the right. In the Previous element after which you want to apply the vertical row , You can set CSS and that positioned it directly in the center.

What is the basic structure of HTML file?

Elements : Elements are the fundamental components of the structure of an HTML, text, documents. We use HTML tags to mark the elements of the file for our browser. Some examples of elements are heads, tables, paragraphs, and lists. Elements contain plain text other elements or both.

How do you add a border in HTML?

Borders can be applied to most HTML elements within the body. To make a border around an element, all you need is border-style . The values can be solid , dotted , dashed , double , groove , ridge , inset and outset .

Where do header and footer tags typically occur?

<header> and <hgroup> The <header> element is generally found at the top of a document, a section, or an article and usually contains the main heading and some navigation and search tools.

What is div in HTML?

HTML - Div Element(s) The <div> tag is nothing more than a container unit that encapsulates other page elements and divides the HTML document into sections. Web developers use <div> elements to group together HTML elements and apply CSS styles to many elements at once.

How do you center text in HTML?

To center text using HTML, you can use the <center> tag or use a CSS property. To proceed, select the option you prefer and follow the instructions. Using the <center></center> tags. Using a style sheet property.

How do you write Web pages?

Follow these 11 principles to make sure your website content gets the attention it deserves.
  1. Know your audience.
  2. Follow the “inverted pyramid” model.
  3. Write short, simple sentences.
  4. Stick to active voice.
  5. Show, don't tell.
  6. Nix the jargon.
  7. Mix up your word choice.
  8. Make text scannable.