0

The following code below adds a radio button with a number inside a border, but the border should be circle, how can I make it circle?

Note that the position of the text is important to not be affected by the css.

 
 p {
 outline-style: solid;
 padding : 16px;
     position: absolute;

 }
 
 
<p><input type="radio">1</p>
  • Just use `border: 3px solid black; border-radius: 50%;` instead of `outline-style: solid;`? – Huelfe Feb 20 '18 at 15:44

2 Answers2

2

Use the border and border-radius properties instead of outline-style:

 p {
   border: 3px solid #000;
   border-radius: 50%;
   height: 45px;  
   line-height: 45px;
   position: absolute;
   text-align: center;
   width: 45px;
 }
<p><input type="radio">1</p>

As you can see, you may also need to change the height and width elements to ensure that the element is a perfect circle (well, square).

BenM
  • 52,573
  • 26
  • 113
  • 168
0

try to set the border and then use order-radius.

p {
border: solid 2px black;
     padding : 16px;
     position: absolute;
     width: 30px;
     height: 30px;
     border-radius: 50%;
     }
<p><input type="radio">1</p>
MESP
  • 486
  • 2
  • 17