whytheq
whytheq

Reputation: 35557

Enforcing a narrower row height

I have this line of HTML:

<div style=''line-height: 0.75em;min-height: 0.75em;''>&nbsp;</div>

The result is a line that is the same height as all other lines in the document.

How do I amend this code so that the blank line is 75% the height of all other lines?

Upvotes: 0

Views: 42

Answers (1)

Rob Moll
Rob Moll

Reputation: 3453

You should remove one of the sets of single quotes.

This:

<div style=''line-height: 0.75em;min-height: 0.75em;''>&nbsp;</div>

Should be:

<div style='line-height: 0.75em;min-height: 0.75em;'>&nbsp;</div>

<div>Sample line 1</div>
<div style='line-height: 0.5em;min-height: 0.5em;'>&nbsp;</div>
<div>Sample line 2</div>
<!-- change the line-height and min-height values to see the blank line height change. -->
<!-- Also use 2 sets of single quotes to see that this results in the style attributes being ignored. -->

Upvotes: 2

Related Questions