function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
chris_centrachris_centra 

css conflict

hello -

are there general rules/guidelines for creating CSS (for use in visualforce pages) that won't conflict with the existing sfdc CSS?  a vendor provided a CSS for some pages and when i include it, it affects some of the standard sfdc page bits (tabs, etc).  (i should note that i have to keep the header and sidebar, so i can't turn off standard stylesheets.) 

is the basic rule to avoid overriding html tags -  by referencing everything from css using the class attribute?  any tricks beyond that?

thanks for your time.
chris
Ashish_SFDCAshish_SFDC
Hi Chris, 


You won't be able to ignore the Salesforce CSS as it will be loaded by the browser and thus used whenever there is a class that matches the name.

See more information on the link below, 

http://salesforce.stackexchange.com/questions/24575/how-to-ignore-salesforce-css-on-vf-page-with-header

Also see some sample code in the below docs, 

http://developer.force.com/cookbook/recipe/adding-css-to-visualforce-pages

http://wiki.developerforce.com/page/Delivering_Static_Resources_with_Visualforce


Regards,
Ashish
Edwin VijayEdwin Vijay
On the page level you can specify standardstylesheets="false" which can help you overcome the overriding to a certain level. Here are a few resources which might help

http://www.forcetree.com/2010/06/debugging-visualforce-pages-with-custom.html


http://www.slideshare.net/EdwinVijayR/visualforce-css-developer-guideby-forcetreecom