|
Posted by Toby Inkster on 11/24/05 10:20
julian_m wrote:
> I'm thinking to do the following to be able to render the page
> according to the user resolution
CSS 3 does actually have this sort of stuff built-in -- it's called "media
queries". Opera 7.2(?)+ has experimental support.
A page I'm working on right now has, to insert a decorational image:
DIV#image {
height: 200px;
width: 200px;
background: transparent url("img-200.png");
}
@media screen and (max-width: 320px) {
DIV#image {
height: 48px;
width: 48px;
background: transparent url("img-48.png");
}
}
This example displays a smaller background image on devices less than 321
pixels wide.
It's not much use on the wild, wild web right now, unless you're
developing a page specifically aimed at Opera users (which I am in this
case), but it's bloody good fun, and will hopefully provide a very useful
technique for us all in the future.
> Note that it will be coded in php, and the user will select certain
> resolution (userselect parameter) given his own preferences
Firstly, make sure you have a sensible default (probably the middle option).
Secondly, remember that browser size and resolution do not go hand in
hand. See: http://tobyinkster.co.uk/browser-sizes
Thirdly, most people don't know what resolution they're using. They
probably don't even know what "resolution" means. Unless you're targetting
a technical group, or a group of graphics designers, don't ask people what
their resolution is.
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Navigation:
[Reply to this message]
|