Jump to content

Code to change radius of shape corners

Go to solution Solved by Web_Solutions,

Recommended Posts

Posted

I've created the below code to change the radius of an image on a website I'm building and it's worked perfectly!

@media screen and (max-width:767px) {
  #block-yui_3_17_2_1_1697485376162_9705 img {
    border-top-left-radius: 20px;
    border-bottom-left-radius: 0px;
    border-top-right-radius: 20px;
    border-bottom-right-radius: 0px;
  }
}

My problem is that I'm new to code and I want the same code but for a rectangle shape. 'img' is for image in the code, what would it be for a shape?

Thank you

  • Solution
Posted
2 hours ago, NicoleDagnyx said:

https://orange-calliope-t6c4.squarespace.com/

Page: About us

Password: dottydot

@tuanphan

The corners I want curved are different for desktop and mobile as you can see from the images.

Screenshot 2023-10-22 at 22.01.12.png

Add these code on Custom CSS panel in Website Utilities Website Tools > Custom CSS.

#block-6e9c5a7de129c732854c {
  border-top-left-radius: 20px;
  border-bottom-left-radius: 20px;
  overflow: hidden;
}

#block-yui_3_17_2_1_1697485376162_10674 {
  border-top-right-radius: 20px;
  border-bottom-right-radius: 20px;
  overflow: hidden; 
}

@media screen and (max-width: 767px) {
  #block-6e9c5a7de129c732854c, #block-yui_3_17_2_1_1697485376162_10674 {
    border-top-left-radius: 0px ;
    border-bottom-left-radius: 20px;
    border-top-right-radius: 0px;
    border-bottom-right-radius: 20px
  }
}

 

If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks

MD Rofik
Website Designer and Digital Marketer

Am I helpful? Want to offer me a coffee?
Send me a message if needed any help. I'll try to reply as soon as possible.


 

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.