How to position images around a circle inside a div (a)?

Hello!
Found online this code the location of objects in a circle
<div id="wrap">
<img src="/">
<img src="/">
<img src="/">
<img src="/">
<img src="/">
<img src="/">
<img src="/">
<img src="/">
</div>
CSS
<code>#wrap {position: absolute; }
#wrap img {width: 30px; height: 30px; background:#333; position: absolut
</code>
<code lang="javascript">
var num = 8; // Number of images
var wrap = 400; // Size of the "canvas" for the location of the pictures
var radius = 150; // Radius of our circle

$(document).ready(function() {
 for (i=0;i<num; i++){ var f="2" num * i, math.pi; calculate the angle of each image in radians left="wrap" + radius math.sin(f) 'px'; top="wrap" math.cos(f) $('#wrap img').eq(i).css({'top':top,'left':left}); Set values of the image } }); < code></num;></code>
<br / > It works, but I can't place this circle inside diva by default the circle is at the bottom of the page. I use the 3 boostrap tell me how to correctly position a circle into a div ?
June 3rd 19 at 19:37
1 answer
June 3rd 19 at 19:39
Solution
div has absolute positioning, so his kids don't affect its size. Set its size yourself, and see that everything inside it.
You mean to specify the size of the #wrap?
I've tried everything indicated all dimensions are something that is not right. - cathryn.Bergstr commented on June 3rd 19 at 19:42
that view, right? https://jsfiddle.net/fce21w0j/ - peggie_Aufderh commented on June 3rd 19 at 19:45
How to do this align the sides of the unit?
5b505349188d2309496463.jpeg - cathryn.Bergstr commented on June 3rd 19 at 19:48
Everything turned out great thank you! - cathryn.Bergstr commented on June 3rd 19 at 19:51

Find more questions by tags JavaScript