Dismiss Notice
Welcome to Our Community
Wanting to join the rest of our members? Feel free to sign up today.

Multiple CSS Style Sheets?

Discussion in 'Programming' started by susapra, Nov 19, 2008.

  1. susapra

    susapra New Member Webmaster

    I'm currently in the process of designing my first full fledged site. The one thing I'm struggling with is while I want the overall look and feel of the site to be the same, some of the inter-page layout needs to be different to accomdate the variety of content between pages.

    Is it acceptable to use two style sheets linked to one html page?

    Also, would changes made in the second linked sheet over rule the 1st page?
  2. smeagain

    smeagain Distinguished Member Webmaster

    It is common practice to use more than one external CSS File. For example one file for layout and positional control with the other one for text styling etc.

    CSS stands for "Cascading Style Sheets"
    The cascading bit is the equivalent of obeying the last order. With multiple external CSS files, if the same styling factor appears in more than one linked css file, the one from the linked file that appears last in the running order will be used.

    Document level CSS can be inserted within the head of the document itself to override the external styles, but must be inserted into the head of the document after the appearance of the linking to all the external CSS Files.

    The same cascading effect can be used to override a CSS File by placing a style specific to one HTML element usage in-line.
  3. Bagi Zoltán

    Bagi Zoltán Boss Cart consultant Webmaster

    I think if the difference between the inner pages are only little, I would rather use inline style in order to avoid the loading increasement due to the plus http request.
  4. johnafrankllin

    johnafrankllin New Member Webmaster

    If it is in minor proportion than it is better to define style on the page otherwise external css the the best option.
    Using two css files is not problematic only you have to take care of the class names should be different.

  5. myst729

    myst729 New Member Webmaster

    Yes, it is. It's a good way to manage your code - different CSS file, different usage.
  6. anurdh65

    anurdh65 New Member Webmaster

    Multiple Styles Will Cascade Into One

    Style sheets allow style information to be specified in many ways. Styles can be specified inside a single HTML element, inside the <head> element of an HTML page, or in an external CSS file. Even multiple external style sheets can be referenced inside a single HTML document.
    Cascading Order

    What style will be used when there is more than one style specified for an HTML element?

    Generally speaking we can say that all the styles will "cascade" into a new "virtual" style sheet by the following rules, where number four has the highest priority:

    1. Browser default
    2. External style sheet
    3. Internal style sheet (inside the <head> tag)
    4. Inline style (inside an HTML element)
    So, an inline style (inside an HTML element) has the highest priority, which means that it will override a style declared inside the <head> tag, in an external style sheet, or in a browser (a default value).
  7. norbertwarne

    norbertwarne New Member Webmaster

    It is common exercise to use more than one outside CSS File. For example one register for present and positional assure with the early one for text styling etc.
  8. damienb

    damienb New Member Webmaster

    The external CSS file is the best option for me. And I don't think it will be a problem to use two or more CSS files for one page.
    Last edited by a moderator: Nov 18, 2010
  9. moritz

    moritz New Member Webmaster

    Rattling simply, can we acquire quadruplex CSS stylesheets on the selfsame page. We requisite to use various stylesheets for a position we're processing and I counterfeit if we had them all in the stabilise directory, we can use them?
  10. misamisa

    misamisa New Member Webmaster

    If separating css style will be you comfort zone,then so be it. besides,lot of developer uses multiple css styles to avoid confusion of codes.

Featured Resources (View All)

Share This Page