what is the simplest and most universal way of transforming a div with these css propperties into a perfect circle?
div {
background-color: red;
padding: 5em;
}
what is the simplest and most universal way of transforming a div with these css propperties into a perfect circle?
div {
background-color: red;
padding: 5em;
}
The css rule to make a circle out of an HTML element is:
border-radius: 50%;
To make it work in all browsers additionally use:
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
-o-border-radius: 50%;
Take a JSFIDDLE DEMO
HTML
<div></div>
CSS
div{
border-radius:50%;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
-o-border-radius: 50%;
width:50px;
height:50px;
background-color:#000;
}