treehouse : what would you like to learn today?
Web Design Web Development iOS Development

sidebar

  • ok, so i have a div that i want to stretch the entire height of the screen, but i can't do it, i tried height: 100% but that didnt do anything

    any ideas?
    Many Thanks
    Chris
  • Divs really aren't intended to work like that. What are you intending to do with the 100% height div? Sometimes you can fake things using background images... depends what you are going for. Tables can be used to get a 100% height, but using tables for layout is generally frowned upon.
  • the site im working on has the same sort of style as a wordpress site, like a side bar down the side, but the sidebar has a differant background image to the main background and i wanted it to all the way down to the bottom.

    Many Thanks
    Chris
  • A div will only extend as far as it's content needs it to - so you'll have to fake it using a bacground image that spans the whole page, but has an area designed to look like a separate column. Try this article http://www.alistapart.com/articles/fauxcolumns/ to get the full picture (no pun intended!).