How do I round the corners of an image in Weebly. I know the css is border-radius: 20px; but how do I achieve it for particular image on a page (not the whole site)?
thanks.
Hi @ForumSurfer !
I have included some options below for how to achieve this. Please let me know if you have any questions!
Add HTML Element:
Drag & Drop 'Custom HTML' element to your page
→ Click to edit
→ Paste this code:
<img src="YOUR-IMAGE-URL" style="border-radius: 20px;">
Get Your Image URL:
<div class="rounded-image">
<img src="YOUR-IMAGE-URL">
</div>
<style>
.rounded-image img {
border-radius: 20px;
overflow: hidden;
}
</style>
Find Your Image:
Add Custom CSS:
#rounded-pic {
border-radius: 20px;
}
Adjusting the Radius:
50%
for perfect circlesborder-radius: 10px; /* subtle */
border-radius: 20px; /* medium */
border-radius: 50%; /* circle */
Different Corner Styles:
/* Round specific corners */
border-radius: 20px 0 0 20px; /* left side only */
border-radius: 20px 20px 0 0; /* top only */
If the rounded corners aren't showing:
I hope this helps!
Hi @ForumSurfer !
I have included some options below for how to achieve this. Please let me know if you have any questions!
Add HTML Element:
Drag & Drop 'Custom HTML' element to your page
→ Click to edit
→ Paste this code:
<img src="YOUR-IMAGE-URL" style="border-radius: 20px;">
Get Your Image URL:
<div class="rounded-image">
<img src="YOUR-IMAGE-URL">
</div>
<style>
.rounded-image img {
border-radius: 20px;
overflow: hidden;
}
</style>
Find Your Image:
Add Custom CSS:
#rounded-pic {
border-radius: 20px;
}
Adjusting the Radius:
50%
for perfect circlesborder-radius: 10px; /* subtle */
border-radius: 20px; /* medium */
border-radius: 50%; /* circle */
Different Corner Styles:
/* Round specific corners */
border-radius: 20px 0 0 20px; /* left side only */
border-radius: 20px 20px 0 0; /* top only */
If the rounded corners aren't showing:
I hope this helps!
Comprehensive reply, thanks. However I want to define a class so other admins/authors can do this to their images on different pages w/o having to do it to each image. So I have added: .write-page-meditation .corners {border-radius:20px;} to main.less (the site CSS file). BUT your suggestion:
Find Your Image:
does not allow me to add an ID corners in the Advanced (Weebly) for the image.
}
Please advise on this method. Thanks.
Hi @ForumSurfer
Weebly's interface can be tricky with custom classes. Here's how to properly add a class to images in Weebly:
Add Section:
Method 3: Target Specific Page Areas
/* Target all images in specific section */
.write-page-meditation img {
border-radius: 20px;
}
/* Target specific content areas */
.content-area-name img {
border-radius: 20px;
}
If Classes Don't Apply:
I hope this helps!
Square Community
Square Products