...

View Full Version : Space at top of page? How do I remove it?



J.Ivory@HotMail
08-05-2007, 07:16 PM
Ok so I am ready to publish my first html only pages but there is a space at the top of the page above my header image is there a way to remove it? so that the header is at the very top of the page.



Thanx for any help.

Jutlander
08-05-2007, 07:19 PM
Show us your code. My guess would be to add the below code in your stylesheet, but it MIGHT mess up the layout, but then again, can't tell if we haven't got the code.


* {
margin: 0;
padding: 0;
}

Roc
08-05-2007, 07:29 PM
I think he just wants to edit the topmost wrapper for now.
Add the following to the topmost div in your layout (or the body class)
{
margin-top: 0;
padding-top: 0;
}

What jutlander suggested is the best way to do it, if you are just starting with the layout or want to optimize your present layout.

VIPStephan
08-05-2007, 09:05 PM
I think he just wants to edit the topmost wrapper for now.
Add the following to the topmost div in your layout (or the body class)
{
margin-top: 0;
padding-top: 0;
}

What jutlander suggested is the best way to do it, if you are just starting with the layout or want to optimize your present layout.

Hang on, there are a million reasons why the OP could have a space at the top. And without seeing the code we can only guess but if I had to guess I’d guess it’s the default margin/padding of the body element OR a default margin of an element that sits at the very top (e.g. a headline that could also be within a header div within the wrapper div and would still add a space on top - keyword: “collapsing margins”). So your code wouldn’t do anything, Roc, because divs usually have no margin anyway.

And what’s a “body class”? :confused:

Roc
08-05-2007, 09:41 PM
but if I had to guess I’d guess it’s the default margin/padding of the body element
Thats what I wanted to say too. Unfortunately I wasnt very clear.

:P I meant the style tags for the body element. I was just suggesting one of many possible solutions coz I once faced the problem of empty space above header. Seems there was a problem of browser compatibility. So explicitly specifying it to 0 helped.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum