SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru toasti's Avatar
    Join Date
    Feb 2004
    Location
    Grahamstown
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can u attach two style sheets to a page, and is that more efficient?

    Just wondering, can you attach more than one stylesheet to a page? like:

    <link href="styles/sheet1.css" rel="stylesheet" type="text/css">
    <link href="styles/sheet2.css" rel="stylesheet" type="text/css">

    and would that be more efficient than having one big style sheet for all pages?

    so you have a sort of base stylesheet which stores all the generic styles which are used on all pages, and then you have page-specific stylesheets which define styles used only on that page...

  2. #2
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, you can have multiple stylesheets linked/imported into a page.
    Be sure to remember that when declarations from later stylesheets contradict those from an earlier stylesheet, the later declaration will override them (e.g. …sheet2.css will override …sheet1.css).


    Whether you divide the site's css into several css files or simply put them all into a single css file is pretty much down to however feels more comfortable, productive and efficient to you.
    That said, multiple css files are usually only used by the larger sites which have major amounts of content to layout and several defined areas, each of which may contain a certain amount of individualised layout elements and styling.
    In such sites, visitors may not venture into entire sections of the site, so placing all of the css into a single file means preloading a potentially large chunk of css that may never be used during that visit.
    Whether this applies to your site comes down to how visitors are likely to use and move around your site.
    Most site authors are content to use a single css file, but as said, it's down to what feels most comfortable, productive and efficient to you.
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  3. #3
    SitePoint Guru toasti's Avatar
    Join Date
    Feb 2004
    Location
    Grahamstown
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good answer. thanks


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
  •