WordPress.org

Ready to get started?Download WordPress

Forums

How do I Add Line Spacing in Posts? (7 posts)

  1. gb77
    Member
    Posted 7 years ago #

    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

  2. moshu
    Member
    Posted 7 years ago #

    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.

  3. vkaryl
    Member
    Posted 7 years ago #

    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.

  4. gb77
    Member
    Posted 7 years ago #

    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

  5. vkaryl
    Member
    Posted 7 years ago #

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

    Post back how it goes....

  6. krugern
    Member
    Posted 7 years ago #

    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.

  7. spencerp
    Member
    Posted 7 years ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags