Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

So whenever I set the page line-height at 22px, the page looks fine with a 13px font. But when I insert for example a sentence in a 24pt, or 36pt (xx-large in wordpress font-size drop-down menu), the sentence looks so compact, squeezed together vertically.

The remedy I only found was to insert style="line-height:normal" in the sentence <p> tag.

Is there a way to automate this, like all fonts larger than 22px should have line-height = normal? Is there a way to do this in css?

thanks.

share|improve this question
This seems to be styling issue and is very loosely related to WordPress. Please provide some details if this can be conflict with specific theme and plugins or somethings, otherwise it will be closed and/or migrated to other site. – Rarst Apr 6 '11 at 9:00
ok, this just applies to wordpress. But I think its a styling issue. I don't know where to post this correctly? – John Apr 6 '11 at 9:03
this is off-topic, flagged to close/move – anu Apr 6 '11 at 9:36

closed as off topic by Rarst Apr 6 '11 at 9:48

Questions on WordPress Answers are expected to relate to WordPress within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

1 Answer

Always use unitless values for line-height.

Wrong
Fails for users with a minimum font-size of 22px.

font-size:   14px;
line-height: 21px;

Slightly Better
Fails for elements with smaller sized parents.

font-size:   14px;
line-height: 150%;

Much Better
At least the basic readability is preserved for users with a minimum font-size above 14px.

font-size:   14px;
line-height: 1.5;

Best
No one has to use the zoom tool. You have to test just one setting.

font-size:   1em;
line-height: 1.5;

Tip: Questions about HTML and CSS belong to stackoverflow.com.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.