html - How do I get a div that appears on hover to overlap all others, without using absolute positioning? -


i feel should simple , see time, i'm struggling. i'm working on pop info box works on hover. problem is, no matter do, images , text in next div overlap pop-up. z-index doesn't work, assume because elements not (and can't be) absolutely positioned. need use pop class of images (so no absolute values) , layout fluid , break if use absolute positioning @ all.

so how these overlap properly? html , css below.

edit: here's link screenshot of i'm seeing: http://imgur.com/m7tdpdx need bubble in front of peter's picture , info.

thanks!

 <div class="meet-section">    <h1 style="display: block; border-bottom: 7px solid #720045; font-weight: 600; font-size: 2em; margin-bottom: 30px;">management</h1>     <div class="circle-pic">         <h1 class="employee">elisabeth</h1>             <a href="http://plumdirectmarketing.com/wp-content/uploads/2014/03/liz_appointment.png"><img src="http://www.plumdm.com/test/wp-content/uploads/2013/12/liz-small.png" onmouseover="this.src='http://www.plumdm.com/test/wp-content/uploads/2014/02/liz-small-ring.png'" onmouseout="this.src='http://www.plumdm.com/test/wp-content/uploads/2013/12/liz-small.png'" /></a>         <h2 class="position">head of sales</h2> <p>877-781-9962</p> <div class="infohover"> <img src="http://plumdirectmarketing.com/wp-content/uploads/2014/03/elisabeth_popup_name.png"><br> test!</div>     </div>      <div class="circle-pic">         <h1 class="employee">peter</h1>             <a href="http://www.plumdm.com/test/wp-content/uploads/2014/01/peter-large.png"><img src="http://www.plumdm.com/test/wp-content/uploads/2013/12/peter-small.png" onmouseover="this.src='http://www.plumdm.com/test/wp-content/uploads/2014/02/peter-small-ring.png'" onmouseout="this.src='http://www.plumdm.com/test/wp-content/uploads/2013/12/peter-small.png'" /></a>         <h2 class="position">head of operations<br> 800-992-9663</h2>     </div>     </div> 

css:

.infohover { display: none; background-image:url('/wp-content/uploads/2014/03/popup_bg_bubble.png'); background-repeat: no-repeat; font-family: "proxima-nova"; font-size: 16pt; color: #8d0057; height: 350px; width: 640px; padding: 20px; padding-left: 50px; z-index: 999; margin-left: 350px; margin-top: -380px; text-align: left; }  a:hover~.infohover { display: block; }  .circle-pic { z-index: -1; }  .meet-section { z-index: -1; } 

first, try adding couple more 9's z-index. kidding, won't work because pseudo-elements :hover create new stacking index. result, no solution involving z-index work, invariably case.

the solution here is absolute positioning. if set .circle-pic position: relative , .infohover position: absolute, hidden section positioned relative parent no impact on rest of page.

http://jsfiddle.net/qb4at/2/

happy further if doesn't solve problem -- not quite sure understood wrong originally.

.infohover {   display: none;   background-image:url('/wp-content/uploads/2014/03/popup_bg_bubble.png');   background-repeat: no-repeat;   font-family: "proxima-nova";   font-size: 16pt;   color: #8d0057;   height: 350px;   width: 640px;   padding: 20px;   padding-left: 50px;   /* z-index: 999; */   /* margin-left: 350px; */   /* margin-top: -380px; */   text-align: left;    position: absolute;   top: 0;   left: 350px; }  a:hover~.infohover {   display: block; }  .circle-pic {   position: relative;   /* z-index: -1; */ }  .meet-section {   /* z-index: -1; */ } 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -