我有一个个人网页,其中我的所有内容都被加载到一个表格中,其中背景色设置在页面中间,而实际背景是图像。表中有足够的内容,我无法在窗口视图中完全适应所有内容而不滚动,但我的滚动条没有显示出来。我想向下滚动页面,但它不会让我。我尝试在html标签中扩展文档的高度,但是只是向下滚动背景图像,它不会向下滚动表格。有什么建议吗?
无论我走到哪里,都会有一些关于设置样式溢出的建议:自动或某种设置,但这种做法永远不会有效。这是HTML和CSS
<body style="background-image:url(assets/images/bckg1.jpg); background-
position:center; background-repeat:repeat;">
<br />
<div style="overflow:auto; position:fixed; display:block;">
<table id="scrollable-table" class="main-content" border="3" cellspacing="0" cellpadding="20">`
html {
margin: 0;
padding: 0;
}
body {
overflow:hidden;
font: 75% georgia, sans-serif;
line-height: 1.88889;
color: #555753;
margin: 0;
padding: 0;
}
.main-content {
position: fixed;
left:25%;
right:25%;
width:50%;
background: #D2F0FF;
border-left:groove;
border-right:groove;
border-color:#0066FF;
}
#scrollable-table, tbody{
display:block;
overflow-y:auto;
/* position:fixed;*/
}
有一个简单的解决方案吗?也许是js或jquery解决方案?
答案 0 :(得分:0)
如果你要添加&#34;身高&#34; #scrollable-table - 你可以滚动。
#scrollable-table, tbody{
height: 100%;
display:block;
overflow-y:auto;
/* position:fixed; */
}