大家好我是新的編碼,我需要在我的導航欄上有一點幫助 我用我的css「white-space:nowrap;」以避免包裝在我的導航欄上,當我滾動到右後,在我的縮放頁面上的背景顏色被削減nav的背景顏色切換時變焦
你能幫我把背景顏色完整地向右?歡迎您致電 或諮詢! 謝謝
我的HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Conférence des directeurs des écoles doctorales de droit</title>
<link rel="stylesheet" href="css/master.css">
</head>
<body>
<nav><ul>
<li><a href="#">Présentation</li>
<li><a href="#">Liste des ED</li>
<li><a href="#">Documents</li>
<li><a href="#">Liens</li>
<li><a href="#">Infomations/IP</li>
<li><input id=search-button type="submit" name="search_button">
<input id=search-box type="text" name="search_box" placeholder="Rechercher..."></li>
</ul></nav>
</body>
</html>
我的CSS
@font-face {
font-family: "Quicksand Light Regular";
src: url('quicksand_light-webfont.woff');
}
nav {
position: absolute;
background-color: darkred;
top: 0;
right: 0;
left: 0;
white-space: nowrap;
text-align: center;
max-width: 100%;
zoom: 1;
}
nav li {
font-family: "Quicksand Light Regular";
font-weight: bold;
display: inline-block;
margin-right: 45px;
}
a {
color: white;
text-decoration: none;
}
將'nav'下的'max-width'增加到'100%'以補償'nav增加的'45px right-margin' li' – mike510a
也可能需要嘗試使用'overflow' css屬性 – mike510a
我把'max-width:330%;'同樣的問題,但是當我添加'overflow:auto;' 它工作,但滾動條正好在導航欄,而不是在頁面的底部 – Cornos