PDA

View Full Version : [CSS] Simple problem in layout



timROGERS
17-02-2007, 06:11 PM
I am trying to make my first few layouts in CSS, and I'm having a small problem with the margin on one of my DIV's.

In the #maincontent div, I can't get it to put a margin onto the right side, no matter what I do. At the moment it looks too squashed up against the right navigation menu.

Any ideas what I need to do? It's at http://www.tim-rogers.co.uk/layoutcoding/blog/

YouFail
17-02-2007, 06:49 PM
In main content take 3 pixels away from the width and add:


padding-right: 3px;

Hope it helps :)

timROGERS
17-02-2007, 07:19 PM
That didn't fix it. The problem is occuring because the #maincontent div has no width, it's just occupying the space in #container that the navigation doesn't take up. I think it is putting the 3px padding on the right of the container and not on the right of the #maincontent div.

EDIT: I've just done it by setting a lower width of the maincontent div. Not the best way of doing it, but at least it works!

Want to hide these adverts? Register an account for free!