Jump to content

Changing image width for image block: card on one page

Recommended Posts

I'm wanting to change the image width of these "card" image blocks on just one page while leaving the other settings and other pages intact, as I use the block on other pages and like the setting there. The image is too large on our staff page, though. I can't seem to find the correct class to adjust the image width without affecting the "stack" image blocks on the same page.

 

Default setting in Design > Styles, which I want on all other pages

Width50.png

 

What I want on this page only:

Width25.png

Link to comment
  • Replies 15
  • Views 2.2k
  • Created
  • Last Reply

Add the following to Design > Custom CSS.

#collection-5f11cfd34cf3723b9f368981 .sqs-block-image .design-layout-card:not(.sqs-narrow-width) {

  -ms-justify-content: unset;
  justify-content: unset;
  
  }

#collection-5f11cfd34cf3723b9f368981 .sqs-block-image .design-layout-card:not(.sqs-narrow-width)>div:first-child {

  min-width: 150px;
  width: 20%;
  
  }

#collection-5f11cfd34cf3723b9f368981 .sqs-block-image .design-layout-card:not(.sqs-narrow-width).image-position-left .image-card-wrapper {

  margin-left: 5%;
  
  }

Let us know how it goes.

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
  • 4 months later...

@SproutDesignStudio

Please post the URL for the page on your site where you want to achieve this effect.

If your site is not public please set up a site-wide password, if you've not already done so.

Post the password here.

Adding a site-wide password is not a security breach. Please read the documentation at the link provided to understand how it works.

We can then take a look at your issue.

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

@SproutDesignStudio

Yes change the collection id to...

collection-5ff75ce123b8f237e195b9d3

You may want to give this alternate code a try. It was developed later than the code above.

Add the following to Design > Custom CSS.

/*

  begin change image card, image to text width ratios
  
  Version       : 0.2d0
  
  SS Version    : 7.1
  
  Dependancies  : LESS
  
  By            : Thomas Creedon < http://www.tomsWeb.consulting/ >
  
  */
  
  @image-width : 35%; /* how much the image takes up of the total width (100%)
                         available */
  
  /*
  
    the following targets all image cards, if you want to target specific ones
    then put // ( forward slash twice and space ) before the next line. that
    disables the site-wide effect. then use the multi-selector section to target
    specific image cards
    
    */
    
  #imageTextRatio();
  
  /*
  
    multi-selector section
    
    here is where you can build up selectors to target specific image cards.
    when targeting multiple items each line should end with a comma except for
    the last line. following are some examples
    
    targeting a single item
    
      a page
      
        #collection-5ff75ce123b8f237e195b9d3
        
      a page section
      
        #page-section-6019f74588988b10419eb99c
        
      an image block
      
        #block-yui_3_17_2_1_1621396382553_4638
        
    targeting multiple items
    
      image blocks
      
        block-yui_3_17_2_1_1621396382553_4638,
        block-yui_3_17_2_1_1621970255707_4758
        
    */
    
  /* remove this line to use multi-selectors
  
  [enter CSS selector(s) here to target your image card(s)]
  
    {
    
      #imageTextRatio();
      
      }
      
    remove this line to use multi-selectors */
    
  // do not change anything below, there be the borg here
  
  #imageTextRatio() {
  
    .sqs-block-image {
    
      .design-layout-card:not( .sqs-narrow-width ) {
      
        align-items : center;
        
        > div:first-child {
        
          width : @image-width - 2.5%;
          
          }
          
        .image-card-wrapper {
        
          width : 100% - @image-width - 2.5%;
          
          }
        }
      }
    }
    
  // end change image card, image to text width ratios

Let us know how it goes.

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
  • 4 weeks later...

@jennypetit

Ah. I think I see where you are going. Try the following to replace the code I previously suggested commenting out.

#block-yui_3_17_2_1_1615808058082_3767 {

  margin-left : auto;
  margin-right : auto;
  width : 40%;
  
  }

Let us know how it goes.

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

Archived

This topic is now archived and is closed to further replies.


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