Jump to content

Customizing "Sale" flag with different words

Go to solution Solved by paul2009,

Recommended Posts

Site URL: http://ginnydi.com

I'm using this code to change "Sale" to "Pre-Order":

.product-mark.sale {
    font-size: 0;
}
.product-mark.sale:before {
    font-size: 15px;
    content: "Pre-Order";
}

It's working mostly as intended, but for some reason it made the actual rectangle of the "flag" behind the text much narrower.  You can see it on this test page, but I've also attached a screenshot of it for posterity. You can see that compared to the "Sold Out" flag to the right, the flag is much thinner. How can I fix this?

Screen Shot 2021-10-29 at 3.40.57 PM.png

Link to comment
  • Solution

The code is just slightly oversimplified. If you add a line height it should be fine. For example, here's the second part of the code, with this added:

.product-mark.sale:before {
  font-size: 15px;
  content: "Pre-Order";
  line-height: 1em;
}

  If this post has helped you, please click a 'Like' or 'Thanks' icon below  ⬇️

Improve your online store with our extensions.
About: Squarespace Circle Leader since 2017. I value honesty, transparency, appreciation and great design ♥.
Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™.
Content: Links in my posts may refer to SF Digital products or may be affiliate links.

Buy me a coffee

Link to comment
1 hour ago, paul2009 said:

The code is just slightly oversimplified. If you add a line height it should be fine. For example, here's the second part of the code, with this added:

.product-mark.sale:before {
  font-size: 15px;
  content: "Pre-Order";
  line-height: 1em;
}

  If this post has helped you, please click a 'Like' or 'Thanks' icon below  ⬇️

That fixed it perfectly!! Thank you so much!

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.