WordPress.org

Forums

spacing (5 posts)

  1. alexhelpme
    Member
    Posted 1 year ago #

    I'm having this problem with the spacing between paragraphs in a page. When I format the page using the "text" tab then look at it in the visual the spacing/code is changed. The same happens when I write something out in the "visual" tab and switch to the "text" tab. Regardless of the tab I choose to edit in the spacing is ruined if I decide to view it in another tab.

    No matter what I add to keep the spacing in place, for example </br> tags they're just deleted when I switch to the visual tab.

    I'm using the origami theme.

    Please help :)

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    Don't try to add HTML markup using the Visual editor. That's what the HTML tab is for. Don't switch editing tabs either. That's the fastest way to remove some (or all) of your markup. Pick a tab and stick to it.

  3. Just a quick explanation of the why...but follow @esmi's advice or switch to a different editor. (I know many who use the CKEditor plugin).

    WordPress uses the TinyMCE (the WYSIWYG) editor by default, and it will validate elements when switching from Text to Visual tab, and any invalid elements will be deleted.

    </br> is not a valid HTML tag. If you switch that to <br /> you'll see that it won't disappear after switching tabs.

  4. esmi
    Forum Moderator
    Posted 1 year ago #

    Actually, the TinyMCE implementation in WordPress will strip out most HTML markup - valid or otherwise.

  5. Generally HTML with valid syntax will be fine, but it does have to do with TinyMCE configuration, and I have no idea what the default configuration syntax rules are.

    Something simple like this works just fine:

    <div id="test">
    <ul>
    <li><strong>dog</strong></li>
    <li><a href="http://www.example.com/">example.com</li>
    </ul>
    </div>

    But '</br> will be deleted since it's not a valid HTML tag.

    That all said, like you, I still find it best not to switch tabs.

Topic Closed

This topic has been closed to new replies.

About this Topic