我嶄新的這個編碼的東西,所以請去容易對我。)如何拉伸頂部導航至適合頁面寬度集裝箱
我努力讓自己在這個網站舒展的頂部導航,以適應我所理解的是寬度爲900px的網站「容器」的寬度。我不能爲我的生活刪除似乎是填充或頁邊空白的左側和右側。見下面的代碼。
網站截圖在這裏:http://img560.imageshack.us/img560/9479/237c.png
現在我只是巧妙地作出調整,填充,使有些在頁面上居中的資產淨值,但最終它看起來好多了,如果它的邊緣巧遇遏制者就像其他一切。
Thx尋求幫助。
/* Navigation
--------------------------------------------------------------------------------*/
#topnav {
clear: both;
margin: 0 0;
overflow: hidden;
}
#topnav ul {
list-style: none;
float: left;
text-align: center;
}
#topnav ul li {
list-style: none;
float: left;
background: url(nav-sep.png) right 0px no-repeat;
padding: 15px 0px 12px 0px;
display: inline block;
}
#topnav ul > li:last-child,
#topnav ul > span:last-child li {
background: none;
padding-right: 0;
}
#topnav a {
float: left;
display: block;
color: #545454;
font-family: Blair, sans-serif;
font-weight: 500;
padding: 6px 0 6px;
border: 0;
border-top: 3px solid transparent;
outline: 0;
margin: 0 16.6px;
list-style-type: none;
font-size: .75em;
text-transform: uppercase;
}
#topnav ul > li:last-child a,
#topnav ul > span:last-child li a {
margin-right: 0;
}
#topnav li#active a,
#topnav a:hover {
color: #666666;
border: 0;
border-top: 3px solid #8cc640;
}
怎麼回合一些HTML和的jsfiddle:http://jsfiddle.net? –
您可以添加一些HTML來向我們展示您的頁面結構嗎?更好的是,建立一個小提琴(http://jsfiddle.net) – zsaat14