我是编码网页的新手,在某些屏幕上显示完整的垂直菜单时遇到了一些困难。菜单设计为在内容可以滚动时保持固定,这在垂直分辨率较低的设备上造成了困难:它们无法滚动以查看所有可用的菜单选项。解决这个问题的合理方法是什么?下面给出了一些最小的代码(带有更多的菜单选项)来说明问题。
任何关于可能改进的额外评论都将受到欢迎。目的是使该网页可在多种设备(台式机、平板电脑、电话等)上使用。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>title</title>
<style type="text/css">
body, html{
margin: 0;
padding: 0;
background: #c0c0c0;
color: #000000;
font-size: 15px;
line-height: 1.5;
text-align: justify;
}
h1 {
margin: 0;
}
h2 {
margin: 0;
}
a:link {
color: #cb4c2f;
text-decoration: none;
}
a:visited {
color: #cb4c2f;
}
a:active, a:hover {
color: #b60a00;
}
#line_1 {
size: 500px;
border-top: 1px solid #000000;
}
#line_2 {
size: 500px;
border-top: 1px solid #c0c0c0;
}
.button_1 {
width: 100px;
height: 100px;
background-color: #c0c0c0;
border: 1px solid #c0c0c0;
display: inline-block;
color: #000000;
font-size: 10px;
text-align: left;
white-space: normal;
font-weight: bold;
padding: 10px 10px;
text-decoration: none;
text-shadow: 0px 0px 0px #c0c0c0;
}
.button_1:hover {
color: #c0c0c0;
background-color: #000000;
border: 1px solid #000000;
}
.button_1:active {
position: relative;
top: 0px;
background-color: #c0c0c0;
border: 1px solid #c0c0c0;
color: #000000;
}
#wrap_1 {
width: 600px;
margin: 0 auto;
background: #5c5c5c;
}
#header_1 {
padding: 5px 10px;
background: #dddddd;
border-top: 1px solid #5c5c5c;
border-bottom: 1px solid #5c5c5c;
}
#main_1 {
float: right;
width: 450px;
padding: 10px;
background: #dddddd;
min-height: 744px;
}
#sidebar_1 {
position: fixed;
float: left;
width: 130px;
padding: 0px;
background: #5c5c5c;
text-align: center;
}
#footer_1 {
clear: both;
padding: 5px 10px;
background: #dddddd;
border-top: 1px solid #5c5c5c;
border-bottom: 1px solid #5c5c5c;
}
</style>
</head>
<body>
<div id="wrap_1">
<div id="header_1"><h1>TITLE</h1></div>
<div id="main_1">
content
</div>
<div id="sidebar_1">
<br>
<input value="HOME" onclick="location.href='index.html';" type="button" class="button_1"><br><br>
<input value="RESOURCES" onclick="location.href='resources.html';" type="button" class="button_1"><br><br>
<input value="LABORATORY NOTEBOOK" onclick="location.href='laboratory_notebook.html';" type="button" class="button_1"><br><br>
<input value="WEBLOG" onclick="location.href='weblog.html';" type="button" class="button_1"><br><br>
<input value="PUBLICATIONS" onclick="location.href='publications.html';" type="button" class="button_1"><br><br>
<input value="LINKS" onclick="location.href='links.html';" type="button" class="button_1"><br><br>
<input value="ANOTHER LINK" onclick="location.href='links.html';" type="button" class="button_1"><br><br>
<input value="ANOTHER LINK" onclick="location.href='links.html';" type="button" class="button_1"><br><br>
<input value="ANOTHER LINK" onclick="location.href='links.html';" type="button" class="button_1"><br><br>
<hr class="line_2" border=0 size=0>
</div>
<div id="footer_1">
</div>
</div>
</body>
</html>