Hello
Is it possible to make the height of a div relative to the browser size?
e.g if the height of the browser is 800px, set my div height to 800px
| SitePoint Sponsor |


Hello
Is it possible to make the height of a div relative to the browser size?
e.g if the height of the browser is 800px, set my div height to 800px


www.pmob.co.uk CSS FAQ 3 col demo Read My CSS Articles
Ultimate CSS Reference
Check out SitePoint's latest JavaScript challenge


In addition to reading Paul's FAQs, which are always very informative, there are some things you must keep in mind.
UNLESS you are giving the DIV position:fixed; or all it's parent's are already 100% height of the vierwport ( which has it's own undesirable side effects, you really can't achieve 100% viewport height.
Even in Paul's 100% height demo. It's a one shot deal. It is useful to structure your markup around this and consider the occasional positioning trick.
It is also useful to know what you are trying to achieve in actuality ( some folks may think they want to make some element fill the full height of the screen .. when in fact what they need is equal height columns)
Brilliant ideas, elegant execution.
Graphic Design, Art Direction, Copywriting and Web Design.
Bookmarks