Jump to content

LA-Design

Member
  • Posts

    6
  • Joined

  • Last visited

LA-Design's Achievements

  1. I took that CSS out just in case that's better. Thanks!
  2. Thanks, I removed that code from the 'code injection' area. Should I also removed this from the 'Custom CSS' area? .gallery-caption p {white-space:pre; text-align:center !important} .gallery-caption p:first-line {color: black; font-weight:bold !important} Thank you!
  3. Thanks, I tried it but it doesn't work for the lightbox captions.
  4. oops! Thanks. Here it is: password: gallerytest URL: https://rectangle-poodle-8dp4.squarespace.com/gallery-1
  5. I'm working on a client site. I found code to display captions in the lightbox instead of in the gallery grid. My client wants the caption to be styled more. Is there a way to style the caption text? I tried CSS and tried to add line breaks, but it isn't working for me. I want the title to be bolded and on the top line, then the other info below. I attached a screenshot of an image in the lightbox. My client's site is still set to private. I've tried various CSS I've found online but it isn't working for the lightbox caption. Thanks for any tips! I set up a SquareSpace trial site to test this. password: gallerytest URL: https://rectangle-poodle-8dp4.squarespace.com/gallery-1 Here's the code to get the gallery captions styled, it works until I have caption for lightbox only: .gallery-caption p {white-space:pre; text-align:center !important} .gallery-caption p:first-line {color: black; font-weight:bold !important} Then I found and added this to get the captions to show in lightbox only (client request): <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script> <script> jQuery(document).ready(function($){ $('.gallery-lightbox-list .gallery-lightbox-item').each(function(){ var text = $(this).find('img').attr("alt"); console.log(text); $(this).append('<div class="lightbox-caption">' + text + '</div>'); }) }) </script> <style> .lightbox-caption { color: gray; font-weight: bold; margin: 15px 0; text-align: center; display: none; position: absolute; bottom: -65px; z-index: 9999; } .lightbox-caption p { white-space:pre; font-weight: normal!important; text-align:center!important; } .gallery-lightbox-wrapper:hover { cursor: pointer; } .gallery-lightbox-item[data-in='false'] .lightbox-caption { display: none!important; } .gallery-lightbox-item[data-active='true']:hover .lightbox-caption{ display: inline-block; } .gallery-lightbox-wrapper:hover .gallery-lightbox-item[data-active='true'] .lightbox-caption{ display: inline-block; } .gallery-lightbox .lightbox-caption { display: block !important; } .gallery-caption p.gallery-caption-content { display: none !important; } </style> In the gallery, the caption has a soft return after the title
×
×
  • 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.