WordPress.org

Ready to get started?Download WordPress

Forums

WordPress adds p and /p tags inside my blockquote making CSS not work (6 posts)

  1. mr_director
    Member
    Posted 5 years ago #

    WordPress is automatically adding paragraph tags inside my blockquote tags, so my font size on blockquote CSS isn't working.

    Either that or something else is preventing my blockquote text to display properly.

    Any ideas?

  2. mr_director
    Member
    Posted 5 years ago #

    Here's the code that I enter:

    <blockquote>Jesse: So, there’s this griddle thing! IT’S AWESOME. It makes pancakes too. It doesn’t cost as much as a car.
    
    Friend #2: Sounds dumb.
    
    Jesse: You’re dumb. This friendship’s over.</blockquote>

    Here's what WordPress does to it:

    <blockquote><p>Jesse: So, there’s this griddle thing! IT’S AWESOME. It makes pancakes too. It doesn’t cost as much as a car.</p>
    <p>Friend #2: Sounds dumb.</p>
    
    <p>Jesse: You’re dumb. This friendship’s over.</p></blockquote>

    By doing this, it renders the font size and style of my CSS blockquote useless. Anyone have an idea?

  3. Saurus
    Member
    Posted 5 years ago #

    Are you entering this in the visual or code editor?

    If you are entering your own codes - you should be using the code editor ONLY.

  4. Technokinetics
    Member
    Posted 5 years ago #

    Adding the <p> tags is correct markup.

    Try changing your blockquote { font-size: 1em; } CSS to blockquote p { font-size: 1em; }.

    - Tim

  5. soylent
    Member
    Posted 5 years ago #

    Correct or incorrect, WordPress shouldn't be adding html to the code if it's not told to. There are many, many instances where the addition of a p tag is not desirable. My example this:

    Code Entered using code view:
    <h4>Cookies</h4>Cookies are yummy

    What WordPress does to it:

    <h4>Cookies</h4>
    Cookies are yummy

    I have the bottom-margin of my h4 set to .5em in my css, but the p tag negates that. I could set the top-margin of the p tag to .5em, but that could cause other problems and is an undesirable extra step.

    The p tags are added when the post is output to the browser, so the only way to remove them is to edit the WordPress source code, which I really don't think I should have to do. I love WordPress but it should leave my code alone.

  6. soylent
    Member
    Posted 5 years ago #

    There's a plugin to disable this called Disable WPAutoP.

    http://www.urbangiraffe.com/plugins/disable-wpautop

Topic Closed

This topic has been closed to new replies.

About this Topic