小编can*_*all的帖子

CSS,z-index DIV'应该在悬停时叠加其他DIV

我有一个问题,现在它吓坏了我好几天了.

我需要一个带有几个较小的DIV-Containers的竞争者Div,它们都应该浮动:左边...如果我悬停一个较小的DIV,高度和宽度应该增加,它应该覆盖其他DIV而不移动它们.

我的代码看起来像这样:

 <div id="boxcontainer">
  <div class="box"></div>
  <div class="box"></div>
  <div class="box"></div>
 </div>
Run Code Online (Sandbox Code Playgroud)

CSS:

.box{
float:left;
postion: relative;
width:150px;
height:150px;
margin:5px;
background-color: yellow;
}

#boxcontainer{
postion: relative;
width:500px;
height:auto;
}

.box:hover{
z-index:100;
width:300px;
height:auto;
}
Run Code Online (Sandbox Code Playgroud)

任何帮助都非常感谢!

欢呼,杰伊

css position z-index hover

5
推荐指数
1
解决办法
2万
查看次数

标签 统计

css ×1

hover ×1

position ×1

z-index ×1