Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<hr> tag in Twitter Bootstrap not functioning correctly?

Here is my code:

<div class="container"> <div> <h1>Welcome TeamName1</h1>   asdf   <hr>   asdf  </div> </div> <!-- /container --> 

The hr tag does not seem to work as I would expect it. Instead of drawing a line, it creates a gap, like so:

enter image description here

like image 901
Henry Henrinson Avatar asked Jul 20 '12 10:07

Henry Henrinson


People also ask

Is HR tag deprecated?

All "presentation attributes" of the hr element were deprecated in HTML 4.01, and are not supported in XHTML 1.0 Strict DTD.

What is the correct syntax of HR tag?

HTML <hr> Tag. 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.

What is bootstrap HR?

hr class in bootstrap. draw a horizontal line html.


1 Answers

the css property of <hr> are :

hr {   -moz-border-bottom-colors: none;   -moz-border-image: none;   -moz-border-left-colors: none;   -moz-border-right-colors: none;   -moz-border-top-colors: none;   border-color: #EEEEEE -moz-use-text-color #FFFFFF;   border-style: solid none;   border-width: 1px 0;   margin: 18px 0; } 

It correspond to a 1px horizontal line with a very light grey and vertical margin of 18px.

and because <hr> is inside a <div> without class the width depends on the content of the <div>

if you would like the <hr> to be full width, replace <div> with <div class='row'><div class='span12'> (with according closing tags).

If you expect something different, describe what you expect by adding a comment.

like image 137
baptme Avatar answered Sep 29 '22 17:09

baptme