SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict capescafe's Avatar
    Join Date
    Dec 2004
    Location
    Bellevue, WA
    Posts
    222
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Question benefits of @import rule

    I just have a basic question...what are the benefits to using the @import rule in css? and why would you use that as opposed to just including an extra extrernal style sheet link if you have more than one style sheet, like:
    <link rel="stylesheet" type="text/css" href="styles1.css" media="screen" />
    <link rel="stylesheet" type="text/css" href="styles2.css" media="print" />

  2. #2
    SitePoint Evangelist
    Join Date
    Jul 2004
    Location
    England
    Posts
    588
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use @import to exclude specific browsers from receiving styled content.
    It can be written with slight differences to target various browsers.
    Importing additional css from a single master keeps code cleaner and aids subsequent changes... only the master css requires an edit rather than each page.

  3. #3
    SitePoint Addict capescafe's Avatar
    Join Date
    Dec 2004
    Location
    Bellevue, WA
    Posts
    222
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    ok so you mean you use the @import to only import certain rules from an external style sheet? or you import an entire style sheet. and how would you exclude specific browsers? do you have any examples?

  4. #4

  5. #5
    SitePoint Addict capescafe's Avatar
    Join Date
    Dec 2004
    Location
    Bellevue, WA
    Posts
    222
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    ah ok, thanks for those links, i'll look into those.


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
  •