[Resolved] CSS alignment question for masonry

Home Forums Support [Resolved] CSS alignment question for masonry

Home Forums Support CSS alignment question for masonry

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #69838
    Davinder Sangha

    Using GeneratePress with some custom CSS, but struggling to align masonry blocks on various category pages.

    http://www.workwearexpress.com/downloads/Capture.JPG
    Example alignment issue

    Link shows the block which I need aligning. It’s the same on the other categories.

    #70421
    Tom
    Lead Developer
    Lead Developer

    This looks like it’s happening because the “Ugg” post is too long, causing it to push down the post below it.

    #71306
    Davinder Sangha

    Hi. That’s correct. How do I clip that text/element/block so that it lines up on every occasions, even with up-to-date articles.

    #71403
    Tom
    Lead Developer
    Lead Developer

    Hmm, I’m not sure it’s possible to set it so it always matches the height of the item to the left, especially with new articles. You can target that specific post with CSS and try to tweak some things (padding/font sizes etc..) but it won’t be perfect.

    I’ll keep thinking about a solution and will post back here if I think of one.

    #71543
    Davinder Sangha

    Cheers. Our stories will be updated all the time, so I want to try and avoid any individual story CSS work. I’ll keep having a look as well and will update if I find anything.

    PS. Blog URL is:

    http://www.workwearexpress.com/blog/

    #71686
    Tom
    Lead Developer
    Lead Developer

    You could use CSS to match the height right now, but it will change depending on the height of the post image and content as you update.

    For example, this code should work right now:

    @media screen and (min-width: 769px) {
          .masonry-container .type-post:nth-of-type(2) {
                max-height: 490px;
                overflow: hidden;
          }
    }

    However, when you add new posts, this CSS will most likely have to change.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.