Hey there, I'm pretty new to frontend development so please excuse me if this is a silly question :)
I know that it's not usually done, but when you apply line-height
to an element like an h1
, it adds extra space both on the top and bottom of that element.
It makes some sense, but I really just want the line-height
to be added to the bottom of the element so that the tops of my headings (h1, h2
, etc.) line up perfectly with other elements.
You can see the issue in this jsfiddle: http://jsfiddle.net/zja4c/1/
And here's a jsfiddle showing what I'm trying to accomplish, though I had to use negative margins: http://jsfiddle.net/25UTA/
The h1
with a red background aligns correctly with the top of the left div
, but the text doesn't.
So my question is: Is there any way to:
Apply
line-height
only to the bottom of an element, orAlign an element to the top of the space created by adding
line-height
somehow?