我目前正在开发一个网站,并且我正在尝试进行更多的 CSS 编码,我已经完成了导航的基本 CSS。虽然我现在要做的是制作子菜单,但是当您滚动其中一个按钮时,菜单就会出现。
这是我当前的 Css:HTML 代码:
/*Naviagtion Bar Css */
ul {
margin: 0;
padding: 0;
list-style:none;
}
li {
padding-top:5px;
color: #FFF;
width:120px;
float: left;
margin: 0;
padding: 0;
}
li a {
display: block;
width: 120px;
height: 30px;
padding-top:20px;
}
#homepage a {
background-image: url(../images/Button_NavBar_Unselected.png);
background-repeat: no-repeat;
}
#homepage_current a {
background-image: url(../images/Button_NavBar_CurrentPage.png);
background-repeat: no-repeat;
}
#homepage a:hover {
background-image: url(../images/Button_NavBar_Hover.png);
background-repeat: no-repeat;
}
#guide a {
background-image: url(../images/Button_NavBar_Unselected.png);
background-repeat: no-repeat;
}
#guide_current a {
background-image: url(../images/Button_NavBar_CurrentPage.png);
background-repeat: no-repeat;
}
#guide a:hover {
background-image: url(../images/Button_NavBar_Hover.png);
background-repeat: no-repeat;
}
#blog a {
background-image: url(../images/Button_NavBar_Unselected.png);
background-repeat: no-repeat;
}
#blog_current a {
background-image: url(../images/Button_NavBar_CurrentPage.png);
background-repeat: no-repeat;
}
#blog a:hover {
background-image: url(../images/Button_NavBar_Hover.png);
background-repeat: no-repeat;
}
#media a {
background-image: url(../images/Button_NavBar_Unselected.png);
background-repeat: no-repeat;
}
#media_current a {
background-image: url(../images/Button_NavBar_CurrentPage.png);
background-repeat: no-repeat;
}
#media a:hover {
background-image: url(../images/Button_NavBar_Hover.png);
background-repeat: no-repeat;
}
#forum a {
background-image: url(../images/Button_NavBar_Unselected.png);
background-repeat: no-repeat;
}
#forum_current a {
background-image: url(../images/Button_NavBar_CurrentPage.png);
background-repeat: no-repeat;
}
#forum a:hover {
background-image: url(../images/Button_NavBar_Hover.png);
background-repeat: no-repeat;
}
#navbar {
position:relative;
top:5px;
float:left;
margin-top:30px;
margin-left:45px;
width:600px;
height: 50px;
z-index:-1;
}
html代码:
<div id="navbar" style="display: inline-block;">
<ul>
<li id="homepage_current"><a><strong>Home</strong></a></li>
<li id="guide"><a><strong>Guide</strong></a>
<ul>
<li> Sub Menu 1 </li>
<li> Sub Menu 2 </li>
<li> Sub Menu 3 </li>
</ul>
</li>
<li id="blog"><a><strong>Blog</strong></a></li>
<li id="media"><a><strong>Media</strong></a></li>
<li id="forum"><a><strong>Forums</strong></a></li>
</ul>
</div>
任何帮助,将不胜感激。这是该页面的链接。