SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2004
    Location
    sacramento
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    html margin question

    Everytime I create a basic html page it gives me a margin. Meaning my header logo dosent go all the way to the top of my page, and I want it all the way at the top, can anybody help?

  2. #2
    SitePoint Addict
    Join Date
    Feb 2003
    Location
    durango
    Posts
    211
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    in your body tag

    <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

  3. #3
    SitePoint Addict
    Join Date
    Jul 2000
    Posts
    201
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    or use css:
    Code:
    <style type="text/css">
    html, body{margin:0;}
    </style>

  4. #4
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    make sure you add padding to the css as opera uses padding for its default margins.

    Code:
    <style type="text/css">html, body{margin:0;padding:0;}</style>
    Use css rather than the deprecated html elements mentioned above unless of course you want to support computers that run on steam (e.g. nn4)

    Paul

  5. #5
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If your logo is inside something else (like a tabe if the page is old style, or a header tag if it is new style) them make surethat that has no margins or padding either.

    Douglas
    Hello World


Bookmarks

Posting Permissions

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