How to stretch a DIV to full width of browser ?

Discussion in 'HTML & Website Design' started by nickjason, Feb 23, 2010.

  1. #1
    I want a div to be stretched fully to 100% width of a browser. I made the width to 100% but still there is some blank space is there. Here i have attached the link to image.. i want the image to be fully stretched. Let me know how to do this..
     
    nickjason, Feb 23, 2010 IP
  2. darkblade

    darkblade Peon

    Messages:
    187
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Did you make sure that margin = 0; and padding = 0; ?
     
    darkblade, Feb 23, 2010 IP
  3. findonline

    findonline Peon

    Messages:
    149
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Try this for starters as your style for your div:

    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;

    Hope that helps, 100%-ing divs is kind of tricky. Good luck!
     
    Last edited: Feb 23, 2010
    findonline, Feb 23, 2010 IP