这是我的代码:CSS:在导航栏上另一个按钮
CSS
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
position: fixed;
top: 0;
width: 100%;
}
li {
float: left;
}
li a{
display:block;
color: white;
text-align: center;
padding: 14px 50px;
text-decoration: none;
}
li a:hover:not(.active) {
background-color: #111;
}
.active {
background-color: #111;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-weight: 300;
}
body {
background: dimgrey;
font-family: 'Gill Sans MT', sans-serif;
color: white;
font-weight: 300;
}
body ::-webkit-input-placeholder {
font-family: 'Gill Sans MT', sans-serif;
color: white;
font-weight: 300;
}
body :-moz-placeholder {
font-family: 'Gill Sans MT', sans-serif;
color: white;
opacity: 1;
font-weight: 300;
}
body ::-moz-placeholder {
font-family: 'Gill Sans MT', sans-serif;
color: white;
opacity: 1;
font-weight: 300;
}
body :-ms-input-placeholder {
font-family: 'Gill Sans MT', sans-serif;
color: white;
font-weight: 300;
}
HTML
<body>
<ul>
<li><a href="home.html" target="_parent">Home</a></li>
<li><a class="active" href="log-in.html" target="_parent">Sign In/Sign Up</a></li>
<li><a href="#about">About</a></li>
<li><a href="#order">Order</a></li>
<li><a href="movies.html" target="_parent">More Movies</a></li>
<li><a href="contact.html" target="_parent">Contact</a></li>
</ul>
</body>
我想补充另一个按钮具有不同background-color
并且可能会被放置在与其他按钮分开的正确的一侧。我不知道如何将它与其他按钮分开,所以我只是尝试改变它的背景。我尝试制作另一个类,因为另一个按钮不可点击,仅用于显示,也没有悬停效果。但它仍然行不通。你能给我一些建议吗?
你可能privide一个feedle,所以我们可以直接采取行动? – holden