Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2010
    Thanked 0 Times in 0 Posts

    Clearing Previous CSS Stylesheet from a PORTION of a page (and then using new styles)

    I am trying to figure out how to nullify all of the previously set CSS styles in a portion of a page. Then, be able to set new styles to affect just that portion.

    The situation is this:
    Using a Wordpress theme, I have a single article that I want to be formatted completely differently than normal. However, there are css styles for things like <body>, <td>, <blockquote> etc (lots of them) that I already set in the theme itself. I don't want these theme-defined styles to affect the article portion, for this article only, and only for the article portion of the page.

    Is this possible, other than by re-declaring all the css values that are set in the theme?

  • #2
    met is offline
    Regular Coder
    Join Date
    Oct 2009
    United Kingdom
    Thanked 119 Times in 119 Posts
    wrap the article in a <div id="someArticle"></div>

    #someArticle p { color:red; }
    #someArticle h1 { color:green; }

    restyle as needed, the changes will only apply to content contained within that DIV. presumabyl you can customise the output of articles in WP, i'm not that savvy with it.


    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts