I need Help with rounding image corners.
<p style="text-align: center;"><img src="image.png"
width="300"
height="150"/>
I need Help with rounding image corners.
<p style="text-align: center;"><img src="image.png"
width="300"
height="150"/>
I assume you’re using HTML/CSS/JS? Please clarify your programming language and if possible share the link to your Repl for specific help.
Try this CSS:
img {
border-radius: 25%;
}
<p style="text-align: center;"><img src="wolfden.png"
width="300"
height="150"/>
Yup, css js HTML. Let me try that now.
You probably want to use a standard, non-scaling unit for a border radius, like pixels (px
), instead of a percentage (%
).
Probably. I tend to play around with different units until it’s the way I want it since CSS has so many units. I think 25%
will make it a circle.
It will depend on the dimensions of the page/parent element. The page will likely be very large in proportion and hence make it a circle. I think any value greater than half the width of the object will make it a circle.
hmm usually I just do 100% but I think the border radius should be 50% to make a square a circle;
Here is mathematical proof (kinda i was lazy)
just go into your css file and add a property border-radius: 50%
Feel free to tweak 50%
to anything you want. I usually use 10-20px for border-radius.
A separate CSS file is ideal but here’s how with your existing code:
<p style="text-align: center;"><img src="wolfden.png" style="border-radius: 25px;"/>
just make sure you keep the width and the height properties. Happy coding!
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.