Jump to content

Make <div> Take Up % Of Window But Also Set Minimum Size


miocene
 Share

Recommended Posts

OK currently my site has style settings that make it take up 68% of the browser window. This works great for large resolutions but for smaller resolutions (ie on iphone, netbook etc) some things like tables, embedded objects etc. get forced off the side. This is my site: http://www.topuptents.x10hosting.com/. Try resizing ur browser window and see how the site changes.Is there a way to make my site take up 68% most of the time but limit the lowest width it can go to, so it will fill a low-resolution window and a scrollbar may appear for really low resolutions? I.e style="width: 68% or 660px" (whichever is larger)Maybe also set a maximum size for really high resolutions (e.g max width= 2000px) so thie site doesn't get stretched also.Any help appreciated

Link to comment
Share on other sites

I haven't looked at your code, but you should be able to use min-width alongside with widthHere's an example:

.something {  width: 80%  min-width: 500px;}

Link to comment
Share on other sites

you'll just have to try. FF, Safari and Opera are pretty consistent standards wise, but IE likes to play to the beat of its own drummer. Validation is only a recommendation unfortunately, not a guarantee. :)

Link to comment
Share on other sites

usually if you can get it to work in IE then that's a good start. Although which version of IE did you test? I'm not sure what the statistics are regarding IE6/IE7 usage, but it might be worth taking into consideration, only for the fact that IE6 is quite the bugger, standards wise. IE7 is better and I'm not sure what the verdict is on IE8 yet, but I think M$ is still off in we-don't-need-no-stinking-standards-compliance-browser land... :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...