Fastest way to alter background sitewide for un-properly cascaded CSS files

sjenoch's Avatar

sjenoch

18 Sep, 2012 02:23 PM

My predecessor for our website did not correct cascade our global css file and our sub site specific css files. There are repeated styles throughout, which makes changing a style (i.e changing the background from gray to white across all pages) very difficult. I attached a screen shot of the http://www.smcm.edu/students page and how it shows the use of 3 different css files, highlighting the 'container' div, and showing multiple background colors for that region. My ultimate goal is to change the gray background to white for every page within the smcm site. Can you provide the most efficient/quickest way to solve our issue? Thanks

  1. 1 Posted by Ryan Griffith on 19 Sep, 2012 05:43 PM

    Ryan Griffith's Avatar

    Hi,

    I hope you don't mind, but I made this discussion public in-case someone else has additional input.

    It seems as though you would want to adjust the background color for the most widely-used CSS file and then work your way down; in this case I'm assuming it would be global.css. By starting with the most used, this will hopefully allow you to adjust the color for most pages, then as you work your way through the other CSS file(s), that would take care of the rest.

    If this doesn't work, you could try adding the important rule to that particular style in global.css, something like background-color: #ccc !important;. This essentially forces the background color to be applied. One drawback with this route would be that you may have difficulty changing that background color to anything else from another CSS file that is loaded later, unless of course you add the important rule to that style as well.

    Please let me know if you have any questions.

    Thanks!

  2. 2 Posted by sjenoch on 24 Sep, 2012 04:55 PM

    sjenoch's Avatar

    Thanks for the suggestion!

  3. 3 Posted by Ryan Griffith on 24 Sep, 2012 06:00 PM

    Ryan Griffith's Avatar

    Not a problem, I hope that helps out. Let's us know fi you have any other questions.

    Have a great day!

  4. Ryan Griffith closed this discussion on 24 Sep, 2012 06:00 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac