Jump to content

Customize gallery caption fonts in portfolio 1st, 2nd, 3rd lines on mobiile

Go to solution Solved by tuanphan,

Recommended Posts


I've added the following CSS to customize the fonts used for the gallery captions in my client's portfolio section. The problem is that on mobile, the text wraps to the 2nd line and I can't figure out how to customize the text for the 2nd (or 3rd) line.

/* Customize font for gallery captions in portfolio */

.gallery-caption p:first-line {color: #864B92; font-size: 1rem; font-family: "Badhorse";}

Website: smoothybluesonlineinteriors.com

Thanks in advance!


I am a blogger who launched www.bikekitz.com in October 2018.

Link to comment
  • Replies 7
  • Views 1.1k
  • Created
  • Last Reply

Top Posters In This Topic

Instead of :first-line try :nth-line(1) then you can use :nth-line(2) and :nth-line(3)

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
Hire me on Upwork!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 

 Did I help? Buy me a coffee?

Link to comment
  • Solution

Try some CSS like this

@media screen and (max-width:767px) {
/* second line */
figcaption.gallery-caption.gallery-caption-grid-simple p {
    font-size: 1.2em !important;
/* First line */
figcaption.gallery-caption.gallery-caption-grid-simple p:first-line {
    font-size: 0.5em !important;


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.