I have to combine two set of CSS styles, one from Microsoft Sharepoint 2007 CMS and one that is custom for company branding. I really dont want to edit the CSS files, especially the one in sharepoint 2007. However, i can over-ride any CSS rules if needed.

The CSS for company branding changes , and in ways that Microsoft Sharepoint 2007 doesn't expect and therefore it breaks the layout for existing controls.

What is the best way of preventing the company branding CSS from changing , and elements the way Microsoft Sharepoint 2007 defines them? I really dont want to simply override each CSS rule that is defined in company branding to preserve Microsoft Sharepoint 2007 CSS rules. Also, i must reference the company's branding CSS AFTER sharepoint server's 2007 CSS.

2 answers

1
point

You could use the css3 :not selector, but since you are using Sharepoint, it is highly unlikely to be of use (as it wont work in IE). If you are can use JavaScript, you can use jquery to use the same not selector.

Answered about 8 years ago by Divya Manian
Doug 1095
0
points

If I understand correctly, you're creating the CSS rules in Sharepoint, while someone else creates the company branding rules? You don't have control over the company branding rules, and since they are linked after the Sharepoint rules, they are overriding the styles you created. Is this right?

If so, simply increase the specificity of the CSS rules you write. A Google search for "CSS specificity" will yield much valuable information.

Answered about 8 years ago by Doug
  • You're close but not 100% correct. I'm not actually creating sharepoint CSS rules. Instead I'm trying to preserve the css rules that **already** exist in Sharepoint. The branding CSS is overriding the css that came with sharepoint which is what I want in general EXCEPT for a particular <table> element that has to do with authoring. This <table> element is never shown to public users. andrew about 8 years ago
  • Sorry, I've never used Sharepoint. Are you saying you can't change the Sharepoint CSS or the branding CSS? Doug about 8 years ago