gpt4 book ai didi

css - 如何将导航菜单重叠在幻灯片图像上

转载 作者:行者123 更新时间:2023-11-28 06:56:52 26 4
gpt4 key购买 nike

我正在尝试使用绝对位置使菜单列表与幻灯片图像重叠,但无法解决。

当我尝试更改位置时,菜单变得困惑。幻灯片图像是相对的,菜单列表是绝对的。

<!DOCTYPE html>
<head>

<title>Quantum PC Shop</title>
<link rel="stylesheet" type="text/css" href="QuantumPCShop.css">




<link rel="stylesheet" type="text/css" href="MangaPage.css">
<script src="jquery-2.1.4.min.js"></script>
<link href="owl.carousel.css" rel="stylesheet">
<link href="owl.theme.css" rel="stylesheet">

</head>

<body>



<!--<<<<<<<<< Nav Menu >>>>>>>>>>-->

<center>
<div class="BodyNav2">
<div class="Menu">
<ul id="css3menu_middle">
<li>New Arrival
<ul><li>HDD</li>
<li>Purchase History</li>
<li>Messages</li>
<li>Wish List</li>
</ul></li>
</ul>
<ul id="css3menu_middle">
<li>Motherboard
<ul><li>Summary</li>
<li>Purchase History</li>
<li>Messages</li>
<li>Wish List</li>
</ul></li>
</ul>
<ul id="css3menu_middle">
<li>Hard Disk
<ul><li>Summary</li>
<li>Purchase History</li>
<li>Messages</li>
<li>Wish List</li>
</ul></li>
</ul>
<ul id="css3menu_middle">
<li>Graphic Card
<ul><li>Summary</li>
<li>Purchase History</li>
<li>Messages</li>
<li>Wish List</li>
</ul></li>
</ul>
<ul id="css3menu_middle">
<li>CPU
<ul><li>Summary</li>
<li>Purchase History</li>
<li>Messages</li>
<li>Wish List</li>
</ul></li>
</ul>
<ul id="css3menu_middle">
<li>PSU
<ul><li>Summary</li>
<li>Purchase History</li>
<li>Messages</li>
<li>Wish List</li>
</ul></li>
</ul>
<ul id="css3menu_middle">
<li>Cooling System
<ul><li>Summary</li>
<li>Purchase History</li>
<li>Messages</li>
<li>Wish List</li>
</ul></li>
</ul>

</div>
</div>
<center>


<div class="bodyContentSlide"><br>



<div id="owl-demo" class="owl-carousel">

<div class="item"><img src="Style1.jpg" alt="The Last of us"></div>
<div class="item"><img src="Style2.jpg" alt="GTA V"></div>
<div class="item"><img src="Style3.jpg" alt="Mirror Edge"></div>
<div class="item"><img src="Style4.gif" alt="The Last of us"></div>
<div class="item"><img src="Style5.jpg" alt="GTA V"></div>



</div>


<script src="owl.carousel.js"></script>

<style>
#owl-demo .item img{
display: block;
width: 100%;
height: auto;

}
</style>


<script>
$(document).ready(function() {
$("#owl-demo").owlCarousel({

navigation : true,
slideSpeed : 300,
paginationSpeed : 400,
singleItem : true

});
});
</script>



</div>

</body>
</htmL>

div.headerArea {
margin-top: -70px;
height:10px;

}

div.HearderAfterBorder{
display: inline-block;
margin-left:-20px;
padding-top: 50px;
}


body {
font-family: 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, sans-serif;
/*padding: 20px 50px 150px;*/
font-size: 13px;
text-align: center;
/*margin-left:-1000px;*/
//background: url(wallAbstrack.jpg);
background-color: #f9f9f9;
text-shadow: 0 -1px 0 #000;

}




ul#css3menu_middle{
text-align: center;
display: inline;
margin: 0;
padding: 15px 4px 7px 0;
list-style: none;
-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
-moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);


}

.sub1{
position: absolute;
}

ul#css3menu_middle li {
font: bold 12px/18px sans-serif;
display: inline-block;
margin-right: -4px;
position: relative;
padding: 15px 54px;
background: #EBFFD6;
cursor: pointer;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
-ms-transition: all 0.2s;
-o-transition: all 0.2s;
transition: all 0.2s;
height: 7px;
top:0px;
}

ul#css3menu_middle li:hover {
background: #555;
color: #fff;

}
ul#css3menu_middle li ul {
padding: 0;
position: absolute;
top: 38px;
left: 0;
width: 173px;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
display: none;
opacity: 0;
visibility: hidden;
-webkit-transiton: opacity 0.2s;
-moz-transition: opacity 0.2s;
-ms-transition: opacity 0.2s;
-o-transition: opacity 0.2s;
-transition: opacity 0.2s;

}
ul#css3menu_middle li ul li {
background: #555;
display: block;
color: #fff;
text-shadow: 0 -1px 0 #000;

}
ul#css3menu_middle li ul li:hover { background: #666; }
ul#css3menu_middle li:hover ul {
display: block;
opacity: 1;
visibility: visible;

}


/*<<<<<<<<<<<<<<<<<<<<<< Body Content Slide >>>>>>>>>>>>>>>>>>>> */

div.BodyNav2{

}
div.bodyContentSlide{
height:500px;
border: 0px solid;
width:95%;
align-content: center;
}

Download full code/files(TestSlid)

最佳答案

我终于得到了答案。我们需要 z-index 使菜单重叠幻灯片。使用绝对位置将仅重叠图像而不重叠 slideShow js。

示例:

#cssmenu, #cssmenu ul {
line-height: 1;
list-style: none outside none;
padding: 0;
z-index: 1000;
}

关于css - 如何将导航菜单重叠在幻灯片图像上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33463500/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com