Topic: adding padding breaks my columns
when I change my CSS from
#left {
float:left;
width:700px;
}to this
#left {
float:left;
width:700px;
padding: 0 1em;
}my primary content column breaks. could someone help me see what's going on?
We just installed our new forum/community .. please check it out: Killersites Community. THIS FORUM IS NOW AN ARCHIVE. Old user accounts and posts have been transferred to the new forum.
I've started a new topic on the move here TALK ABOUT NEW FORUM
Stefan
when I change my CSS from
#left {
float:left;
width:700px;
}to this
#left {
float:left;
width:700px;
padding: 0 1em;
}my primary content column breaks. could someone help me see what's going on?
Adding the padding makes that div too wide. Instead of em, use px for it, and whatever you take, multiply by 2 and deduct from the width. For example:
#left {
float:left;
width:650px;
padding: 0 25px;
}so the div doesn't includes the padding? if figured it would just squish everything in. bah.
gripes aside that fixes my problem thanks much.
Last edited by wolfkin (June 22, 2009 7:49 pm)
Padding and Margin is not usually included in a Block element's width and height. You have to count it in, and calculate how much space is left within the container to set for the next floated element.
Copyright © 1996-2010 KillerSites.com | 