You can do this by giving the span a fixed width and height:
span p {
margin: 0;
}
span {
background-color: red;
display: inline-block;
border-radius: 50%;
width: 50px;
height: 50px;
text-align: center;
}
<span>
<p>25</p>
<p>08</p>
</span>
Answer from GolezTrol on Stack Overflow Top answer 1 of 6
43
You can do this by giving the span a fixed width and height:
span p {
margin: 0;
}
span {
background-color: red;
display: inline-block;
border-radius: 50%;
width: 50px;
height: 50px;
text-align: center;
}
<span>
<p>25</p>
<p>08</p>
</span>
2 of 6
5
You need a predefined width and height on the span to be able to make it round.
span p {
margin: 0;
}
span {
background-color: red;
display: inline-block;
border-radius: 50%;
width:40px;
height:40px;
padding-left:10px;
box-sizing: border-box;
}
<span>
<p>25</p>
<p>08</p>
</span>
Using Border-Radius to Create Circle Behind Text - HTML & CSS - SitePoint Forums | Web Development & Design Community
I’m trying to add a circle behind some slider text but I cannot get the circle to be centered with the text. You can see it here–scroll down to ‘Find Your Industry’. I’m using: .tp-parallax-wrap { background: red none repeat scroll 0 0; border-radius: 50%; height: 250px; width: 250px; ... More on sitepoint.com
Border-radius % or px?
There is a difference between using percentage and pixel values. Example: http://jsfiddle.net/95anjwdb/ If the height and the width are equal, you don't see any difference. But if one side is larger, the border-radius: 50%; will act differently. In that case, 50% means "50% of that side". So the corner will actually be an ellipse. If you use 10000px, it will remain a circle. The very high value doesn't change anything because the maximum radius will always be half of the height (or of the smaller side) for some reason. In my example, a radius of 15px would be enough (because the div is 30px high). But if I applied the same border-radius to higher divs, I wouldn't want to update the value constantly. So I guess people use border-radius: 10000px as default. As long as it works... More on reddit.com
[css-borders] `border-radius` with a circular edge
Is there, or could there be a more semantic way to describe a border radius as being round rather than some current conventions? From TailwindCSS: .rounded-full { border-radius: 9999px; } From an a... More on github.com
Can someone explain border-radius?
Imagine you have a cardboard box, and you have a ping pong ball. Let's say the radius of the ping pong ball is 1 inch. Take the ping pong ball and shove it into the corner of the cardboard box until it's nestled in there nice and snug. Since the ping pong ball is round, it's not a perfect fit into the square corners. There's a little bit of space left in between the ball and the edges of the box. Imagine you took a knife and carved away that extra space until the box fit perfectly around the ping pong ball. Or just collapsed the cardboard around the ball. The resulting shape is a box with a border radius of 1 inch. A larger border radius means a larger ball (or circle) that defines the area to be carved away, which means a more gradual curve. As for the reason why 100px can look the same as 10px: There's a point at which the ball you're trying to fit into the corner becomes larger than the box itself, so increasing the border radius no longer changes the shape of the corners. In the simplest case, assuming we have a perfectly square box, this happens when the diameter of the ball equals the length of any side. Since diameter is twice the radius, increasing border radius stops "working" once the radius increases beyond 1/2 the length of each side. More on reddit.com
Videos
05:50
How to create a circle using HTML & CSS? - YouTube
03:07
Make a Circle Inside a Circle in HTML & CSS - YouTube
03:59
CSS Border Radius Property | Make Rounded Corners, Circle & Oval ...
06:56
How to create circle with HTML and CSS - YouTube
01:00
Border radius - CSS Tutorial for beginners in 1 Minute #shorts ...
06:24
CURSO de CSS desde CERO 2021 - #26 - Border radius (circular) - ...
Reddit
reddit.com › r/csshelp › how do you make this kind of circle ?
r/csshelp on Reddit: How do you make this kind of circle ?
March 7, 2023 -
How do I achieve this kind of circle on a website? Is there a generator or can it be done through CSS alone? Please help:
https://imgur.com/a/hlqXFKM
Top answer 1 of 3
5
I'd imagine its a giant css circle pushed to the background. I can't see it being all that special. Maybe slap a ::before on the body or the top section and make it a circle with a negative z-index.
2 of 3
3
This seems to be a curved border with a solid background color. To make a curved border in pure CSS, you can use the border-radius property. The border-radius property allows you to create rounded corners on an element's border, including the bottom border to create a curve. Here's an example: div { background-color: blue; border-radius: 0 0 50% 50% / 0 0 100px 100px; height: 200px; width: 400px; } In this example, we're using the border-radius property to create a curve on the bottom border of the div element. The 50% values for the horizontal radius create a half-circle shape, while the 100px values for the vertical radius control the height of the curve. You can adjust these values to create a different curve shape. Note that the border-radius property works best when the element has a solid background color, as the curve will be visible through transparent backgrounds. I hope this helps! Let me know if you have any further questions.
W3Schools
w3schools.com › css › css3_borders.asp
CSS Rounded Corners
To create elliptical corners, you ... (for a rectangular element), or to create a circular shape (for a square element) set border-radius to 50%....
W3Schools
w3schools.com › howto › howto_css_circles.asp
How To Create Circles / Round Dots
<span class="dot"></span> <span class="dot"></span> <span class="dot"></span> <span class="dot"></span> To create a circle, use the border-radius property and set the value to 50%. Then combine the height and width properties with a matching value:
SitePoint
sitepoint.com › html & css
Using Border-Radius to Create Circle Behind Text - HTML & CSS - SitePoint Forums | Web Development & Design Community
February 22, 2016 - I’m trying to add a circle behind some slider text but I cannot get the circle to be centered with the text. You can see it here–scroll down to ‘Find Your Industry’. I’m using: .tp-parallax-wrap { background: red none repeat scroll 0 0; border-radius: 50%; height: 250px; width: 250px; ...
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › CSS › Reference › Properties › border-top-left-radius
border-top-left-radius - CSS | MDN
November 17, 2025 - div { border-top-left-radius: 40px 20px; background-color: lightgreen; border: solid 1px black; width: 100px; height: 100px; } A square element with a single <percentage> value produces an arc of a circle.
Webdevworkshop
webdevworkshop.io › code › css-circles
Creating Circles with CSS
A value that uses any CSS length measurement, such as px, em, rem, vw, or vh. ... A percentage value. border-radius is a shorthand property for border-top-left-radius, border-top-right-radius, border-bottom-right, and border-bottom-left-radius properties, each of which can take one or two length or percentage values. It can get complicated, but fortunately you can ignore all that complication if all you want is a circle shape, because that only requires two things:
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › CSS › Reference › Properties › border-radius
border-radius - CSS | MDN
2 weeks ago - The border-radius CSS property rounds the corners of an element's outer border edge. You can set a single radius to make circular corners, or two radii to make elliptical corners.
Reddit
reddit.com › r/css › border-radius % or px?
r/css on Reddit: Border-radius % or px?
November 26, 2014 -
Just taken over some CSS from another company and I came across "border-radius: 10000px;" to get a circle effect. I've always used "border-radius: 50%;" to get the same effect. Is there any reason they might have used 10000px? Unfortunately I can't get in touch with the previous devs.
Cheers!
Top answer 1 of 4
10
There is a difference between using percentage and pixel values. Example: http://jsfiddle.net/95anjwdb/ If the height and the width are equal, you don't see any difference. But if one side is larger, the border-radius: 50%; will act differently. In that case, 50% means "50% of that side". So the corner will actually be an ellipse. If you use 10000px, it will remain a circle. The very high value doesn't change anything because the maximum radius will always be half of the height (or of the smaller side) for some reason. In my example, a radius of 15px would be enough (because the div is 30px high). But if I applied the same border-radius to higher divs, I wouldn't want to update the value constantly. So I guess people use border-radius: 10000px as default. As long as it works...
2 of 4
2
if you use more than 50% of the actual size, it'll boil down to 50% anyway - but in some cases, this fixes a small inconsistency in IE with border-radius (i.e. if there is 3px, the background will "shine through" in parts, but it you set it to 3.01px, this doesn't happen).
GitHub
github.com › w3c › csswg-drafts › issues › 6467
[css-borders] `border-radius` with a circular edge · Issue #6467 · w3c/csswg-drafts
July 21, 2021 - #rect { border-radius: round; } 👍React with 👍6yisibl, marcobiedermann, danielturus, SebastianZ, simevidas and 1 more😄React with 😄1jonjohnjohnson🎉React with 🎉24colmtuite, mzaien, JReinhold, troglotit, benslv and 19 more · No one assigned · css-borders-4 ·
Published Jul 21, 2021
CSS-Tricks
css-tricks.com › almanac › properties › b › border-radius
border-radius | CSS-Tricks
November 10, 2022 - Here is the code: div { height:250px; width:250px; background-image:url(image.jpg);} .round { border-radius: 60px; /* Prevent background color leak outs / border: 20px solid rgb(18, 50, 51); border: 20px solid rgba(18, 50, 51, 0.9); -webkit-background-clip: padding-box;/ for Safari / -moz-border-radius:360px;/ Firefox – alte Syntax */ } ... Using percentages is perfect for a responsive CSS Circle, but having it break below iOS 5.0 is a problem I’m having.
DEV Community
dev.to › justtanwa › css-border-radius-2hn3
CSS - Border Radius - DEV Community
July 10, 2022 - You can see that if we provide different values for the horizontal and the vertical, the "roundness" of our corner looks a little off, this is due to the ellipse. As mentioned above, a circle is a special type of ellipse, where both the major and minor axes have the same length, this means that if we set the horizontal and vertical values to be the same, we will get a nice circular border radius.
Clippy
bennettfeely.com › clippy
Clippy — CSS clip-path maker
The inset() shape optionally allows values similar to border-radius for rounded edges. This new feature may be buggy in your browser. The clip-path property allows you to make complex shapes in CSS by clipping an element to a basic shape (circle, ellipse, polygon, or inset), or to an SVG source.
Mimo
mimo.org › glossary › css › border-radius
CSS Border Radius: Rounded Corners for Stylish Elements
Similarly, you can round image elements with border-radius. By setting border-radius to 50%, you can make the image a perfect circle.