Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Feb 2010
    Posts
    224
    Thanks
    25
    Thanked 0 Times in 0 Posts

    Changing paragraph height without altering line-height

    Killing Sheep (possibly) nsfw - it's a blog about classic British horror films.

    On my blog, my .post-body line-height is set at 1.7em, but I would like slightly smaller paragraph spacing without altering this line-height (.post-body controls the styling of the text in my blog posts).

    When making a post, I can use either <br/> or <p> between paragraphs, but a single <br/> is no different to the spacing between the lines in the rest of the text. If I use <p> or two <br/> then the space is slighter bigger than I would like.

    I've tried adding

    Code:
    p {margin-top: 1em; margin-bottom 1em;}
    But it makes no difference.

    Is it possible to control the paragraph height, separate to the body text line-height?

    Thanks in advance.
    Last edited by OurJud; 04-07-2014 at 04:50 PM.

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,666
    Thanks
    6
    Thanked 1,006 Times in 979 Posts
    You need to be more specific in your CSS. Using firebug and inspecting one of your paragraphs I see the margins applied are by the rule #entry_content p {margin: 0.7em 0 2em;} so with only specifying p {…} it will not overrule the previous one because that’s more specific. You need to either edit that previous rule or add another with at least the same specificity after the initial one.

  • #3
    Regular Coder
    Join Date
    Feb 2010
    Posts
    224
    Thanks
    25
    Thanked 0 Times in 0 Posts
    Thanks, Stephan. I tried using firebug yesterday, to see what was controlling the paragraphs, but couldn't select the text on its own with the element picker. It kept locking on to the whole post element.

    Anyway, I just adjusted that 2em to 1em in the line you highlighted and it's done the trick.

    Thanks again


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •