javascript - How can I center a group of objects together in HTML with CSS? -
i have group of objects (divs) small squares can move anywhere (there's javascript function move then). squares , form figure. have figure centered css: "left: 600px
" i'm trying make more responsive design page , started percents encountered 2 problems.
if add percentage objects individually, when zoom in or zoom out or when resize page become more closer of far away each other.
if create div including objects , add "
left:50%
" when click move them go instantanially 50% left. mouse -> () [spacespacescpace] / \ <- , object, i'm still selecting object. that's weird...
this html:
<div id="container"> <div class="vepart" id="me2"></div> <script type="text/javascript"> jcl.loadbehaviour("me2", moverbehaviour); </script> <div class="vepart" id="me3"></div> <script type="text/javascript"> jcl.loadbehaviour("me3", moverbehaviour); </script> <div class="vepart" id="me4"></div> <script type="text/javascript"> jcl.loadbehaviour("me4", moverbehaviour); </script> <div class="vepart" id="me5"></div> <script type="text/javascript"> jcl.loadbehaviour("me5", moverbehaviour); </script></div>
here's css:
#me2 { content:url("some image"); top:401px; left:0px; z-index:5; } #me3 { content:url("some image"); top:400px; left:-58px; z-index:5; } #me4 { content:url("some image"); top:400px; left:58px; z-index:5; } #me5 { content:url("some image"); top:500px; left:-57px; z-index:5; }
try setting position property absolute , using percentage. sounds having problem relative positioning.
#me2 { content:url("some image"); position:absolute; top:401px; left:50%; z-index:5; }
Comments
Post a Comment