繁体   English   中英

在悬停时调整大小时显示另一个div

[英]show a div over another when resizing on hover

我有一些固定宽度和高度的div连续排在一起。 我想在悬停时增加宽度和高度,但是显示结果div而不是将其发送到下一行的其他div

我怎么能用css做到这一点?

我的HTML:

<div class="box">
</div>
<div class="box">
</div>
<div class="box">
</div>

我的CSS:

.box{
   float:right;
   width:173px;
   height:173px;
}

.box:hover{
   width:220px
   height:220px;    
}

你在找这样的东西吗?

.box{
   float:right;
   width:173px;
   height:173px;
   margin-top:10px;
}

.box:hover{
   width:220px;
   height:220px;    
   margin-left:-47px;
   position:relative;
}

编辑:@ malcom选择的css示例:

.box{
   float:right;
   width:200px;
   height:200px;
   margin-top:10px;
    background-color:grey;
    border:1px solid;
    margin-top:30px;
}

.box:hover{
   width:250px;
   height:250px;    
   margin-left:-25px;
   position:relative;
    margin-right:-25px;
    margin-top:5px;
    transition:all 200ms ease-in-out 0s;
}

http://jsfiddle.net/jxvN6/1/

暂无
暂无

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

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