Quick Answer: How do you add a line in HTML CSS?

How do I make a horizontal line in HTML?

The HTML <hr> adds a thematic division between paragraph-level elements. This element creates a horizontal line, making a division within content. The HTML <hr> tag has no closing tag since it does not contain any content.

How do I add a GREY line in HTML?

<hr /> is this what you mean? However, the fact that the line is gray is online its default behaviour. Using CSS you can style it as you like. You’re probably referring to <hr/> , which is a Horizontal Rule.

How do you draw a straight line in CSS?


  1. .line-1 {
  2. height: 1px;
  3. background: black;
  4. }
  5. .line-2 {
  6. border-top: 1px solid black;
  7. }

How do you insert a vertical 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.

How do I insert a horizontal line between two divs?

To add a horizontal line between two divs, just put <hr> between the divs. You can use CSS to style this in a variety of ways such as adjusting the color and thickness of the line as well as the top and bottom margins.

THIS IS INTERESTING:  How do I declare a CSS class in HTML?

How pre tag is used in HTML?

The <pre> HTML element represents preformatted text which is to be presented exactly as written in the HTML file. The text is typically rendered using a non-proportional, or “monospaced, font. Whitespace inside this element is displayed as written.

How do you insert a table in HTML?

To create table in HTML, use the <table> tag. A table consist of rows and columns, which can be set using one or more <tr>, <th>, and <td> elements. A table row is defined by the <tr> tag. To set table header, use the <th> tag.

Website creation and design