Mutiple external CSS files

Discussion in 'CSS' started by praetorian guardian, Oct 25, 2007.

  1. #1
    Can anyone tell me if I list multiple external CSS files which one will take priority the first one or the last?

    and can you confirm the priority goes in this order, Inline>Internal>External.
    Inline having the highest priority?
     
    praetorian guardian, Oct 25, 2007 IP
  2. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #2
    External files works like depth sorting or properties within the files itself - first to last, last taking precedence.

    As to inline/internal/external - given that your production code shouldn't EVER use inline if you care about separation of presentation from content - and likewise shouldn't use internal since that doesn't make use of the reason to USE CSS in the first place - caching, I really wouldn't worry about it.
     
    deathshadow, Oct 25, 2007 IP
  3. praetorian guardian

    praetorian guardian Guest

    Messages:
    270
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #3
    er yes thanks.. long story.. but i don't have options to pick and choose here.

    Im have multiple external .CSS files.. which one will take priority>?

    I also have internal .CSS styles that seem to being overwritten by the external styles.. i thought it should be the other way around.. any ideas
     
    praetorian guardian, Oct 26, 2007 IP
  4. hamzah

    hamzah Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    "and can you confirm the priority goes in this order, Inline>Internal>External.
    Inline having the highest priority?"
    this SHOULD be the case !
     
    hamzah, Oct 26, 2007 IP
  5. praetorian guardian

    praetorian guardian Guest

    Messages:
    270
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #5
    the external Css files are redirects.

    eg: they redirect directly to another external css file, I have a feeling this means it overrides all the other styles.. but im not sure.
     
    praetorian guardian, Oct 26, 2007 IP
  6. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #6
    Whichever one is listed last in your HTML. (as I said above - first to last, last takes precedence)

    is the keyword !important used in the external? Are you sure the specificity of the CSS used would override? Remember ID's take precedence over classes which take precedence over just the tag straight.
     
    deathshadow, Oct 26, 2007 IP
  7. praetorian guardian

    praetorian guardian Guest

    Messages:
    270
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #7
    yes the styles in the external sheet say !important

    if i put !important in the internal styles will that counter act the override?
     
    praetorian guardian, Oct 26, 2007 IP
  8. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #8
    Maybe - but you are better off removing !important from the properties you want overridden...

    Though a PROPERLY designed website should never need to use !important in the first place.
     
    deathshadow, Oct 26, 2007 IP
  9. praetorian guardian

    praetorian guardian Guest

    Messages:
    270
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #9
    couldn't agree more.. but i didn't design it.. nor do i have access to edit the external style sheet (long story)
     
    praetorian guardian, Oct 27, 2007 IP