WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] stop adding `<p>` tags (5 posts)

  1. martvefun
    Member
    Posted 3 years ago #

    Hello,

    When I'm writing post, for a strange reason, wordpress put some unwanted <p> </p> tags around text blocs.
    I'm ok with the fact it add <br /> tag before each new line but not with this tag. When I want to write some source code, it mess it up.

    How can I stop this annoying behaviour ?

    Thanks

  2. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    Don't leave any blank lines. Or you could place your markup inside <div?</div> tags.

  3. martvefun
    Member
    Posted 3 years ago #

    Thank you for your answer.

    I've done a css class "terminal" to simulate a terminal for the output of commands (black background,...)

    I copy-passed the output of a command where there is white space and even between the div tags, I've the <p> </p> tags generated

  4. jimmyt1988
    Member
    Posted 3 years ago #

    May have got wrong end of the stick here but:

    that is a css style problem.

    Here is the solution buddy:

    p{
     margin-top:0px;
     margin-left:5px;
     margin-bottom:0px;
     margin-right:5px;
     padding-top:12px;
     padding-left:0px;
     padding-bottom:12px;
     padding-right:0px;
    }

    It is some problem where margin pushes the div top away. Infact you need to do it with padding instead.

    I also use the individual padding-left etc rather than padding:12px 0px 12px 0px; because otherwise sometimes default browser styles set an individual padding-left or right and your padding:0px 0px 0px 0px doesnt over write it.

    Please ask if that doesnt make sense. Im a little tired :D

  5. martvefun
    Member
    Posted 3 years ago #

    I found another solution : put <pre> </pre> tags inside my <div class="terminal"> </div> tags

    I still have problems that what looks like tag isn't displayed (<me@email.com> for example) but it's another problem

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags