gpt4 book ai didi

html - 导航栏中的下拉列表

转载 作者:行者123 更新时间:2023-11-28 09:00:13 25 4
gpt4 key购买 nike

我想让我的“我的诗”和“来自互联网的诗”下拉列表进入“关于”选项下的“诗”部分。但是现在那里有问题。这个下拉列表在“关于”下拉列表的后面,我想把它移到左边的下一个“诗歌”选项(我尝试使用 margin-left:250px)但它没有用。我还希望每当有人将鼠标悬停在“诗歌”部分时,“来自互联网的诗歌”和“来 self 的诗歌”就会出现,而不是我将鼠标悬停在“关于”部分上的时间! http://jsfiddle.net/2r1hbr3k/2/embedded/result/ , http://jsfiddle.net/2r1hbr3k/2/

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="shortcut icon" href="Photo.ico">
<link href="StyleSheet.css" rel="stylesheet" />
<link href="animate.css" rel="stylesheet" />
<link href="animations.css" rel="stylesheet" />
<link href="hover.css" rel="stylesheet" />
<link href="gooeymenu.css" rel="stylesheet" />
<link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>
<script src="gooeymenu.js"></script>

<title>Social Activism</title>


</head>
<body>
<div style="background:#F5F5F0;">
<div>
<div style="float:left; margin-top:0; left:20px;"><img class="buzz" src="community-activism.png" width="80" height="80" /></div>
<h1 style="color:black; opacity:40;" class="shrink"><strong>&nbsp;&nbsp;Social Activism</strong></h1>
</div>
<br />

<div id="nav">
<div id="nav_wrapper" style="margin:0 auto; display:inline-block;">

</div>
<div>
<ul class="navigation">
<a class="main" href="#url" style="color:black;" id="blue">Home</a>

</ul>
<ul class="navigation">
<a class="main" href="#url" style="color:black;" id="blue">About &#9660;</a>

<li class="n1" id="selection">

<a href="Poem-From%20Internet.html" id="option">Poems &#9658;</a>
<ul>
<li class="n6">
<a href="#" id="option"> Poem From Internet </a>
</li>
<li class="n7">
<a href="#" id="option"> Poem By Me </a>

</li>
</ul>
</li>
<li class="n2" id="selection">
<a href="#" id="option"> Informational Media </a>

</li>
<li class="n3" id="selection">
<a href="#" id="option"> Visual/Video </a>

</li>
<li class="n4" id="selection">
<a href="#" id="option"> Photo Essay </a>
</li>

<li class="n5" id="selection">
<a href="#" id="option"> Me </a>
</li>
</ul>

<ul class="navigation">
<a class="main" href="#url" style="color:black;" id="blue">From Internet &#9660; </a>

<li class="n1" id="selection">

<a href="Poem-From%20Internet.html" id="option">Poem</a>

</li>
<li class="n2" id="selection">
<a href="#" id="option"> Informational Media </a>

</li>
<li class="n3" id="selection">
<a href="#" id="option"> Visual/Video </a>

</li>
<li class="n4" id="selection">
<a href="#" id="option"> Photo Essay </a>
</li>

</ul>
<ul class="navigation">
<a class="main" href="#url" style="color:black;" id="blue">By Me &#9660;</a>

<li class="n1" id="selection">
<a href="poem%20-%20faraz%20akbari.html" id="option">Poem</a>

</li>
<li class="n2" id="selection">
<a href="#" id="option"> Informational Media </a>

</li>
<li class="n3" id="selection">
<a href="#" id="option"> Visual/Video </a>

</li>
<li class="n4" id="selection">
<a href="#" id="option"> Photo Essay </a>

</li>
</ul>
</div>
</div>
</div>
</body>
</html>

我的 CSS 文件:

body {
background: #DCDCD8;
}
h2 {
text-align: center;
color: #CCC;
}
a {
display: block;
text-decoration: none;
width: 100%;
height: 100%;
color: #999;
}
/* NAVIGATION */
.navigation {
list-style: none;
padding: 0;
width: 250px;
height: 40px;
margin: 0;
background: #F5F5F0;
position: relative;
z-index: 100;
display: inline-block;
vertical-align:top;
left:5px;
top:0px;
}
.navigation, .navigation a.main {
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
}
.navigation:hover, .navigation:hover a.main {
border-radius: 4px 4px 0 0;
-webkit-border-radius: 4px 4px 0 0;
-moz-border-radius: 4px 4px 0 0;
}
.navigation a.main {
height: 40px;
font: bold 15px/40px arial, sans-serif;
text-align: center;
text-decoration: none;
color: #FFF;
-webkit-transition: 0.2s ease-in-out;
-o-transition: 0.2s ease-in-out;
transition: 0.2s ease-in-out;
position: relative;
z-index: 100;
display: inline-block;
}
.navigation li {
width: 250px;
height: 40px;
background: #F7F7F7;
font: normal 14px/40px arial, sans-serif !important;
color: #999;
text-align: center;
margin: 0;
-webkit-transform-origin: 50% 0%;
-o-transform-origin: 50% 0%;
transform-origin: 50% 0%;
-webkit-transform: perspective(350px) rotateX(-90deg);
-o-transform: perspective(350px) rotateX(-90deg);
transform: perspective(350px) rotateX(-90deg);
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.05);
-webkit-box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.05);
-moz-box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.05);
}
.navigation li:nth-child(even) {
background: #F5F5F5;
}
.navigation li:nth-child(odd) {
background: #EFEFEF;
}
.navigation li.n1 {
-webkit-transition: 0.2s linear 0.8s;
-o-transition: 0.2s linear 0.8s;
transition: 0.2s linear 0.8s;
}
.navigation li.n2 {
-webkit-transition: 0.2s linear 0.6s;
-o-transition: 0.2s linear 0.6s;
transition: 0.2s linear 0.6s;
}
.navigation li.n3 {
-webkit-transition: 0.2s linear 0.4s;
-o-transition: 0.2s linear 0.4s;
transition: 0.2s linear 0.4s;
}
.navigation li.n4 {
-webkit-transition: 0.2s linear 0.2s;
-o-transition: 0.2s linear 0.2s;
transition: 0.2s linear 0.2s;
}
.navigation li.n5 {
border-radius: 0px 0px 4px 4px;
-webkit-transition: 0.2s linear 0s;
-o-transition: 0.2s linear 0s;
transition: 0.2s linear 0s;
}
.navigation:hover li {
-webkit-transform: perspective(350px) rotateX(0deg);
-o-transform: perspective(350px) rotateX(0deg);
transform: perspective(350px) rotateX(0deg);
-webkit-transition: 0.2s linear 0s;
-o-transition: 0.2s linear 0s;
transition: 0.2s linear 0s;
}
.navigation:hover .n2 {
-webkit-transition-delay: 0.2s;
-o-transition-delay: 0.2s;
transition-delay: 0.2s;
}
.navigation:hover .n3 {
-webkit-transition-delay: 0.4s;
-o-transition-delay: 0.4s;
transition-delay: 0.4s;
}
.navigation:hover .n4 {
transition-delay: 0.6s;
-o-transition-delay: 0.6s;
transition-delay: 0.6s;
}
.navigation:hover .n5 {
transition-delay: 0.8s;
-o-transition-delay: 0.8s;
transition-delay: 0.8s;
}
#option:hover ,#blue:hover {
color: white;
background-color:#19A3FF;
}
#option:active {
color: white;
background-color:#1c5f8d;
}
#blue:active {
color: white;
background-color: #1c5f8d;
}
#option {
color: black;
}
#blue {
color: black;
}

最佳答案

这是你的意思吗?

.navigation ul {
display: none;
position: relative;
top: -40px;
left: 250px;
list-style-type: none;
margin: 0;
padding: 0;
}
.navigation li:hover ul {
display: block;
}

这是一个 fiddle :http://jsfiddle.net/Niffler/bxuv14Ld/

关于html - 导航栏中的下拉列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26952957/

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