如何更改CSS代码,使左边的徽标(#logo)显示在所有其他div上?高z值指数值不会改变位置:/例如,当您点击" Salon"并滚动,图片和文字在徽标上滚动,而不是在徽标下方。
这是链接: http://hosting2022.esy.es/
/* HEADER WITH LOGO */
header {
width:100%;
position: fixed;
top: 0px;
z-index:2000;
height: 80px;
}
#header-wrapper {
width: 1280px;
margin: 0 auto;
z-index:9999;
height:80px;
line-height:80px;
position:relative;
}
#logo {
margin:20px 0;
height:40px;
width:auto;
float:left;
}
/* MAIN DIV WITH MENU AND CONTENT-DIV*/
#mainx {
padding: 0 0 0 0 !important;
margin: 0 !important;
border: 0 !important;
position: fixed;
z-index: 11000;
}
/* THE MENU DIV */
#menuxx {
line-height:50%;
z-index:21000;
top:35px;
right:105px;
width:450px;
height:70px;
position:fixed;
}
/*CONTENT DIV -> Should be placed under the logo and menu*/
#Salon {
top:0;
margin-left: auto;
margin-right: auto;
width: 100%;
height:100%;
position:fixed;
overflow:hidden;
}
答案 0 :(得分:1)
将此css添加到您的风格
#content {
position: relative;
z-index: 100;
}
答案 1 :(得分:0)
只需将其添加到您的样式(.mainx上的z-index减少)
.mainx {
z-index: 2500;
}
您指定的当前解决方案无效:
#logo {
z-index: 3000;
}
和
.mainx {
z-index: 11000;
}
答案 2 :(得分:0)
应用于 #logo 元素的 z-index 将无效,因为它应该具有 relative 的位置,已修复或绝对位置。
答案 3 :(得分:0)
为SELECT m.*
FROM (SELECT m.*,
(CASE WHEN sender_id < recipient_id
THEN (sender_id, recipient_id)
ELSE (recipient_id, sender_id)
END) AS pair,
ROW_NUMBER() OVER (PARTITION BY (CASE WHEN sender_id < recipient_id
THEN (sender_id, recipient_id)
ELSE (recipient_id, sender_id)
END)
ORDER BY created_at, unread_count DESC
) as seqnum,
SUM(CASE WHEN m.opened = false THEN 0 ELSE 1 END) OVER
(PARTITION BY (CASE WHEN sender_id < recipient_id
THEN (sender_id, recipient_id)
ELSE (recipient_id, sender_id)
END)
) as NumUnopened
FROM "messages" m
WHERE ((recipient_id = 6 and recipient_delete = false) or
(sender_id = 6 and sender_delete = false))
) t
WHERE seqnum = 1;
代码添加样式
<header>
这是照顾它的方式..