简体   繁体   English

将图片悬停在其他内容下方

[英]Hover picture positioned under other content

i'm trying to add some hover selector for the images of the page i'm currently developing, but as i point the cursor on the image, hover works fine but the position was somehow wrong because it appears under the content close to it. 我正在尝试为我当前正在开发的页面的图像添加一些悬停选择器,但是当我将光标指向图像时,悬停效果很好,但是由于某种原因它的位置出现了错误,因为它出现在靠近它的内容下。 i've tried using z-index and positions. 我试过使用z-index和positions。 and one more thing, i also want it to zoom from the center of the div, and from the corner . 还有一件事,我也希望它从div的中心和角落缩放。 any help?check out this fiddle 有帮助吗?查看这个小提琴

  CSS:
  html, body { 
  margin: 0; 
   height: 100%; 
   }

.management_wrapper{
 text-align: center;
 max-width: 80%; ;
 height:auto;
 background-color: white;
 padding-top: 0%;
 padding-bottom: 10%;
 position: relative;
 overflow: auto;
 margin-left: 5%; 
 }

#list_box{
margin-top: 1%;
width: 15%;
height:20%;
float:left;
background-color:beige;
margin-right:1%;
position: relative;
}
#info{
margin-top: 1%;
width: 15%;
height:20%;
float:left;
color: white;
margin-right: 1%;
position: relative; 
}
#info p{
margin-top: 20%;
color: ;
}
.img_size {
width: 100%;
height:100%;
}
.img_size:hover{
width: 300px;
height:300px;
position: relative;
}

    HTML:

     <center>   
                    <div id="info" style="background-color: #800000  "></div>   
                    <div id="info" style="background-color: #280000 ;">
                        <p>  Elena H. Dimailig 
                             Managing Director                          </p>    
                    </div>          
                            <div id="list_box">     
                            <center> 
                            <img id="img_size" src="images/main/3.jpg">
                            </center>   
                            </div>  





                <center>    
                    <div id="info" style="background-color: #800000  ">
                        <p>  Joel Molina 
                             Assistant Account Manager                          </p>     
                    </div>                  
                            <div id="list_box">         
                            <center> 
                            <img class="img_size" src="images/main/molina.jpg">
                            </center>   
                            </div>  
                <div id="info" style="background-color: #180000  "></div>

https://jsfiddle.net/qz6s2vps/1/ https://jsfiddle.net/qz6s2vps/1/

If I correctly understood your question, than it might be help you, please check it out working demo: 如果我正确理解了您的问题,那么可能会对您有所帮助,请查看工作演示:

I just modify your demo at: https://jsfiddle.net/223ye3na/ 我只是在以下位置修改您的演示: https : //jsfiddle.net/223ye3na/

I just modify your below code: 我只是修改您的以下代码:

#img_size {
  width: 100%;
  height:100%;
  -webkit-transition: all 1s ease; /* Safari and Chrome */
    -moz-transition: all 1s ease; /* Firefox */
    -o-transition: all 1s ease; /* IE 9 */
    -ms-transition: all 1s ease; /* Opera */
    transition: all 1s ease;

}
#img_size:hover{
-webkit-transform:scale(1.25); /* Safari and Chrome */
    -moz-transform:scale(1.25); /* Firefox */
    -ms-transform:scale(1.25); /* IE 9 */
    -o-transform:scale(1.25); /* Opera */
     transform:scale(1.25);
}

Updated: 更新:

After your comments on this answer I was updated my answer check this URL to see live demo: https://jsfiddle.net/223ye3na/1/ 在您对此答案发表评论后,我的答案已更新,请检查以下URL以观看实时演示: https : //jsfiddle.net/223ye3na/1/

Updated code: 更新的代码:

#info{
  z-index: -1;    
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM