(目前还没有答案,请继续回答)
http://gyazo.com/952d354b05e4a4a4cef08e74f8b0253d
http://gyazo.com/e8cc5ae0bcd0464eb074c4674d2896fb
正如你从这些图片中看到的,我已经为我的网站创建了导航栏,但是我的网站太宽了,这意味着你必须滚动才能到达它的末尾,我将如何更改宽度以便它只上升到导航栏结束?
这就是我使用的导航栏的所有 CSS:
#title {
position:relative;
margin:17px 1680px 30px 15px;
}
#banner {
border:1px solid #4A4A4A;
width:1903;
height:110;
background-color:#4A4A4A;
margin-left:0px;
position:absolute;
top:-10px;
border-radius:15px;
}
#navbar {
position:fixed;
left:50%;
margin-top:2px;
}
ul {
list-style-type:none;
margin:-115px;
}
li {
display:inline;
padding:9px;
border:4px solid;
font-family:Bebas;
font-size:25px;
font-weight:bold;
color:#FFFFFF;
border-radius:10px;
background-color:#000000;
margin-left:2.5em;
}
这也是我的 HTML 代码:
<html>
<head>
<link type="text/css" rel="stylesheet" href="todd.css"/>
<title>Home</title>
</head>
<body bgcolor="#ABABAB">
<div>
<div id="banner">
<a href="file:///C:/Users/Todd/Desktop/todd.html"><img src="file:///C:/Users/Todd/Desktop/Todd.png" id="title"></a>
<div id="navbar">
<ul>
<a href="file:///C:/Users/Todd/Desktop/todd.html"><li>Home</li></a>
<li>Not Finished</li>
<li>Not Finished</li>
<li>Not Finished</li>
<ul>
</div>
</img>
</div>
</div>
</body>
</html>