different css to dif resolution

Discussion in 'HTML' started by julian_m, Nov 24, 2005.

  1. julian_m

    julian_m Guest

    I'm thinking to do the following to be able to render the page
    according to the user resolution

    [pseudo-code]

    <html>
    <head>
    <meta blah blah blah
    ......

    if userselect = 800x600 {
    <link rel="stylesheet" type="text/css" href="style800.css" >
    }elseif userselect = 1024x768 {
    <link rel="stylesheet" type="text/css" href="style1024.css" >
    }elseif userselect = 640x480 {
    <link rel="stylesheet" type="text/css" href="style640.css" >
    }

    [/pseudo-code]

    Note that it will be coded in php, and the user will select certain
    resolution (userselect parameter) given his own preferences

    What do you think about this aproach?

    regards - julian
     
    julian_m, Nov 24, 2005
    #1
    1. Advertising

  2. julian_m

    Els Guest

    julian_m wrote:

    > I'm thinking to do the following to be able to render the page
    > according to the user resolution


    [snip pseudo-code]

    > Note that it will be coded in php, and the user will select certain
    > resolution (userselect parameter) given his own preferences
    >
    > What do you think about this aproach?


    Useless.
    What if the user has the resolution set to 1280x1024 but is surfing
    with their browser set to 933x867?

    --
    Els http://locusmeus.com/
    Sonhos vem. Sonhos vão. O resto é imperfeito.
    - Renato Russo -
    Now playing: Christina Aguilera - Make Over
     
    Els, Nov 24, 2005
    #2
    1. Advertising

  3. julian_m

    Toby Inkster Guest

    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
     
    Toby Inkster, Nov 24, 2005
    #3
  4. julian_m

    Neredbojias Guest

    With neither quill nor qualm, julian_m quothed:

    > I'm thinking to do the following to be able to render the page
    > according to the user resolution
    >
    > [pseudo-code]
    >
    > <html>
    > <head>
    > <meta blah blah blah
    > .....
    >
    > if userselect = 800x600 {
    > <link rel="stylesheet" type="text/css" href="style800.css" >
    > }elseif userselect = 1024x768 {
    > <link rel="stylesheet" type="text/css" href="style1024.css" >
    > }elseif userselect = 640x480 {
    > <link rel="stylesheet" type="text/css" href="style640.css" >
    > }
    >
    > [/pseudo-code]
    >
    > Note that it will be coded in php, and the user will select certain
    > resolution (userselect parameter) given his own preferences
    >
    > What do you think about this aproach?


    In most cases wouldn't percentages work the same?

    --
    Neredbojias
    Contrary to popular belief, it is believable.
     
    Neredbojias, Nov 24, 2005
    #4
  5. julian_m

    Neredbojias Guest

    With neither quill nor qualm, Els quothed:

    > julian_m wrote:
    >
    > > I'm thinking to do the following to be able to render the page
    > > according to the user resolution

    >
    > [snip pseudo-code]
    >
    > > Note that it will be coded in php, and the user will select certain
    > > resolution (userselect parameter) given his own preferences
    > >
    > > What do you think about this aproach?

    >
    > Useless.
    > What if the user has the resolution set to 1280x1024 but is surfing
    > with their browser set to 933x867?


    Then she would get the "normal" resolution unless she opted for a
    smaller one for convenience.

    --
    Neredbojias
    Contrary to popular belief, it is believable.
     
    Neredbojias, Nov 24, 2005
    #5
  6. julian_m

    Els Guest

    Neredbojias wrote:

    > With neither quill nor qualm, Els quothed:
    >
    >> julian_m wrote:
    >>
    >>> I'm thinking to do the following to be able to render the page
    >>> according to the user resolution

    >>
    >> [snip pseudo-code]
    >>
    >>> Note that it will be coded in php, and the user will select certain
    >>> resolution (userselect parameter) given his own preferences
    >>>
    >>> What do you think about this aproach?

    >>
    >> Useless.
    >> What if the user has the resolution set to 1280x1024 but is surfing
    >> with their browser set to 933x867?

    >
    > Then she would get the "normal" resolution unless she opted for a
    > smaller one for convenience.


    Ah, okay, like this then:

    What's your resolution?
    [] 640x480
    [] 800x600
    [] 1024x768
    [] I don't know
    [] My resolution is not what counts,
    but my window is about
    [] 640 wide
    [] 800 wide
    [] 1024 wide
    [] I don't know
    [] I'll have the flexible version, please - thanks :)

    --
    Els http://locusmeus.com/
    Sonhos vem. Sonhos vão. O resto é imperfeito.
    - Renato Russo -
    Now playing: Electric Boys - Tear It Up
     
    Els, Nov 24, 2005
    #6
  7. julian_m

    Neredbojias Guest

    With neither quill nor qualm, Els quothed:

    > Neredbojias wrote:
    >
    > > With neither quill nor qualm, Els quothed:
    > >
    > >> julian_m wrote:
    > >>
    > >>> I'm thinking to do the following to be able to render the page
    > >>> according to the user resolution
    > >>
    > >> [snip pseudo-code]
    > >>
    > >>> Note that it will be coded in php, and the user will select certain
    > >>> resolution (userselect parameter) given his own preferences
    > >>>
    > >>> What do you think about this aproach?
    > >>
    > >> Useless.
    > >> What if the user has the resolution set to 1280x1024 but is surfing
    > >> with their browser set to 933x867?

    > >
    > > Then she would get the "normal" resolution unless she opted for a
    > > smaller one for convenience.

    >
    > Ah, okay, like this then:
    >
    > What's your resolution?
    > [] 640x480
    > [] 800x600
    > [] 1024x768
    > [] I don't know
    > [] My resolution is not what counts,
    > but my window is about
    > [] 640 wide
    > [] 800 wide
    > [] 1024 wide
    > [] I don't know
    > [] I'll have the flexible version, please - thanks :)


    -Er, I guess. Seems a bit complicated but the general concept of
    letting the user pick the page size is one I like and one I think is
    possible.

    Btw, Opera 8.51 is out but I dunno what they changed.

    --
    Neredbojias
    Contrary to popular belief, it is believable.
     
    Neredbojias, Nov 25, 2005
    #7
  8. julian_m wrote:
    > I'm thinking to do the following to be able to render the page
    > according to the user resolution
    >
    > [pseudo-code]
    >
    > <html>
    > <head>
    > <meta blah blah blah
    > .....
    >
    > if userselect = 800x600 {
    > <link rel="stylesheet" type="text/css" href="style800.css" >
    > }elseif userselect = 1024x768 {
    > <link rel="stylesheet" type="text/css" href="style1024.css" >
    > }elseif userselect = 640x480 {
    > <link rel="stylesheet" type="text/css" href="style640.css" >
    > }
    >
    > [/pseudo-code]
    >
    > Note that it will be coded in php, and the user will select certain
    > resolution (userselect parameter) given his own preferences
    >
    > What do you think about this aproach?
    >
    > regards - julian
    >


    Remember the three click rule.

    If it takes the user more than 3 clicks to find what they are looking
    for, they've gone to another site.

    The site would have to be pretty special for me to fill out a form
    before I even view the site.

    IMHO.

    Jeff

    __
    www.calgarywebguy.com
     
    CalgaryWebGuy, Nov 25, 2005
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrew FPGA
    Replies:
    0
    Views:
    1,001
    Andrew FPGA
    Sep 26, 2005
  2. user
    Replies:
    1
    Views:
    441
    Gunnar Hjalmarsson
    Dec 9, 2003
  3. Elhanan
    Replies:
    1
    Views:
    465
    Aquila Deus
    Apr 21, 2005
  4. birdynumnum
    Replies:
    6
    Views:
    1,090
    brucie
    Oct 26, 2004
  5. malli
    Replies:
    4
    Views:
    584
    Manivannan Palanichamy
    Jul 8, 2007
Loading...

Share This Page