Mobile Phone WEbsites

Discussion in 'Web Design and Development' started by dingdongbubble, Jul 21, 2007.

  1. dingdongbubble macrumors 6502a

    Joined:
    Jun 1, 2007
    #1
    Hi

    I am a beginner in WEb Designing and believe it or not I got started onl yesterday by following the link to HTML Dog on the post: Beginning Website design and DEvelopment.

    I would like t ask you if it is possible to set your website's behaviour according to the browser viewing it? I want to do this so that my website can be viewed form mobile phones.

    This idea came to my mind when I went to CSSEdit's website and copied their webpage source onto a text editor, removed the CSS link and saved it as an HTML. When I opened the file, the website was shockingly simple. It was the implementation of CSS which had made the website look gorgeous.

    So I was wondering if it were possible for my website to not disable the CSS when a mobile phone browses onto it?
     
  2. Mac In School macrumors 65816

    Joined:
    Jun 21, 2007
    #2
    Yes, you can. You can do it via CSS or Javascript, but I would probably do it in a server-side language, so the extra code is transparent to people and spiders.
     
  3. aaronbrethorst macrumors member

    Joined:
    Feb 1, 2007
    Location:
    Seattle, WA
    #3
    In theory, the media attribute on the link tag should let you handle just this sort of scenario. Let's say you design a website and develop two separate stylesheets for it; one is targeted at regular computers and another is targeted at mobile devices.

    For computers, you can get them to use your desktop-centric stylesheet by specifying media="screen" in the link tag where you bring in your CSS file.

    For mobile devices, you should be able to (in theory) get them to use your mobile-centric stylesheet by specifying media="handheld". In practicality, this can be a total crapshoot.
     
  4. angelneo macrumors 68000

    Joined:
    Jun 13, 2004
    Location:
    afk
    #4
    On the server side script, you can just do a user agent check, this will roughly tell you what browser, phone or OS the user is running on. Bear in mind that it is possible to spoof other browsers or OS.
     

Share This Page