If I have a HTML page that links to two stylesheets that are invoked like this:
<link rel="stylesheet" href="original.css" media="screen, projection" />
<link rel="stylesheet" href="override.css" media="screen, projection" />
If these two files define the exact same style names, is it true that original.css will have no bearing on the outcome of the styled page and that all styles will come from the styles defined in override.css?
The reason I ask is this: I have an original.css that I cannot modify and I do not want to touch the lines of code that invoke this file. Instead I would like to insert a call to my new file right after the original is called and override everything defined in the original. I'm not sure if this will work, whether it's advisable, etc.
Yep, it sure can. That's the Cascading bit of Cascading Style Sheets.
I gotta ask though, why can't you just delete original.css, or not output it, or.... something? It seems like a very Big Hammer approach to completely override everything in original :-) If you do indeed output original.css and override.css, the browser is going to have to do a whole lot more work than if you were to just output override.css.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With