Jump to content

How to make images match up?

Go to solution Solved by katycarlisle,

Recommended Posts

Hi there!

Can anyone share how I can fix the image having blank space even when I don't have anything for the title or subtitle? You can see that the upper right image doesn't have space like the lower left image does. I want the lower left image to look like the upper right image. I don't understand why it's working on one image but not the others...

The page is sandracurry.com/clinic

Thanks so much for your help!

Sandra

Screen Shot 2024-08-22 at 12.13.25 PM.png

Link to comment

By default when you use the card layout (even when there's no title and subtitle) it will still leave space for the card and text to the left or right of the image. On most of the images on that page, that's what is happening. 

However, there comes a point when if the width of the block is too narrow to show the image and card next to each other, it will push the card underneath the image so it's stacked instead. 

On the first image you've got the text block extended past the centre of the page, so that's forcing the card onto a new line. Of course, you can't see this is happening because there's no text content!

But if you increase the width of the text blocks for the other images, you will see the image take up the full width of the remaining space. You could also add a spacer to get the same effect.

Alternatively, you can increase the image width for card layouts to 100% in Design > Site Styles (it looks like it only goes up to 75% but you can type in 100% and override the limit).

By the way, the Clinic page name and URL has a typo in and is actually "Cinic" and /cinic. I was able to find the right page it using the site search but you probably want to update it. 

Oh hey! I'm Katy Carlisle, a web designer and trainer who goes by the name SQSP Queen. My pronouns are she/her and I'm based on Vancouver Island in BC 🍁 I've been using Squarespace since 2013, and work mainly with non-profits or freelancers on projects that do good. I love answering questions about Squarespace and don't expect anything in return, but if you do want to say thanks, feel free to buy me a coffee 

Link to comment
19 minutes ago, SandraC said:

is there css that can change the image width to take up the whole space?

There is, but setting the image to 100% width in Site Styles should have the same effect. The CSS would just be overriding that same number in the code! 

I'll share for reference in case you want to be more specific and just target certain images, but I would recommend going with Site Styles over CSS where you can.

This is the code for 100% width but you might want to reduce the number down slightly because of the offset border effect that you're using.

/* Increase width of image on card layout */

.sqs-block-image .design-layout-card:not(.sqs-narrow-width)>:first-child {
    width: 100%;
}

Oh hey! I'm Katy Carlisle, a web designer and trainer who goes by the name SQSP Queen. My pronouns are she/her and I'm based on Vancouver Island in BC 🍁 I've been using Squarespace since 2013, and work mainly with non-profits or freelancers on projects that do good. I love answering questions about Squarespace and don't expect anything in return, but if you do want to say thanks, feel free to buy me a coffee 

Link to comment
  • Solution

So do you want some of the card images to still have the space to the left or the right? I'm just trying to understand the scenario when you don't want the image to take up the full width of the block.

If you could share links to some example pages, and which images on those pages you do/don't want to target with the CSS, that would be really helpful.

If you wanted some CSS to apply to all images on a particular page then you can use the page ID.  For example, this would only affect the card layout images on the Clinic page:

/* Increase the width of all card images on the Clinic page */

#collection-66baba6ea01101188b98c0e6 .sqs-block-image .design-layout-card:not(.sqs-narrow-width)>:first-child {
    width: 100%;
}
 

If you wanted to just target one image then you could use this code, replacing the relevant block ID as needed: 

/* Increase the width of a specific image */

#block-yui_3_17_2_1_1724347785082_69523 .design-layout-card:not(.sqs-narrow-width)>:first-child {
    width: 100%;
}

If you use Chrome, this is a great tool for identifying block and page IDs to target specific image blocks or pages. 

A note of caution though! If you have code for a specific block and then you delete the block, even if you add another block in the same place then the code won't work. It's unique to the block. Do also make sure to use comments (in between /* and */ ) to keep track of which ID you are targeting!

Oh hey! I'm Katy Carlisle, a web designer and trainer who goes by the name SQSP Queen. My pronouns are she/her and I'm based on Vancouver Island in BC 🍁 I've been using Squarespace since 2013, and work mainly with non-profits or freelancers on projects that do good. I love answering questions about Squarespace and don't expect anything in return, but if you do want to say thanks, feel free to buy me a coffee 

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.