I've been experimenting with converting some divs using border radius and I've almost got it, but sometimes they end up looking like 'eggs' haha. Here is the CSS code I'm using:
#div{ /*central div*/
position:absolute;
top:50%;
margin-top: -20%;
left:50%;
margin-left: -20%;
background: #00A8D9;
width: 40%;
height: 40%;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;
border:3px solid #000;
}
#divSupIzq,#divSupDer,#divInfIzq,#divInfDer{ /*Individual divs: top-left , top-right, bottom-left, bottom-right*/
background: #ddd;
width: 20%;
height: 20%;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;
border:3px solid #fff;
position:absolute;
}
#divSupIzq{ /*Top left Div*/
top:15%;
left:10%;
}
#divSupDer{ /*Top right Div*/
top:15%;
right:10%;
}
#divInfIzq{ /*Bottom left Div*/
bottom:15%;
left:10%;
}
#divInfDer{ /*Bottom right Div*/
bottom:15%;
right:10%;
}
In my HTML, I'm using JavaScript/jQuery to change the content of each div (text in top-left, top-right, bottom-left, bottom-right divs; and a number in the central div) based on the size of each div:
$('#div').resize(function(height){
var font = $(this).height()/2;
var margin = (font / 2)-5;
$('.content').css('font-size',font+'px');
$('.content').css('margin-top',margin+'px');
});
This is how it appears in Ripple extension for Chrome:
Can anyone help me ensure that the divs always maintain a circular shape, and not appear as eggs? Thanks in advance, Daniel