Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Space at top of page? How do I remove it?

    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.

  • #2
    Regular Coder Jutlander's Avatar
    Join Date
    Jun 2007
    Location
    In my own sick little world :P
    Posts
    425
    Thanks
    1
    Thanked 12 Times in 12 Posts
    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.

    Code:
    * {
    margin: 0;
    padding: 0;
    }
    .
    .

  • #3
    Roc
    Roc is offline
    New Coder
    Join Date
    Jul 2007
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #4
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,695
    Thanks
    6
    Thanked 1,011 Times in 984 Posts
    Quote Originally Posted by Roc View Post
    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”?
    Last edited by VIPStephan; 08-05-2007 at 08:11 PM.

  • #5
    Roc
    Roc is offline
    New Coder
    Join Date
    Jul 2007
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Last edited by Roc; 08-05-2007 at 08:43 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •