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>
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%....
Videos
03:59
CSS Border Radius Property | Make Rounded Corners, Circle & Oval ...
00:22
The border-radius feature most people don’t know about - YouTube
01:00
Border radius - CSS Tutorial for beginners in 1 Minute #shorts ...
03:07
Make a Circle Inside a Circle in HTML & CSS - YouTube
06:24
CURSO de CSS desde CERO 2021 - #26 - Border radius (circular) - ...
06:56
How to create circle with HTML and CSS - YouTube
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › CSS › Reference › Properties › border-radius
border-radius - CSS | MDN
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.
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:
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.
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:
Learnsic
learnsic.com › blog › css3-circles-how-to-create-circles-using-css3-border-radius
How to Create Circles Using CSS3 Border-Radius
This website uses cookies to ensure you get the best experience & by continuing to use our website, you agree to our Privacy and Cookie Policy · Got it
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
HTML Dog
htmldog.com › references › css › properties › border-radius
CSS Property: border-radius | HTML Dog
Specifies the radius of a quarter circle or ellipse that forms the corners of the outer-edge of the border area of a box.
W3Schools
w3schools.com › cssref › css3_pr_border-radius.php
CSS border-radius property
The border-radius property defines the radius of the element's corners. Tip: This property allows you to add rounded corners to elements! This property can have from one to four values.
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › CSS › Reference › Properties › border-top-left-radius
border-top-left-radius - CSS | MDN
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.
EASEOUT
easeout.co › blog › 2022-12-26-css-border-radius
CSS Border Radius | EASEOUT
To create a circle, set the radius to a value that is equal to or larger than the width or height of the element. For example: .my-circle { width: 100px; height: 100px; border-radius: 50%; /* radius equal to half the width and height of the element */ }
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.