这已经让我死了好几个小时:'(谁能帮我把标志和导航栏放在标题里面???
我试图将“徽标”放在标题内(左侧)和“导航栏”内(右侧),但即使我尝试了许多不同的属性,我的导航栏总是在标题容器之外.. . 标题应该是固定的。
<header>
<a href="#" id="logo">Logo</a>
<ul id="nav" class="nav">
<li><a href="#home">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#services">Services</a></li>
<li><a href="#portfolio">Portfolio</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</header>
<link href='http://fonts.googleapis.com/css?family=Roboto+Slab:400,700' rel='stylesheet' type='text/css'>
html, body{
margin:0px; padding:0px; height: 100%; }
section {
height: 100%;
}
header{
z-index: 1;
position:fixed;
width:100%;
background:rgba(0,0,0,0.1);
}
header ul{
float:right;
}
header ul li{
display: inline;
float:left;
}
header a{
color:white;
background:rgba(0,0,0,0.1);
display:inline-block;
padding:0px 30px;
height:60px;
line-height:60px;
text-align:center;
font-family: 'Roboto Slab', serif;
text-decoration:none;
text-transform:uppercase;
letter-spacing:2px;
font-weight:700;
}