Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Member bil2k's Avatar
    Join Date
    Dec 2005
    Posts
    50
    Member #
    12214
    What is the difference between linking to a style sheet and importing a style sheet?

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Linking is the simplest method and links directly from the markup. Importing is done within another stylesheet and is not supported by very old browsers.

    WDF here uses importing for a lot of the style for simplicity's sake:
    Code:
    @import url('framework-links.css');
    @import url('framework-search.css');
    @import url('framework-navbar.css');
    @import url('framework-infobar.css');
    @import url('framework-footer.css');
    @import url('framework-adsense.css');
    @import url('framework-messages.css');
    @import url('framework-awards.css');
    @import url('framework-pagenav.css');
    @import url('framework-editoroverrides.css');
    @import url('framework-bbcode.css');
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    Member bil2k's Avatar
    Join Date
    Dec 2005
    Posts
    50
    Member #
    12214
    So the only advantage importing has is that one style sheet can be "embedded" within another?

  5. #4
    Senior Member igeek's Avatar
    Join Date
    Oct 2005
    Posts
    202
    Member #
    11644
    it also hides css from older browsers..

    http://w3development.de/css/hide_css...owsers/import/

  6. #5
    Senior Member Eddy Bones's Avatar
    Join Date
    Jan 2004
    Location
    Washington, USA
    Posts
    1,054
    Member #
    4651
    If you try to import it in the markup you'll end up with a flash of unstyled content in Internet Explorer. You would have to add a link or script element to combat it.

    http://www.bluerobot.com/web/css/fouc.asp

  7. #6
    Senior Member igeek's Avatar
    Join Date
    Oct 2005
    Posts
    202
    Member #
    11644
    Great point.. Eddy. I forgot about that article..
    it is defiantly worth noting..


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 04:59 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com