Jump to content

Reduce Size of 'SALE' circle according to screen size

Go to solution Solved by Beyondspace,

Recommended Posts

I have a 'Sale' icon on my site which works great for all breakpoints apart from tablet mainly where it completely covers the product and where it becomes way too big.

This is the code that I am currently using below. What would I need to add to this code in order for the graphic to reduce in size but stay roughly in the same position as it does on other breakpoints?

https://www.peterotoole.ie/shop/sale

/* Changes the look of the SALE tag and put it into a red circle, top right */
.product-mark.sale {
    position: absolute;
    top: 50px;
    right: 20px;
    border: 0px solid white;
    width: 120px;
    height: 120px;
      font-size: 38px !important;
      color: white !important; 
    text-align: center;
       padding: 2px 2px 0 2px;
    background: #EE3129;
    color: white;
    border-radius: 50%;
    line-height: 112px;

Thanks as always!

Peter

1802358201_Screenshot2023-01-14at7_24_48p.m..png.d84a8e2f25933d33f1f893ea5f4a09b8.png

774282095_Screenshot2023-01-14at7_26_33p.m..png.51c7c5076d61360e7048df94592060db.png

Edited by niteshifte
Link to comment
  • niteshifte changed the title to Reduce Size of 'SALE' circle according to screen size
  • Replies 2
  • Views 209
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

  • Solution
3 hours ago, niteshifte said:

I have a 'Sale' icon on my site which works great for all breakpoints apart from tablet mainly where it completely covers the product and where it becomes way too big.

This is the code that I am currently using below. What would I need to add to this code in order for the graphic to reduce in size but stay roughly in the same position as it does on other breakpoints?

https://www.peterotoole.ie/shop/sale

/* Changes the look of the SALE tag and put it into a red circle, top right */
.product-mark.sale {
    position: absolute;
    top: 50px;
    right: 20px;
    border: 0px solid white;
    width: 120px;
    height: 120px;
      font-size: 38px !important;
      color: white !important; 
    text-align: center;
       padding: 2px 2px 0 2px;
    background: #EE3129;
    color: white;
    border-radius: 50%;
    line-height: 112px;

Thanks as always!

Peter

1802358201_Screenshot2023-01-14at7_24_48p.m..png.d84a8e2f25933d33f1f893ea5f4a09b8.png

774282095_Screenshot2023-01-14at7_26_33p.m..png.51c7c5076d61360e7048df94592060db.png

You can use the css style for each breakpoint

.product-mark.sale {
  position: absolute;
  top: 50px;
  right: 20px;
  border: 0px solid white;
  width: 120px;
  height: 120px;
  font-size: 38px !important;
  color: white !important; 
  text-align: center;
  padding: 2px 2px 0 2px;
  background: #EE3129;
  color: white;
  border-radius: 50%;
  line-height: 112px;
  display: flex;
  justify-content: center;
  align-items: center;
}
@media only screen and (max-width: 767px) {
  /*Mobile style*/
  .product-mark.sale {
    width: 100px;
    height: 100px;
    font-size: 20px !important;
  }
}

@media only screen and (min-width: 768px) and (max-width: 1023px) {
  /*tablet style*/
  .product-mark.sale {
    width: ???;
    height: ???;
    font-size: 20px !important;
  }
}

Support me by pressing 👍  or marking as solution if this useful for you

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. 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.