Reputation: 3
I am trying to place 5 little circle images over one image but the circles need to be in specific spots. How would I do that where it would also be scaleable? I already have most of the page built except for this one part.
I tried wrapping it all in one div, then using padding and/or margins on the circles to place them correctly, but I can't seem to get everything correct and they move when being scaled down.
Upvotes: 0
Views: 49
Reputation: 43880
Make a <div class="primaryImage"></div>
Then in <style>
or your CSS file: .primaryImage { background: url(path/img.png) no-repeat; position: relative; }
Now make your circles <img class="circle" src="path/circle.gif"/>
and place them inside .primaryImage
Then in the same place as #2: .circle { position: absolute; }
Assign an id* to each circle.
Example: <img
id="c1"class="circle" src="path/circle.gif"/>
After you have assigned a unique id to each circle <img>
assign the following style rules as you did in #2 and #4:
#c1 { top: 0; left: 0; } /* Top left corner */
#c2 { bottom: 0; left: 0; } /*Bottom left corner */
#c3 { bottom: 0; right: 0; } /* Bottom right corner */
#c4 { top: 0; right: 0; } /* Top right corner */
#c5 { top: 50%; left: 50%; } /* center */
*All classes and ids are arbitrary as well as the top, bottom, left,
and right
properties, they can be anything you want.
Upvotes: 0
Reputation: 1499
firstly you must post some code here or on jsfiddle.net or codepen . so that we can see what you have tried and what you are asking for.
secondly I am answering your question without knowing what you have tried so it may or may not be the answer of your question.
solution--
hope this may help you. but do post your code here for better assistance
Upvotes: 1