z-index

z-index 应用简单总结

允我心安 提交于 2019-12-16 21:20:25
做过页面布局的同学对z-index属性应该是很熟悉了,z-index是针对网页显示中的一个特殊属性。因为显示器是显示的图案是一个二维平面,拥有x轴和y轴来表示位置属性。为了表示三维立体的概念如显示元素的上下层的叠加顺序引入了z-index属性来表示z轴的区别。表示一个元素在叠加顺序上的上下立体关系。 z-index值较大的元素将叠加在z-index值较小的元素之上。对于未指定此属性的定位对象,z-index 值为正数的对象会在其之上,而 z-index 值为负数的对象在其之下。 简单演示 <div style="width:200px;height:200px;background-color:#0e0;"></div> <div style="position:relative; top:-50px; width:100px;height:100px;background-color:#00e;"><div> 两个DIV,第二个向上移动50px,正常情况应该是这样的 第二个div遮住了第一个div,对第二个添加z-index属性 <div style="width:200px;height:200px;background-color:#0e0;"></div> <div style="position:relative; top:-50px; width:100px

IE7 Z-Index Layering Issues

狂风中的少年 提交于 2019-12-16 19:55:00
问题 I've isolated a little test case of IE7's z-index bug, but don't know how to fix it. I have been playing with z-index all day long. What is wrong with z-index in IE7? Test CSS: input { border: 1px solid #000; } div { border: 1px solid #00f; } ul { border: 1px solid #f00; background-color: #f00; list-style-type: none; margin: 0; padding-left: 0; z-index: 1000; } li { color: #fff; list-style-type: none; padding-left: 0; margin-left: 0; } span.envelope { position: relative; } span.envelope ul {

z-index不起作用的大坑

限于喜欢 提交于 2019-12-16 17:46:22
其实原理也很简单,就是利用了z-index的覆盖问题,在写的过程中我发现无论怎么改变,insert的z-index总是无效的,于是百度了一下z-index无效的情况,一共有三种: 1、父标签 position属性为relative; 2、问题标签无position属性(不包括static); 3、问题标签含有浮动(float)属性。 这样也很好理解为什么parent设置了position和z-index之后insert的z-index就会失效的问题了,他的解决办法有是三个: 1、position:relative改为position:absolute; 2、浮动元素添加position属性(如relative,absolute等); 3、去除浮动。 所以,去掉parent的position和z-index,达到了我想要的效果,如下图所示: ———————————————— 版权声明:本文为CSDN博主「瞬间空白sky」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。 原文链接:https://blog.csdn.net/apple_01150525/article/details/76546367 来源: CSDN 作者: 飞翔的熊blabla 链接: https://blog.csdn.net/sd19871122/article

UIView above UIAlertView

狂风中的少年 提交于 2019-12-14 03:49:14
问题 In my app, a lock screen is used. Sometimes a UIAlertView is shown, now when the user sends the app to the background and brings it in front again, the UIAlertview is shown above the lock screen. Is there a possibility to add a UIViewController 's view above everything, i.e. above the UIAlertView ? 回答1: You should have like this UIWindow *mySpecialWindowForLockScreen = [[UIWindow alloc]initWithFrame:[[UIScreen mainScreen] bounds]]; //"Hey iOS Please put this window above all alert view"

Locking screen by z-index in windows phone

落花浮王杯 提交于 2019-12-14 03:15:14
问题 I use loader when app loads data, under the loader there is dark screen, links and navigation items should be locked in that time, app is phonegap based app, and everything is ok in iOS and Android. Problem is in WP8,the screen is dark, but links and navigation are clickable. Here is my css code for loader .loader { background: rgba(0,0,0,0.6); width:100%; height:100%; position:absolute; left:0; right:0; z-index:1000; } I've researched and found one solution to use transparent icon instead of

IE dropdown z-index bug

*爱你&永不变心* 提交于 2019-12-14 01:32:02
问题 I'm having a problem with a dropdown menu under IE (6 and 7). http://www.amaconsulting.pl/promocje.html As you can see, the dropdown hides behind the main content area in IE. It's a known bug and general advice is to set a z-index for header and content areas, so IE knows their "place", explained in the article here: http://bit.ly/coSPcI I've set the z-index of .header div to 20 and .featured, .content, .primary, .main to 1, trying to find the right div to fix the problem. While the dropdown

Centered content with right fixed nav causes z-index problem

旧巷老猫 提交于 2019-12-13 18:22:09
问题 I have a centered container layout with a right fixed nav div. To make the fixed nav stay in place when viewport resizes it's set up in some nested divs. Problem is the nav div ends up infront of the content. I can change the z-index order but I want both content and nav to be accesible as in being able to "mark" text for example. Any ideas on this? Below is link to code and and an image showing the layout structure http://jsbin.com/aliru5/3/edit 回答1: You are making this more complicated than

z-index not setting in Bootstrap

倖福魔咒の 提交于 2019-12-13 18:18:36
问题 I am using bootstrap and I have a modal that pops up and it works just fine only the .modal-dialog has a z-index of 0 even though it DOES get set. The .modal-backdrop.n has a z-index of 1030 and that works just fine so the .modal-dialog is being put in/under the black back drop. Anyone know what the heck is going on here and how to fix? Greatly appreciated! I am well aware of stuff like this z-index parent/child relationship Simple Bootstrap Modal Fiddle EDIT I upgraded my bootstrap version

Position an element under a div by using z-index

那年仲夏 提交于 2019-12-13 17:18:53
问题 I tried to put a child div that will come under its parent and over the other elements. .box1{ background-color: blue; width: 500px; height: 100px; position: relative; z-index: 3; } .box2{ position: absolute; background-color: red; width: 200px; height: 100px; left: 30%; top: 20px; z-index: 2; } .box3{ background-color: yellow; width: 500px; height: 100px; z-index: 1; } <div class="box1"> <div class="box2"></div> </div> <div class="box3"></div> I want to position the red rectangle to be under

z-index issues with jQuery Tabs, Superfish Menu

拈花ヽ惹草 提交于 2019-12-13 16:05:30
问题 For the life of me I cannot get my Superfish menu to stop hiding behind my jQuery UI tabs in IE 7. I have read the documentation out there, have tried changing z-index values and tried the bgIframe plugin, although I am not sure if I am implementing it correctly (left out in my example below, using Supersubs). Here is the Javascript I am using for Superfish - using the Supersubs plugin: $(document).ready(function() { $("ul.sf-menu").supersubs({ minWidth: 12, // minimum width of sub-menus in