Jump to content

Make first image in Image Gallery Block go full width

Go to solution Solved by tuanphan,

Recommended Posts

Hi all,

I'm wondering if you could help me with some css that would force the first image in a gallery block to display the full width of the block?  Ideally, this would be for any gallery block that is placed in this "Portfolio" blog collection.

(I know I could simply put a regular image block on top of the gallery block to create this, but I want to keep all of the images in the gallery block so that you can page through them while in lightbox mode.)

Website: https://pumpkin-orange-3ld6.squarespace.com/portfolio/blog-post-title-one-2g2bd-5723b-4hfd4
Password: Real2023

Thank you!

Link to comment

Thanks so much @tuanphan.  This almost works perfectly!  I've attached a screenshot - it looks like it's not treating the second image as being on a new row, so the third image isn't flowing behind it.  Am wondering if there is a way for it to recognize that the second image is its own row and the third image should be flowing behind it?  Let me know what you think.

screencapture-pumpkin-orange-3ld6-squarespace-portfolio-blog-post-title-one-2g2bd-5723b-4hfd4-2023-07-22-15_52_02.jpg

Link to comment
  • Solution
On 7/23/2023 at 5:55 AM, whereisscott said:

Thanks so much @tuanphan.  This almost works perfectly!  I've attached a screenshot - it looks like it's not treating the second image as being on a new row, so the third image isn't flowing behind it.  Am wondering if there is a way for it to recognize that the second image is its own row and the third image should be flowing behind it?  Let me know what you think.

screencapture-pumpkin-orange-3ld6-squarespace-portfolio-blog-post-title-one-2g2bd-5723b-4hfd4-2023-07-22-15_52_02.jpg

You will use Grid 2 items/row on all pages or different? If all same, we can use 1 code, but if each page use a different number items/row, each page will need a different code.

Use this

<style>
  body[class*="type-blog"].view-item div.gallery-block .slide:first-child {
    width: 100% !important;
}
body[class*="type-blog"].view-item div.gallery-block .slide:nth-child(2n+1) {
    clear: none !important;
}
</style>

image.thumb.png.396217a70a7223e695a9b43ca7b6562b.png

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

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.