Jump to content

7.1: line break for gallery grid captions

Recommended Posts

Site URL: https://wisteria-panda-z2eg.squarespace.com/sound-talent

pw for the site is: rotorsound

Dear All,

Is there any way, to apply line breaks in captions such as gallery grid captions? This has been talked about in the past, but I couldn't find solutions for 7.1. In the example website, I would like to apply line breaks wherever I currently have commas.

I would even go so far as to labeling them all by hand through code, as suggested by this code, that I found here in the forum:

/* image 1 */ 
.sqs-gallery-block-grid .slide:nth-child(1) .image-slide-title:after { 
content: "Dinosaur line 2"; display: block; font-size: 13px; font-family: monospace; margin-top: -5px; 
} 
/* Image 2 */ 
.sqs-gallery-block-grid .slide:nth-child(2) .image-slide-title:after { 
content: "Banana 02"; display: block; font-size: 13px; font-family: monospace; margin-top: -5px; 
}

However, this seems to have been written for 7.0. I cannot get it to work in 7.1.

Any pointers would be greatly appreciated!

Best, Tonmeister

Link to comment
  • 1 year later...
  • 1 month later...
On 6/14/2020 at 2:04 PM, tuanphan said:

Try use this in caption

 

Hello @tuanphan Sorry for the stupid question, but how do I use the '<br/>' within the following css snippet to create two lines in a tittle of a Gallery Section of a SS 7.1 site?:
 

/* image 1 */ 
.sqs-gallery-block-grid .slide:nth-child(1) .image-slide-title:after { 
content: "Dinosaur line 2"; display: block; font-size: 13px; font-family: monospace; margin-top: -5px; 

/* Image 2 */ 
.sqs-gallery-block-grid .slide:nth-child(2) .image-slide-title:after { 
content: "Banana 02"; display: block; font-size: 13px; font-family: monospace; margin-top: -5px; 
}

Many thanks for your time,

Link to comment
On 10/15/2021 at 4:13 AM, oeditorial said:

Hello @tuanphan Sorry for the stupid question, but how do I use the '<br/>' within the following css snippet to create two lines in a tittle of a Gallery Section of a SS 7.1 site?:
 

/* image 1 */ 
.sqs-gallery-block-grid .slide:nth-child(1) .image-slide-title:after { 
content: "Dinosaur line 2"; display: block; font-size: 13px; font-family: monospace; margin-top: -5px; 

/* Image 2 */ 
.sqs-gallery-block-grid .slide:nth-child(2) .image-slide-title:after { 
content: "Banana 02"; display: block; font-size: 13px; font-family: monospace; margin-top: -5px; 
}

Many thanks for your time,

use this

/* image 1 */ 
.sqs-gallery-block-grid .slide:nth-child(1) .image-slide-title:after { 
content: "Dinosaur \A line 2"; display: block; font-size: 13px; font-family: monospace; margin-top: -5px; 
} 
/* Image 2 */ 
.sqs-gallery-block-grid .slide:nth-child(2) .image-slide-title:after { 
content: "Banana \A 02"; display: block; font-size: 13px; font-family: monospace; margin-top: -5px; 
}

\A = <br/>

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

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 4 weeks later...
On 6/14/2020 at 4:04 PM, tuanphan said:

Try use this in caption

 

Hi! I'm trying to do the same thing as OP - I put this in the caption but it's not working for me. Is there something else I should be doing to make it work? I saw that OP wrote something about enabling HTML... didn't really understand that.

 

Thank you!

Link to comment
On 11/10/2021 at 4:17 PM, RT53 said:

Hi! I'm trying to do the same thing as OP - I put this in the caption but it's not working for me. Is there something else I should be doing to make it work? I saw that OP wrote something about enabling HTML... didn't really understand that.

 

Thank you!

Can you share link to page where you have problem? We can check easier

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

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 1 year later...
On 11/15/2022 at 2:28 PM, AndyKhouri said:

Is there a code to make line breaks in gallery grid titles?  Using the "<br/>" code in the title text doesn't seem to work.  Here's how I'm doing it (Screenshots). 

Screenshot 2022-11-14 at 11.27.27 PM.png

Screenshot 2022-11-14 at 11.27.40 PM.png

Gallery Title doesn't allow HTML tag. If you share link to your site, we can give a script code to make <br> tag work.

You can also add this code to Settings > Advanced > Code Injection > Footer first, if it doesn't work, share link then.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
  $(".image-slide-title").each(function(){
    $(this).html($(this).text());
  });
});
</script>

 

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

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
22 hours ago, tuanphan said:

Gallery Title doesn't allow HTML tag. If you share link to your site, we can give a script code to make <br> tag work.

You can also add this code to Settings > Advanced > Code Injection > Footer first, if it doesn't work, share link then.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
  $(".image-slide-title").each(function(){
    $(this).html($(this).text());
  });
});
</script>

 

Thanks so much! The code worked. One more question: is there a way to control the line height, letter spacing, etc. like with other text on the site? Doesn't seem to have an obvious control panel in the Font controls. 

Screenshot 2022-11-21 at 11.14.56 PM.png

Link to comment
On 11/22/2022 at 2:16 PM, AndyKhouri said:

Thanks so much! The code worked. One more question: is there a way to control the line height, letter spacing, etc. like with other text on the site? Doesn't seem to have an obvious control panel in the Font controls. 

Screenshot 2022-11-21 at 11.14.56 PM.png

You can use some code like this (Add to Page where you use Gallery)

<style>
  /* this is code to style 2 lines */
  .image-slide-title {
  	font-size: 30px;
    color: red;
    line-height: 30px;
  }
  /* this is code to style first line */
  .image-slide-title:first-line {
  	font-size: 20px;
    margin-bottom: 20px;
  }
</style>

In CSS code, there is no attribute to target line 2, 3...but only attribute to target first-line, so I use the above method.

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

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 2 months later...

Might be a little old topic, but would really like to know if there is a way to adjust the 2 lines seperately after writing this in a gallery caption:

Project 1<br/>music

Would like to be able to control lineheight, font size and make the typography centrered.

 

Hope someone can help me out with this. :-)

Link to comment
On 2/10/2023 at 4:39 PM, Mads_Botkr said:

Might be a little old topic, but would really like to know if there is a way to adjust the 2 lines seperately after writing this in a gallery caption:

Project 1<br/>music

Would like to be able to control lineheight, font size and make the typography centrered.

 

Hope someone can help me out with this. 🙂

You can use this

https://forum.squarespace.com/topic/164376-71-line-break-for-gallery-grid-captions/?do=findComment&comment=589029

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

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

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.