Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does BR tag posseses height?

Tags:

html

I know that BR is used to create line-breaks. I'm just wondering if it also creates space between lines? Please consider these example:

<p>
Hello <br/> Stackoverflow <br/><br/><br/> !
</p>

The output looks like:

Hello
Stackoverflow


!

By putting more and more BR I found distance between lines increase. Is it because of <br>? But when I try to control <br> height in CSS, it doesn't follow, it seems like it has no height at all, just a line-break. If <br> is not the cause of the space between line, then which is which and how to control it in CSS? Also, I usually use <br> to create large distance between lines, I do that to replace \n\r or the like when the data is from the database, is that okay?

like image 739
dpp Avatar asked Aug 12 '11 03:08

dpp


2 Answers

The <br /> tag is for line breaks. You can use the CSS line-height property to control distance between lines, if you want to look at it that way.

like image 184
Chad W Avatar answered Sep 18 '22 07:09

Chad W


for large distances between lines, is better to use <p> tags for every line, in which you can control the height.

http://jsfiddle.net/efortis/f6ju2/

like image 32
Eric Fortis Avatar answered Sep 21 '22 07:09

Eric Fortis