Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Equating line-height to vertical margin Reply To: Equating line-height to vertical margin

#204518
modiophile
Participant

OK, so lets say my CSS is like so:

body { font-size: 1.6em, line-height: 1.8 }
h1 { font-size: 2.4em; margin: 1em; }

So in my example, h1 would have an inherit ‘line-height’ of ‘33.6px’. My question is, how do I get the ‘margin: 1em’ to EQUAL the inherit ‘line-height’ without having to calculate each time?