We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Image Border Radius For All Images On Website

Image Border Radius For All Images On Website

M1ka
Shopify Partner
4 0 2

Hi all!

 

I'm trying to get rounded corners on all of the images on our new website. I've added code to the CSS file inside the theme. Only the collection and product images have a corner radius of 15px. For some reason, the gallery and media with text images don't want to change. Not even when you add the code to the specific section.

 

The used code is the one below. I've used it for other websites and worked fine then.

 

Anyone got any suggestions?

 

 

img {
  border-radius: 15px;
}

 

Replies 8 (8)

beauxbreaux
Shopify Partner
299 27 60

Make sure the images are using the image tag as well. If the answer from @stefansweb2020 doesn't work you may be dealing with an SVG or you CSS may not be available globally to all elements. A URL would help us figure it out but generally speaking typically adding !important would do the trick. 

Beaux Barker
Developer
Buy me a Coffee
M1ka
Shopify Partner
4 0 2

Hi @beauxbreaux ,

 

Thank you for your prompt reply! The code below is working on, i.e., collection list. But not on galleries and media with text fields. Not even when I add it to the designated CSS field inside the section.

I am currently using showcase theme, used the code before and it worked fine then. This time however, there is no changes to the above mentioned sections. So I am a bit clueless right now.

ZenoPageBuilder
Shopify Partner
1052 203 229

Hi @M1ka 👋

I guess the images on your site are actually background images, so the code didn't work. If you don't mind, you can send me your site URL here or in the inbox so I can check and give you another code. We do not charge any fee for helping people on the community, and do not use the url for other purposes, so feel free to share the url.

Zeno Page Builder - Build responsive & SEO-optimized Landing pages, Blog posts, Product pages and more...
Learn more at zenobuilder.com

ZenoPageBuilder
Shopify Partner
1052 203 229

Hello @M1ka 👋

Try this code

img {
  border-radius: 15px !important;
}
Zeno Page Builder - Build responsive & SEO-optimized Landing pages, Blog posts, Product pages and more...
Learn more at zenobuilder.com
M1ka
Shopify Partner
4 0 2

Hi @ZenoPageBuilder,

 

Appreciate the reply! Unfortunately the code only applies to collections etc. Galleries and Media with Text sections remain unchanged.

 

Got any idea what/why or how? 

 

Thank you!

niraj_patel
Shopify Partner
2391 516 516

hello @M1ka 

You can add code by following these steps :

1. Go to Online Store -> Theme -> Edit code.
2. Open your base.css file

3. Paste the below CSS

       img {

                 border-radius: 20px !important;

        }

Shopify Partner || Helping eCommerce Stores
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution.
- For further discussion contact: Email ID- info@techlyser.com
M1ka
Shopify Partner
4 0 2

Hi @niraj_patel,

 

Appreciate your reply too! Unfortunately the code only applies to collections etc. Galleries and Media with Text sections remain unchanged.

 

Got any idea what/why or how? 

 

Thank you!

niraj_patel
Shopify Partner
2391 516 516

Hello @M1ka 

you have to mention a parent div class with this CSS.
Example:

if parent div class name is collection then you have to add like this
.collection img{

    border-radius: 20px !important;

}

Shopify Partner || Helping eCommerce Stores
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution.
- For further discussion contact: Email ID- info@techlyser.com