2 replies [Last post]
clivetwo
clivetwo's picture
Offline
newbie
Last seen: 6 years 36 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
Tony's picture
Offline
Moderator
Brisbane
Last seen: 4 days 1 hour ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5343
Points: 2964

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
jackR's picture
Offline
Regular
Denver
Last seen: 6 years 8 weeks ago
Denver
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