2 replies [Last post]
clivetwo's picture
Last seen: 8 years 5 weeks ago
Joined: 2015-01-03
Posts: 1
Points: 2

Hi Guys new to css hope someone can help.

I have word press with the megahost theme and everything works fine.
The problem that I am having is that when I paste html into a page a particular css stylesheet from the theme is messing it up. I renamed the css to test and my html works fine but messes up the whole theme. Is there a way that I can tell my html code not to load or read or look at this style sheet?

Thank you

Tony's picture
Last seen: 1 week 1 day ago
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5344
Points: 2965

Hi clivetwo, You will want to

Hi clivetwo,
You will want to read up on CSS specificity.
You cold probably give pages you do want the styles a class in the body tag and prefix the selectors with the class.

jackR's picture
Last seen: 7 years 28 weeks ago
Timezone: GMT-6
Joined: 2009-04-13
Posts: 44
Points: 46

don't mess with the style.css

Yeah, renaming style.css to something else will pretty much break you layout as WP utilizes that style sheet as your global style sheet. I would simply add your HTML and give the parent element a unique ID. You can then style to each of the child elements using the parent ID in the path so that you override the other global styling. That should allow you to keep all you CSS where it belongs in the style.css.

For example:

#parentID ul li {
..whatever styling you want

Hope that helps