我的 div 中有一个 div。我希望它能延伸到 shell div 之外,这样它就像一个选项卡。我认为仅使用带有负值的绝对定位会将其推出父级 div 。这似乎不起作用。有 CSS 解决方法吗?
最佳答案
http://jsfiddle.net/iambriansreed/W3CyT/4/
CSS
#sideWall {
height:100px;
width:100px;
position:absolute;
top: 10;
left: 10;
background: black;
margin-top: 60px; /* give room for tab */
}
.showSideWall {
height: 60px;
width: 30px;
position: absolute;
top: -60px; /* move tab above container */
right: 0;
background: red;
}
关于css - 定位 div,使其看起来像选项卡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12219823/