私は次のことをしようとしています。ポートフォリオボタンをクリックするとサブメニューが表示されているので、PORTFOLIO
http://jsfiddle.net/kuuwj/25/をクリックします。しかし、問題がわかるように色を変更しました。ABOUT ME
問題は、同じマージンを維持するために次のボタンが展開され、portfolio-apps
クラスと重複することです。だから私はこれを修正したいと思います。about me
同じマージンを持ちますが、最後section
からportfolio-apps
CSS
#navbar {
list-style: none;
z-index: 9;
width: 255px;
display: block;
margin-top: 20px;
margin-bottom: 20px;
background: #ccc;
}
#navbar a {
text-decoration: none; /* removes underline for links */
text-transform: uppercase;
font-size: 16px;
display: block;
background: #fff; /* for webbrowsers that does not support CSS3 */
background: rgba(255,255,255,0.9);
line-height: 50px; /* specifies the line height */
padding: 0px 20px;
color: rgb(68,68,68);
}
#navbar a:hover { /* Select a style of a link when the mouse over it */
background: #bbb;
}
#navbar li {
margin-bottom: 6px;
}
.button {
position: relative;
display: block;
float: left;
line-height: 35px;
left: 75px;
padding-right: 10px;
text-align: right;
font-size: 16px;
}
span {
background: #EEE;
}
HTML
<ul id="navbar">
<li><a href="#home" id="nav-home">Home</a></li>
<li><a href="#portfolio" id="nav-portfolio">Portfolio</a>
<div class="portfolio-apps">
<section id="website">
<span class="button">AAAAAAAAAAAAAAAAAAAAAA</span>
</section>
<section id="gterminal">
<span class="button">BBBBBBBBBBBBBBBBBBBBBB</span>
</section>
<section>
<span class="button">CCCCCCCCCCCCCCCCCCCCCC</span>
</section>
</div>
</li>
<li><a href="#about" id="nav-about">About Me</a></li>
<li><a href="#contact" id="nav-contact">Contact</a></li>
</ul>