SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    May 2006
    Posts
    291
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to Get Divs to Go to Edge

    Hi Guys

    Re:

    http://www.highlycreative.co.uk/test...uts/test11.htm

    How do I make the coloured divs go right to the edge of the browser, I thought it would be:

    #container {
    margin: 0;
    }

    but that doesn't appear to work.

    Thanks

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,301
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    You need

    Code:
    body {margin: 0;}
    Browsers have defaults styles, like margin and padding on various things, so some designers like to start with a "reset" that removes many of these defaults, such as:

    Code:
    html, body, h1, h2, h3, h4, h5, h6, p, a, blockquote, pre, code, hr, img, form, fieldset, legend, label, textarea, span, em, strong, sub, sup, cite, table, tbody, td, tfoot, th, thead, tr, tt, dl, dt, dd, ol, ul, li {margin: 0; padding: 0;}


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
  •