Any way to have CSS style sheets on my web site automatically turned off when viewed

Discussion in 'CSS' started by MrPJH, Mar 31, 2007.

  1. #1
    have a Web site that I want to be able to be used by people who go on the Internet on their phones or PDAs. My site looks fine on both when the CSS style sheets are turned off, but not so great when they are on. Any code that I can put in site to make them automatically turn off for mobile devices?
     
    MrPJH, Mar 31, 2007 IP
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #2
    There is a media attribute to the link element.

    cheers,

    gary
     
    kk5st, Mar 31, 2007 IP
  3. AdamSee

    AdamSee Well-Known Member

    Messages:
    422
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    135
    #3
    With that media attribute that Gary mentions, you have;

    Media type 'screen', which are usually computer monitors or other high res devices.
    <link rel="stylesheet" type="text/css" media="screen" href="/stylesheets/base.css" />
    Print for printers
    <link rel="stylesheet" type="text/css" media="print" href="/stylesheets/print.css" />

    Others listed here:

    http://www.w3.org/TR/REC-CSS2/media.html#media-types
     
    AdamSee, Mar 31, 2007 IP