mike_g Posted January 12, 2008 Share Posted January 12, 2008 Hi, I am having a go at making a template using CSS to do all the formatting. I want my container and some other Divs to have a fixed minimum hight, but expand with the page content.To do this in the past I used to put all my stuff in tables, but I would like to do it in CSS if possible. Heres an example of what I have got: #container{ width: 800px; height: 600px; //I want some sort of height override that sets it at 100% if the contents are more than 600px high margin-left: auto; margin-right: auto; border: medium #FFFFFF;} Anyone know what to do? Cheers. Link to comment Share on other sites More sharing options...
boen_robot Posted January 12, 2008 Share Posted January 12, 2008 use the min/max-width and min/max-height properties instead. Unlike the widht and height, which give fixed dimensions, those two provide the element they're applied on dimensions within a certain interval. For example: min-width: 800px; min-height: 600px; max-width: 100%; max-height: 100%; You may also just use the overflow property to define what happens when the content exceeds its boundaries. For example: width: 800px; height: 600px; overflow: visible; will show the content of the whole box if the box exceeds the specified dimensions. Using the value "hidden" instead of "visible" would cut out the content that exceeds the specified dimensions. Link to comment Share on other sites More sharing options...
mike_g Posted January 12, 2008 Author Share Posted January 12, 2008 Nice one, thanks man Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.