4
<div style="line-height:25px;">
First line of the content<br />
Second line of the content<br />
Third line of the content<br />
</div>

On usage of break tag in a <div>, the line-height property is not working with any of the attributes:

line-height:20px;
line-height:100%;
line-height:1.5;

Now the three lines are displayed with default line height and not with the specified line-height 25px. But if the <div> contains no break tag between the lines, the line height works. How to override this?

Sarvap Praharanayuthan
  • 4,212
  • 7
  • 47
  • 72
  • 1
    How do you want to apply a line height to a
    ? Think about what a br is. it has no content and only makes a carrier return. line height would have no effect on it.
    – Sven Bieder Sep 10 '12 at 17:45

1 Answers1

4

Since <br /> is an inline element, you need to apply line-height to a block element such as <p>.

<p style="line-height: 20px;">
This is some text<br />with a break tag.
</p>

You want to look at this question regarding turning <br /> into a block element.

Community
  • 1
  • 1
Kermit
  • 33,827
  • 13
  • 85
  • 121