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

Align to top in masonry grid



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

Create an account or sign in to comment

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

  • Create New...