Jump to content

Align text on Image Poster Block and background color on textblock

Recommended Posts

  • Replies 3
  • Views 538
  • Created
  • Last Reply
Posted

sure, add the following to your css code. this will do it for all image cards though, so if you want it to only happen on one page, add in the squarespace block it, or just put it inside a code block on that page (wrapped in style tags).

figcaption.image-card-wrapper {
  justify-content:flex-start !important;
  align-items:flex-start !important;
}

figcaption .image-card {
  margin:10px;
}

figcaption.image-card-wrapper  .image-title {
  text-align:left !important;
}

figcaption.image-card-wrapper .image-title p, 
figcaption.image-card-wrapper .image-subtitle p {
  background-color: rgba(0,0,0,0.3) !important;
  padding:3px 8px;
}

figcaption.image-card-wrapper .image-subtitle {
  margin-top:0 !important;
  text-align:left !important;
}

here's the layout sqs uses in the code, so that should show you which classes are doing which bit

image.png.59c5f79763400b344f3b3aaa93d8808e.png

ends up looking like this

image.png.ebe94b35b0d0b52b757b68f6f3b2e103.png

Dave Hart. Software/Technology Consultant living in London. buymeacoffee 

Posted

oh right. I misunderstood. you could put in a code block and then wrap your text in a span and style it with the same rules I applied to the header.

<p style="  background-color: rgba(0,0,0,0.3) !important;
  padding:3px 8px; color:white;">
  Here is some text
</p>
  • rgba(a,b,c,d) is a way of specifying colour and opacity, the first three numbers go up to 255 and the last one is from 0.0 to 1.0. 1.0 is a block of colour, 0.0 is totally transparent
  • if you wanted to do this lots of times, then add the styling to your custom css as a class and use that in your code block

in your custom css:

.myFancyClassName {
background-color: rgba(0,0,0,0.3) !important;
padding:3px 8px; 
color:white;
}

in your code block

<p class="myFancyClassName">some text here</p>

 

Dave Hart. Software/Technology Consultant living in London. buymeacoffee 

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.