Alignment of text between 2 cols

martink

New Member
Hi Webmasters,

In my next project I've using YUI 2: Grids CSS framework and I've created a 2 col layout. I've also used font-reset to resets all the fonts-styling.
In both cols I want to put text (paragraphs, lists, headers etc.)

Now I've a problem with horizontal alignment of my paragraphs. When I use in the left col <h1> with <p> and in the right col <h2> with <p> then the paragraphs horizontally don't align.
I know that <h1> and <h2> have different size and that's why they don't align. But how can I fix this problem in CSS to align all the font styles?

Thanks for the trouble.

Martin
 

PixelPusher

Super Moderator
Staff member
Martin,
I am guessing you want to align the paragraphs even between columns? To set the style of the h1 and h2 so that they render the same you would do something like this:

Code:
h1, h2 {
margin:5px 0; /* the above sets the top/bottom margin to 5px, and the L/R to 0. Change at will */
padding:0;
font:11pt Arial, Verdana, san-serif;
color:#000;
}

NOTE: you can only have one "H1" per page.
 

martink

New Member
Thx John,

This helps me a lot. Is it possible to use this code for paragraphs?
The problem I have as you can see at the following screenshot is:
ss.png


The different paragraphs and breaks are not even between columns.
 
Last edited:
Top