• Resolved wideangledan

    (@wideangledan)


    Ok… I’m trying to figure this out.

    Let’s say I have two posts. A first post, and under that one, a second post. These posts are within a content box that has a perfect 20px padding all around it. How do I add space between the two posts without messing up the spacing around them?

    The only solution I could imagine would be to have a class that’s somehow on every post except the first one (of the current page), and give that class a top-margin. But how could I accomplish something like this?

    Any other ideas?

    Thanks.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    How do I add space between the two posts without messing up the spacing around them?

    How would adding padding/margin-bottom cause the space to mess up around them?

    Thread Starter wideangledan

    (@wideangledan)

    Well… if I give the class “blog-entry” a margin/padding bottom, it will add that space to the bottom of the box around them, which already has it’s own padding-bottom. There’ll be too much space on the bottom. Same thing if I did it on the top.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    If you can’t link to the issue, can you emulate it through CSSDesk and then share us a link to that?

    Thread Starter wideangledan

    (@wideangledan)

    Sorry, should have just linked.

    https://hotshoebrew.com/

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Are you familiar with CSS nth-child?

    Thread Starter wideangledan

    (@wideangledan)

    No! Did not know this existed… wow, very useful.

    It says there’s no IE support whatsoever… LOL

    Thanks.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    You can use jQuery’s logic to apply the equivalent of nth-child if you ever need to.

    Thread Starter wideangledan

    (@wideangledan)

    Ok… thanks. Learning jQuery is somewhere on my list. Right now (after 10 years) I’m still figuring out this css bizniz.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘A universal problem I have (of spacing)’ is closed to new replies.