Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Align to top in masonry grid


Question

Hello,

I posted a question on this forum ten days ago regarding resizing portrait-oriented images to match the height of two landscape-oriented ones in the masonry grid. (I deleted the old post because it seems that it made me unable to create a new one into the same category.)

I found out the right CSS to do that:

.gallery-masonry-item img {
  max-height: 547px !important;
  object-fit: contain !important;
}

Now I have a new problem: while the image's height is correct and align with the two on its side, I still get a gap space under it so I continue to have the problem in the following rows. I think it depends on the wrapper or on the spacing between the rows in the grid but I cannot figure out how to write the solution in CSS.

I attached a screenshot to show the situation.

Could you help me finish the code to solve this?

Thank you.708714853_ScreenShot2021-06-25at3_03_32PM.thumb.png.4ba1dfc1a085a3f0ab6910e5cffbf1d8.png

Edited by FedericoImperiale
Mistake in the tags
Link to comment
  • Answers 3
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

Posted Images

3 answers to this question

Recommended Posts

  • 0

Hi. Can you share link to page in screenshot? I Don't see them on homepage

Email me if you have need any help (free, of course.). Answer within 24 hours.

How to: Setup password & share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care - Learn CSS - Custom Popup - Testimonial Slider

I'm Tuan, blogger/owner of a free library for children in Vietnam. Helping the community is a hobby. Contact me via email.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...