• I’m trying to have two lines aligned right where the top line is a bigger font size than the bottom, but WordPress keeps deleting my br tag and putting them on the same line. I tried them in a p tag or a div tag with style text-align: right (yes I know how to format the HTML attribute code).

    I have plugin “Better wpautop” active, which prevents WordPress from adding br tags (which were being added after every label tag), but I don’t know how to stop the editor from removing br tags (I click the Text tab to refresh).

    Am I formatting the HTML code wrong? Here it is:

    <div style="text-align: right">
        <span style="font-size: 20px">You are:</span><br />
        <span style="font-size: 12px">*check all that apply</span>
    </div>

    I tried it in a p tag originally, and without the style attribute, and no matter what I do when I click the Text tab it removes the br tag (and the encapsulating p tag if it doesn’t have a style attribute). This is driving me nuts.

    [Edit]: I also notice that it removes any br tags from within a label, even though I’ve read that you can do that if you make the label’s style display inline-block or block, which I did (it shows up valid in the preview element inspector, so it’s working, it’s just that WordPress doesn’t care).

  • The topic ‘Can't use br tag after span in p or div tag’ is closed to new replies.