所以,我想要发生的是,一旦按下菜单项,网站就会翻转到该页面,但通向该页面的按钮在该页面上保持活动状态,以向用户显示他们在网站上的位置. 到目前为止,我还没有找到一个有效的组合,我希望它可以完全与 css3 一起使用。
html
<div id="navMenu">
<ul id="MenuBar1" class="MenuBarHorizontal">
<li><a href="index.html"> HOME </a></li>
<li><a href="surveying.html">SURVEYING</a></li>
<li><a href="engineering.html">ENGINEERING</a></li>
<li><a href="companyProfile.html">COMPANY PROFILE</a></li>
<li><a href="products.html">PRODUCTS</a></li>
<li><a href="clients.html">CLIENTS</a></li>
<li><a href="contacUs.html">CONTACT US </a></li>
</ul>
</div>
css3
#navMenu {
padding: 0;
margin: 5% 0 0 0;
text-decoration: none;
font-family: arial;
font-size: 16px;
font-weight: normal;
text-decoration: none;
}
#navMenuActive {
position: absolute;
height: 47px;
padding: 0;
background-color: red;
}
#navMenuActiveText {
margin: 16px 0 0 0;
padding: 0;
color: #FFFFFF;
text-decoration: none;
text-align: center;
font-family: arial;
font-size: 16px;
font-weight: normal;
}
ul.MenuBarHorizontal {
width: 100%;
alignment-baseline: central;
margin: 0 0 0 0;
padding: 0;
padding-bottom: 5px;
list-style-type: none;
font-size: 100%;
text-align: center;
cursor: default;
overflow: hidden;
white-space: nowrap;
}
ul.MenuBarHorizontal li {
height: 30px;
display: inline-block;
margin: 18px 0 0 0;
padding: 0;
}
ul.MenuBarHorizontal a:link, ul.MenuBarHorizontal a:visited {
padding:17px 23px 8px 23px;
margin-top: 0px;
margin-left: -.5px;
margin-right: -.5px;
text-align:center;
text-decoration:none;
text-transform:uppercase;
color: #555;
background-image: url(../images/navBar_i.png);
}
ul.MenuBarHorizontal a, ul.MenuBarHorizontal a:hover, ul.MenuBarHorizontal a:active {
color: rgb(255,255,255);
background-image: url(../images/navBar_a.png);
}