简体   繁体   English

z-index在css中不起作用

[英]z-index is not working in css

Hello everyone. 大家好。 I have designed a website in which I have a fixed header. 我设计了一个网站,我有一个固定的标题。 The website is basically for a DJ. 该网站基本上是一个DJ。 I have developed this website in ASP.net. 我在ASP.net开发了这个网站。 I am having some problems with this website. 我在这个网站遇到了一些问题。 I fixed the header but the other content is now appearing in front of the header, instead of behind it. 我修复了标题,但其他内容现在出现在标题的前面,而不是在标题后面。 Please see the website below for how it currently appears. 请参阅下面的网站了解它目前的状态。

http://www.spin69.com/Default.aspx http://www.spin69.com/Default.aspx

I use z-index in css but it did not work. 我在css中使用z-index但它没有用。 Could you please tell me what I have to do to fix this and where my css is wrong. 你能告诉我我要做些什么来解决这个问题以及我的css错误的地方。 I am basically a developer. 我基本上是一名开发人员。 I designed this website using a website template which I downloaded from the internet. 我使用从互联网上下载的网站模板设计了这个网站。

Change header height to 180px (or decrease h1 height) and give header a z-index:100; header高度更改为180px (或减小h1高度)并为header指定z-index:100; .

EDIT: The only reason I've used z-index:100; 编辑:我使用z-index:100;的唯一原因z-index:100; is because you've said that you used a website template, which could have already used some z-index styles, so I'm guessing 100 would put it on top. 是因为你曾经说过你使用过一个网站模板,它可能已经使用了一些z-index样式,所以我猜100会把它放在首位。

set h1's z-index:100; 设置h1的z-index:100; or anything above 3 或任何超过3的东西

the header has no z-index defined at the moment 标题目前没有定义z-index

请使用position z-index

Add Z-index to header 将Z-index添加到标头

header {
background-color: #000000;
height: 160px;
left: 0;
position: fixed;
top: 0;
width: 100%;
z-index: 99999;

} }

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

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