SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist
    Join Date
    Jul 2004
    Location
    England
    Posts
    588
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using @import and media type.

    This came up in another thread in which it's suggested to use individual screen and print css with a link rel.

    Having forgotten the exact details, I'm using @import to hide the css from some browsers - and if I remember correctly (unlikely!) I couldn't add a media type without compromising this.

    I'm hoping someone can clarify this.

    If I use:
    -----
    <style type="text/css" media="screen">@import 'http://domain.com/css/main/master.css';></style>
    -----

    does it still exclude various browsers?

  2. #2
    SitePoint Member talladega's Avatar
    Join Date
    Mar 2008
    Location
    UK
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your above code should hide the CSS from Netscape 4 and below. If you want to hide it from various versions of IE, use conditional comments.

  3. #3
    SitePoint Evangelist
    Join Date
    Jul 2004
    Location
    England
    Posts
    588
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. My master.css also uses the highpass filter to exclude browsers other than IE5/Mac or later (although this browser is already excluded by the @import), IE6 or later, Netscape 6 or later, Opera 5 or later, etc.

    Does changing from:

    <style type="text/css">@import 'http://domain.com/css/main/master.css';></style>

    to:

    <style type="text/css" media="screen">@import 'http://domain.com/css/main/master.css';></style>

    affect those exclusions or cause any other issues?

  4. #4
    SitePoint Member talladega's Avatar
    Join Date
    Mar 2008
    Location
    UK
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •