请在此处查看此页面:
http://www.blakearchive.org/blake/public/exhibits/canterburySpecial.html http://www.blakearchive.org/blake/public/exhibits/canterburySpecial.html
菜单栏应该位于文本上方,右侧的红色和黑色图库菜单应该位于菜单栏和文本上方。
我已将右列(文本所在的位置)和菜单栏的 z 索引设置为 1,将红色和黑色图库菜单的 z 索引设置为 -1。但 div 仍然彼此相邻,而不是像他们应该的那样彼此重叠。
相关的CSS在这里:
#menu {
width: 100%;
float: left;
border-top: 5px solid #823
z-index: 1;
}
#columns .right {
float: right;
width: 28%;
height: 90%;
overflow-y: auto;
padding-right: 3%;
padding-left: 1%;
padding-top: 1%;
text-align: justify;
z-index: 1;
}
#menubar {
float: right;
width: 18%;
padding-right: 3%;
padding-left: 1%;
z-index: -1;
}
z-index适用于定位元素 http://www.w3.org/TR/CSS21/visuren.html#z-index.
定位元素是defined http://www.w3.org/TR/CSS21/visuren.html#positioned-element作为元素position
财产的价值不是static
.
static
是默认值。
您尚未申请其他position
对您的任何元素的价值。
你可能想要position: relative;
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)