Jump to content

Portfolio Grid Item Selector & nth child???

Recommended Posts

You are probably having a specificity issue.

.tweak-portfolio-grid-overlay-image-aspect-ratio-34-three-four-vertical .portfolio-grid-overlay .grid-item:nth-child( 2 ) {

  padding-bottom : 150%;
  
  }

Are you trying to achieve a masonry effect?

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
3 hours ago, creedon said:

You are probably having a specificity issue.

.tweak-portfolio-grid-overlay-image-aspect-ratio-34-three-four-vertical .portfolio-grid-overlay .grid-item:nth-child( 2 ) {

  padding-bottom : 150%;
  
  }

Are you trying to achieve a masonry effect?

Thanks! Unfortunately, this only effects the overlay on hover. Not quite a masonry effect--I wanted to have several different heights within a row. 

Link to comment

Right the ruleset was meant to show how the selector would look not implement the actual effect.

With grid, currently, I know of no way to create a masonry effect. When you change one item in a row, the whole row changes height.

You might find Approaches for a CSS Masonry Layout of interest.

It might be possible to use JavaScript to restructure the HTML into a masonry effect but might have the downside of losing some of SS built-in features of the grid.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

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...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.