Search code examples
cssprogramming-languages

How do you get a css box to extend the entire width of the browser window?


For example, if you look at Facebook, they have a short blue bar on top that extends the entire width of the browser. I thought about using width:100%; but I know that it needs to have a parent element to be able to do that.


Solution

  • One way:

    <div style="position:absolute;left:0px;right:0px;height:20px">&nbsp;</div>