我想在 CCS3 / HTLM5 中得到这个
| Header .... |
=====Blue bar| Navbar. Menu1. Menu2 ... |Blue bar========
| Website leftSide and content |
| Footer |
菜单和内容一样居中。问题是菜单右侧和左侧的 2 个“蓝条”。我不知道如何在 CSS 中绘制它们。它们应该与导航栏的高度相同。
这是HTML:
<div id="wrapper">
<header id="header">
Image + Login
<br /><br /><br />
<div id="nav">
<ul id="nav">
<li id="nav-accueil"><a href="#">Accueil</a></li>
<li id="nav-coursATelecharger"><a href="#">Cours</a></li>
<li id="nav-coursPrives"><a href="#">Cours</a></li>
<li id="nav-coursEnGroupe"><a href="#">Cours</a></li>
<li id="nav-contact"><a href="#">Contact</a></li>
</ul>
</div>
</header><!-- #header-->
<section id="middle">
<div id="container">
<div id="content">
</div><!-- #content-->
</div><!-- #container-->
<aside id="sideLeft">
</aside><!-- #sideLeft -->
</section><!-- #middle-->
<footer id="footer">
</footer><!-- #footer -->
</div><!-- #wrapper -->
这是CSS:
header, nav, section, article, aside, footer {
display: block;
}
body {
width: 100%;
}
#wrapper {
width: 960px;
margin: 0 auto;
}
/* Header
-----------------------------------------------------------------------------*/
#header {
height: 100px;
}
/* Middle
-----------------------------------------------------------------------------*/
#middle {
width: 100%;
height: 1%;
position: relative;
}
#middle:after {
content: '';
clear: both;
display: table;
}
#container {
width: 100%;
float: left;
overflow: hidden;
}
#content {
padding: 0 0 0 200px;
}
/* Sidebar Left
-----------------------------------------------------------------------------*/
#sideLeft {
float: left;
width: 180px;
margin-left: -100%;
position: relative;
}
/* Footer
-----------------------------------------------------------------------------*/
#footer {
height: 50px;
border-top: 1px dashed #999;
padding-top: 0.4em;
font-size: 0.9em;
color: #888;
}
/* End of Layout */
/* Navigation */
#nav ul {
position: fixed;
top: 50px;
margin:0;
padding:0;
background-color:#ddd;
width:960px;
float:left;
}
#nav li {
display:inline;
padding:0;
margin:0;
}
#nav a:link,
#nav a:visited {
color:#333;
background:#ddd;
padding: 0.4em 0.6em 0.4em 0.6em;
float:left;
width:auto;
border-right:1px solid #fff;
text-decoration:none;
}
#nav a:hover {
color:#fff;
background-color:#888;
}
#nav li:first-child a {
}
/* End of navigation*/
如何让我的 960px 网站完全居中并在菜单旁边有 2 个“蓝条”?
感谢您的阅读和愉快的编码!