• When you write HTML for a website, most people would indent (or tab it) to make it more readable.

    But with WordPress, it doesn’t “support” it. In a post, the first line of the post’s body would be indented, but the rest would start at the beginning.

    Example, my site

    Are there any workarounds (plugins, hacks, or just tips) for how to make WP retain tabbing?

Viewing 10 replies - 1 through 10 (of 10 total)
  • If you applied this
    text-indent: 1cm
    to your p class in your style sheet you would get the first line of every paragraph indented 1cm. That would be every paragraph everywhere on your site so you might want to make it more contextual something like .article-content p{styling}

    Thread Starter matthewrobertson

    (@matthewrobertson)

    No — not the indenting, the “tabs” in the HTML CODE

    When WP outputs code, it starts from the beginning of a line. The rest of the HTML is tabbed forward, so it looks akward.

    Ah. You want to display code or formatted text? Put what you want to show in between < pre></pre> tags and any spacing will be preserved. It will also display in a fixed width font though.

    Okay, I’m totally confused. Which do you want to do?

    1. Display “code” within the WordPress forum?

    2. Change the formatting of the code within a WordPress file, like the index.php?

    3. Change the formatting of code you put within a post in WordPress, like in an article dealing with code that includes code examples?

    Just so we understand exactly what you are talking about.

    I think I see what he’s suggesting – he’s trying to make the first line indent or tab as he calls it, so that it begins like a newspaper article. Then everything else is justified below it.

    So for example he wants to display his post like this, forgive the repetition:

    < this is the indent >This is text that is written with the indent to the left, the rest of the text on this and proceeding lines will not be indented like the first line.

    I think this is what he’s trying to explain, and trying to achieve. Correct me if I’m wrong. The simplest answer is often the correct one.

    Thread Starter matthewrobertson

    (@matthewrobertson)

    You’ve just made me see how poorly worded I was. Let me start fresh.

    Scenario One: John Smith.

    John Smith has a website with WP on it. He uses WP for his blog.

    John Smith made his own theme.

    John Smith writes his own HTML code.

    When you write HTML code, you usually space it so its clearer.

    Example,
    <div class="navigation">
    --space--<li>Home</li>
    --space--<li>Photos</li>
    </div>

    and
    <table class="mytable">
    --space--<tr>
    --space----space--<td>Cell here.</td>
    --space--</tr>
    </table>

    When you write HTML, you space it. Clear? This has nothing to do with CSS. This is the actual source code of the HTML.

    John Smith integrates this with WP.

    WP makes automatically inserts links for him.

    But WP doesn’t look at spacing.

    Example,
    <div class="body">
    --space--<div class="maincol">
    --space----space--<div class="nav">
    --space----space----space--<li>Home Page</li>
    <li>Wordpress Inserts this at BEGINNING OF LINE.</li>
    <li>It should space it three times.</li>
    --space----space--</div>
    --space--</div>
    </div>

    Is there a way to solve this?

    Please reply if you need more info.

    I only know of using something like HTML Tidy or similar to make my HTML look pretty.
    http://www.w3.org/People/Raggett/tidy/

    This is my workaround to put in tabbing.
    <font color=”#ffffff”>XXX</font>
    I do not use <p> because it leaves to big a gap. So I use <br /> instead. That is because I do not know how you change the spacing created by <p> in .css. which shows how low I am on the beginner scale. Neverthless, what I do is proper indent. However, as a piece of code it is very ugly.
    If code is poetry that is bush doggerel. Is there a more elegant solution?
    Gareth Powell in Sydney

    I am having the same exact problem as he pointed out in the long description.

    Is there a solution. I consider this a bug, I would appreciate if someone could report it to the tracker.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Site’s HTML Spacing lost with WP’ is closed to new replies.