html - How do I center 2 images in a circular div while also overlapping them? -


i've been messing bootstrap template...pretty standard row 3 items.

each of row items i've turned divs circular background. now, i'm trying take 2 images (so can animate them) , center them in div.

i've found few ways hack around it...but i'm wondering best way is?

i want able control layering & make sure they're vertically centered @ times.

absolute positioning 1 of them borks centering of other right now...

html

<div class="col-lg-4">             <div class="feature-icon">                 <div id="phone">                      <img class="behind" src="img/svg/phone.svg" width="40">                     <img src="img/svg/pocket.svg" width="70">                 </div>             </div> 

css

img.behind { z-index: 0; position: relative; left: 20px; top: 40px; } 

here's looks right now.

image

i dont understand question. full control of div within container using absolute position make parent container relative.

html

<div id="parent-container">      <div id="animated-object1" class="object"></div>      <div id="animated-object2" class="object"></div>      <div id="animated-object3" class="object"></div> </div> 

css

#parent-container{    position:relative;    top:0;    bottom:0;    left:0;    right:0;    margin: auto;    width:100%;    height:500px;     border:1px solid red; }  .object{    position: absolute;     width:50px;     height:50px;    top:0;    bottom:0;    left:0;    right:0;    margin: auto;     border: 1px solid green; } #animated-object1{   left:300px;   border:1px solid blue; } 

javascript - jquery - onclick- animation syntax

$('#parent-container').on('click', function(){     $('#animated-object1').animate({       left: "0px"     }) })    

http://jsfiddle.net/9lufvdfn/4/


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -