I'm trying to create a vertical rhythm on my page.
The rhythm I'm working to is 18px.
I've reset the font size to 62.5% (10px) and I'm working with a 12px (1.2em) paragraph font size, with 150% line-height (18px) and a 0 1.5em margin (18px).
That's all fine and the rhythm is working fine on the paragraphs.
On the heading 1 I've got 3.6em/150%, which also works fine as it's 54px line-height (3 x 18px) -- so that flows correctly across one or two lines.
However I'm completely stuck trying to get a 3em heading (my heading 2) to align correctly when it spans 1 or 2 lines.
I'm using 3em/150%, which is a 45px line-height. That means to get it to align to the grid it needs an additional 9px (which is 0.3 x 3em).
Without increasing the line-height, how can I add the extra 0.3em to the heading 2 to give it vertical rhythm?
If I add margin to the top of the h2 it works when the heading is one line but it breaks the rhythm if the heading spans two lines.
Is it possible to keep this rhythm without increasing the line-height past 150%?
Thanks in advance for any help.
Here's my CSS:
body, h1, h2, h3, h4, h5, p, ul, ol, li, blockquote, cite { padding: 0; margin : 0; }
body { background: url(grid.png) 0 0; font-size: 62.5%; }
html>body { font-size: 10px; }
.wrapper { max-width: 960px; min-width: 320px; }
p { font: 1.2em/150% Helvetica, sans-serif; color: #333; margin: 1.5em 0 1.5em 0; background:#ccc; }
h1 { font: normal 3.6em/150% Georgia, "Times New Roman", Times, serif; color: #333; background: Red; }
h2 { font: normal 3em/150% Georgia, "Times New Roman", Times, serif; color: #333; padding: 0.3em 0 0 0; background: Blue; }
h3 { font: normal 2.4em/150% Georgia, "Times New Roman", Times, serif; color: #333; background: Green; }