Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Senior Member kirman's Avatar
    Join Date
    May 2003
    Location
    UK England
    Posts
    765
    Member #
    1499
    Liked
    2 times
    Hi all,

    Ive managed to align my webpage to the centre woohoooo! However i have a massive gap above the header and id like it to be flush to the top of the page. How would i do this in css.

    Cheers then
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <style type="text/css">
    .outer    {
    width:854px;
    height:auto;
    margin: 0 auto;
        }
    .header    {
    width:854px;
    height:318px;
    background-position:center;
    background-image: url(images/image_02.gif);
    background-repeat: no-repeat;
        }
    .navbar    {
    width:854px;
    height:37px;
        }
    .subheadinghome    {
    width:854px;
    height:35px;
    background-position:center;
    background-image:url(images/image_10.gif);
    background-repeat:no-repeat;
        }
    #bodyboxhome    {
    width:854px;
    height:auto;
    background-color:#FFFFFF;
        }
     
        </style>
    <title>Untitled Document</title>
    </head>
    
    <body>
    <div class="outer">
     
    <div class="header"></div>
    <div class="navbar"><img src="images/image_04.gif" width="149" height="37" /><img src="images/image_05.gif" width="121" height="37" /><img src="images/image_06.gif" width="129" height="37" /><img src="images/image_07.gif" width="148" height="37" /><img src="images/image_08.gif" width="129" height="37" /><img src="images/image_09.jpg" width="178" height="37" /></div>
    <div class="subheadinghome"></div>
    <div class="bodyboxhome"></div>
    </div>
    
    </body>
    </html>
    Dream like you'll live forever. Live like you're gonna die 2morrow!

  2.  

  3. #2
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    I always specify ( just my way of doing it )... The body element for every CSS file I do.

    I try and define at least margins and padding on that level

    For you try:

    body{margin:0}

    Or body{margin-top: 0}

    All browsers have some default padding and margin settings they use, if you don't define them, each browser is a little different, but if you define the body margin, it will use it. Instead of inserting its own default margin in.

  4. #3
    Senior Member kirman's Avatar
    Join Date
    May 2003
    Location
    UK England
    Posts
    765
    Member #
    1499
    Liked
    2 times
    Perfect! Thank you :-)
    Dream like you'll live forever. Live like you're gonna die 2morrow!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 04:36 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com