How do you add a horizontal line color in HTML?

How do you make a horizontal line black in HTML?

Horizontal lines on a page is done with the tag <HR>. Lines are usually just black, thin, solid lines, but they can be styled with color, thickness, width etc. and they can be dashed, dotted, etc.

How do you change the color of a horizontal line?

Answer: Use the CSS background-color Property

You can simply use the CSS background-color property in combination with the height and border to the change the default color an <hr> element. In the following example we’ve changed the color of hr tag to light grey.

How do you add a line in HTML?

Type <hr> anywhere in the body of your HTML document.

The body of your HTML tag is the area in between the “<body>” and “</body>” tags. This adds a horizontal line to your HTML document. Your CSS style settings will apply anytime you use the <hr> tag in your HTML.

How do I make a horizontal line thicker in HTML?

If you want to change the thickness, or height of your horizontal line, add the height property to your <hr> style. In this case, you can also set the background-color property for the thick horizontal line.

THIS IS INTERESTING:  You asked: What is a combo box in HTML?

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

More Examples

  1. Align a <hr> element (with CSS): <hr style=”width:50%;text-align:left;margin-left:0″> …
  2. A noshaded <hr> (with CSS): <hr style=”height:2px;border-width:0;color:gray;background-color:gray”> …
  3. Set the height of a <hr> element (with CSS): <hr style=”height:30px”> …
  4. Set the width of a <hr> element (with CSS):

How do I select a horizontal line in Word?

Microsoft Word

  1. Put your cursor in the document where you want to insert the horizontal line.
  2. Go to Format | Borders And Shading.
  3. On the Borders tab, click the Horizontal Line button.
  4. Scroll through the options and select the desired line.
  5. Click OK.
Website creation and design