我为我的页面创建了这个 .css 文件:
#content-box, #header-box, #menu-box, #footer-box
{
background-color:#084B8A;
color:#FFFFFF;
}
#content-box
{
display:block;
width:auto;
min-height:205px;
border-radius: 10px;
-moz-border-radius: 10px;
margin:1px;
padding:5px;
}
#menu-box
{
position:fixed;
display:block;
width:auto;
height:205px;
border-radius: 10px;
-moz-border-radius: 10px;
margin:1px;
padding:5px;
}
#footer-box
{
display:block;
width:auto;
height:20px;
border-radius: 10px;
-moz-border-radius: 10px;
margin:0px;
padding:0.5px 5px;
text-align:right;
}
#header-box
{
display:block;
width:auto;
height:20px;
border-radius: 10px;
-moz-border-radius: 10px;
margin:0px;
padding:0.5px 5px;
text-align:left;
}
当我向下/向上滚动页面但不工作时,我想#menu-box 移动。这是页面的排列:
#header-box
---------------------------------------
|#
|c
#menu-box|o
|n
|t
|e
|n
|t
|-
|b
|o
|x
---------------------------------------
#footer-box
在每个 div(#header-box, #menu-box, #content_box, #footer-box) 我添加信息(在 #menu-box 我添加一个 css 垂直下拉菜单)。
编辑:这是我的 HTML 代码,我认为问题出在表格标签上:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="ro">
<head>
<title>...</title>
</head>
<body>
<table border="1" width="100%"><tr><td><div id='header-box'>Bine ai venit
</div></td></tr></table>
<table border="1" width="100%">
<tr><td style="width:200px; height:205px;"><div id='menu-box'><?php include("nav.php"); ?></div></td>
<td><div id='content-box'>
<?php // content ?>
</div></td></tr></table>
<table border="0" width="100%"><tr><td><div id='footer-box'>Creat de ...</div></td></tr></table>
</body>
</html>
(正常边框设置为 0 但现在,因为我设置为 1 我看不到我的#menu-box)
@Andrew:我知道我需要一个长页面,并且我在#content-box 中列出了表格。