br line-height in safari and chrome leaving gap

Posted by Mike on Stack Overflow See other posts from Stack Overflow or by Mike
Published on 2009-06-09T01:36:33Z Indexed on 2010/05/15 1:34 UTC
Read the original article Hit count: 490

Filed under:
|
|
|
|

In my HTML I have a div and inside the div I have different vertical spacing between lines of text. I achieve this by using breaks and defining the height, i.e. <br /><br class="height5" /> or height2 or height10 or whatever.

In my stylesheet I define it like:

br.height2 {line-height:2px;} br.height5 {line-height:5px;}

This is working in IE6+ FF2+ and Opera but for some reason there are huge gaps in Safari and Chrome (like those two browsers are ignoring it and just applying regular breaks). I tried testing with larger line-heights like 20px or 30px and Safari and Chrome recognize those. They seem to be ignoring anything under 5-10 pixels.

Help? Thanks!

© Stack Overflow or respective owner

Related posts about html

Related posts about div