繁体   English   中英

Z-index 固定位置

[英]Z-index with fixed positon

我想让我的课程总是在页面的前面,但它不起作用。

请帮我找到解决办法。

 .test { border-radius: 5px 0px 0px 5px; height: 150px; width: 40px; top: 50% !important; right: 0 !important; float: right; position: fixed !important; transition: width 0.5s; -webkit-transition: width 0.5s; text-align: left; overflow: hidden; z-index: 1000; } .test .right { float: right; background: #4A90E2; width: 30px; height: 100%; position: relative; z-index: 10; text-align: middle; padding-top: 50px; padding-bottom: 50px; white-space: nowrap; } .test .left { position: absolute; left: 0; margin-left: 20px; float: left; }
 <div class="test" style="background-color: #4A90E2;"> <div class="right"> <h6 style="transform:rotate(-90deg); color: white; margin-top:50px; margin-right:10px"> <i style="color:white; " class="fa fa-phone fa-1x" aria-hidden="true"></i>&nbsp;&nbsp; Service </h6> </div> <div style="color:white;" class="left"> <h3 style="color:white !important;"> Text</h3> <p style="margin-top:-20px;">sometext </p> </div> </div>=

Z-index 将不起作用,因为 class right div 在 test div 内。 如果您从 test div 中取出 class right div,它将起作用。

暂无
暂无

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

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