• Resolved martvefun

    (@martvefun)


    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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Don’t leave any blank lines. Or you could place your markup inside <div?</div> tags.

    Thread Starter martvefun

    (@martvefun)

    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

    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 😀

    Thread Starter martvefun

    (@martvefun)

    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

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘stop adding `<p>` tags’ is closed to new replies.