Home › Forums › Other › How Do I Stop a CSS Style from Affecting Some Sites? › Reply To: How Do I Stop a CSS Style from Affecting Some Sites?
December 2, 2014 at 5:33 pm
#189808
Alen
Participant
I wouldn’t start changing anything in the global style sheet. Instead override the style by adding a hook (another CSS class) to HTML so that you can target that specific element. In WordPress for example the body
element usually has classes attached to it specific to what is being viewed… posts for example have ID’s if you need to target any individual post.
It would help if we can see sample code, instead of talking about it in abstract.
In short in would look like this:
/* Global Styles */
.my-global-element{ color:red; }
/* Custom Styles */
.about-page .my-global-element { color:green; }
.contact-page .my-global-element { color:blue; }