WordPress.org

Support

Support » How-To and Troubleshooting » How do I Add Line Spacing in Posts?

How do I Add Line Spacing in Posts?

  • Hi, I’m sure this has been covered somewhere, but I havent’ been able to find it yet, so here goes:

    Example post:

    The quick brown fox jumped over the lazy dog.

    Let’s say I’d like to have five lines of “white space” before the above text, and five lines of “white space” after it. I’ve tried inserting html code using the toolbar html button to do this, but when I save the post, WP seems to clear it out. How can I do this? What am I doing wrong?

    Thanks,

    G

Viewing 6 replies - 1 through 6 (of 6 total)
  • That’s how it works… 🙁
    WP strips the blank space it thinks it is not necessary.

    It has been asked several times and maybe even a solution was posted – I just can’t remember because I don’t really care about this. Sorry.

    gb77 – you have better control if you add padding by using the css than trying to add space using the html.

    In the index.php file for the theme you’re using, you should see something like

    <div class="post">

    (and that may vary by theme, you’ll have to do some detective work….)

    In the style.css file, you should be able to find something like

    .post {
    margin:0 auto;
    width:90%;
    }

    and the actual entries between the brackets will probably vary.

    Try adding to the .post element this line:

    padding:5% 0 5% 0;

    This sets padding on the top to 5% (first number), right to 0 (second number), bottom to 5% (third number), and left to 0 (last number). If it gives you something similar to what you’re looking for, you can tweak the percentage up or down as needed.

    Hey, thanks, vkaryl, I’ll give this a try. I was wondering if it had to be a CSS fix rather than a HTML.

    G

    Well, sometimes yes sometimes no – but for standards-compliance the answer is pretty much always yes.

    Post back how it goes….

    or you can do it the hard way.
    use &nbsp; which will give you a space.

    edit: err… i got it now. you want linebreaks? <br />?

    i would go for the css options given earlier.

    Yes, using vkaryl suggestion is so much easier. 😉 No sense making things difficult right? =P I’ve already done what vkaryl suggested myself actually.. 😉 Seems to work just fine.. Good luck with it though.. =)

    spencerp

    Now, I’m off to do another WP install.. be back then!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How do I Add Line Spacing in Posts?’ is closed to new replies.