Forum Moderators: not2easy
How does one set the maximum page width while keeping a minimum.
So for example you could set the minimum to 600 pixels or 80% and have a max at 1,240 or something?
Would it be best to use java script or css?
I have to ask because I do not want to have a fixed screen size but also do not want pages to expand 100% when displayed on a massive screen.
Thank you.
However, IE6 won't understand max-width. You will need to use an expression, something like:
width:expression(document.body.clientWidth > 1024? "1024px": "auto" );
If you need further help, this should really be in the CSS forum.
Hope that helps! :)
min-width: 600px;
max-width: 1200px;
width: auto; As was said, this requires some basic CSS support. This should generally not be a problem, aside from IE 6 and earlier. For IE, take a look at Dean Edwards' IE7 library [dean.edwards.name].
<html>
<head>
<title> new document </title><style>
#max {
background-color: red;
max-width: 500px;
}
</style>
</head>
<body>
<div id="max">content</div>
</body>
</html>
What's your Doctype?
can I please just repeat that support of newer properties (css enhancements) and features in IE6 AND IE7 is only possible with a Compliant/Strict rendering DOCTYPE
and designaweb you're not thick.. it's not just you - it's IE7 that's helping highlight something that was already there
see this post [webmasterworld.com] for some further reading
Suzy
No, it shouldn't, max-width should only kick in if the viewport . . . exceeds max-width. :-)
I've had this coded in for as much as two years now on some sites and simply refuse to hack CSS for the very reasons that I don't use conditional Javascript, eventually support for it might dissappear and render a site worthless, coming back to burn me. If I get cornered in a hack, I redesign around it. So this property is the one area I've just let IE 6 do what it does. I suppose it's the one thing we should be thankful for in IE 7.
My screen res is 1920x1200 and screens are getting bigger, especially with TV and flat screen monitors etc.
There does seem to be a general consensus when it comes to minimum but not much when it comes to max.
I do realise that it depends on how the site looks but what are your ideas as most sites will begin to look funny when expanded too much?