3.4 -> hummm, question about CSS. How to set the topmargin="0"

Author Message

laurent le cadet

Monday 26 July 2004 1:59:27 am

Hi,

It's a very basic question but I can't set the top margin of the layout.tpl to "0".
In site.css we have :

div#allcontent
{
	width: 750px;
	margin: 0 auto 0 auto;
}

but it print the page_layout as on this eZ systems site (with a defaut topmargin).

I tried to add directly in the body tag of my page_layout topmargin="0", but there is no change...

It seems to be a very very basic problem, but I can't solve it (shame on me ! :)

If someone can help me.

Thanks.

Laurent.

Alex Jones

Monday 26 July 2004 6:06:00 am

Laurent, make sure that the top padding for body is also set to 0, in addition to setting your body margin to 0.

Also, so you know, you can reduce your code a bit, by changing your above code to:

div#allcontent
{
	width: 750px;
	margin: 0 auto;
}

You don't need to use the additional '0 auto' in your margin. This version will assume that you want both the top and bottom margins to be 0, while your left and right margins will be set to auto.

Hope this helps,

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

laurent le cadet

Monday 26 July 2004 6:20:29 am

Hi Alex,

I tried what you said before to "have the chances to my side" but nothing...still a 10 px height topmargin...

I even removed completly the allcontent class.

Voodoo ?

Laurent

Mikhail Chekanov

Monday 26 July 2004 6:51:30 am

Try

body {
    margin: 0;
    padding: 0;
        ...
    }
div#allcontent {
    position: relative;
    width: 750px;
    margin: 0 auto;
    }

--
mike
#6595551

laurent le cadet

Monday 26 July 2004 7:09:32 am

Your are right Mikhail,

I forgot the "padding: 1em;" in the core.css (body).
Nearly everything is base on CSS now...lots of flexibility but so many class and style sheets.

Thanks for your help (both of U).

Laurent.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.