gpt4 book ai didi

html - Div 未填充高度

转载 作者:行者123 更新时间:2023-11-28 13:33:52 25 4
gpt4 key购买 nike

帮助一名学生完成他的元素,试图让他的 Div 填满整个页面。

我已经尝试按照将 HTML 和 BODY 标记设置为 100% 的各种示例进行操作,但是当我为我的 Div 设置最小高度时,它不会填充页面的完整高度。这是我的代码。当它呈现绿色时,应该填满页面,但事实并非如此。

谢谢 KT

<html>
<center>
<head>

<link href="styles.css" rel="stylesheet" type="text/css"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>

<div class="tblwrap" height="100%">
<table class="scndtable" >
<tr class="headerrow">
<td height=100%><a href="summary.html">Summary</a> </td>
<td><a href="map.html">Map</a> </td>
<td><a href="videos.html">Videos</a> </td>
</tr>
</table>
</div>
<p style="font-weight: bold;text-align: center;"> </p>

</body>
</center>

这是我的 CSS

html
{
height:100%;
}
body
{
margin:0;
padding:0;


vertical-align: middle;
height: 100%;
border: 20px solid skyblue;
}
body table
{
margin-left:auto;
margin-right:auto;
height:100%;

}
.tblwrap
{
background-color:green;
min-height: 100%;

vertical-align: middle;
border:solid 3px red;
}
.headerrow{
text-align: center;

}
.scndtable
{
border-spacing:20px;
height: 100%;

}
.headerrow td{
font-size: 20pt;


background-color:silver;

}
.headerrow td a{
text-decoration: none;
color: black;
}
.headerrow td a:hover{
text-decoration: none;
color: gray;
}
.selectednav
{
font-size: 72px;
font-weight: bold;
color:navy;
}

最佳答案

  .tblwrap{position:absolute;
top:0px;
left:0px;
right:0px;
bottom:0px;
background-color:green;
vertical-align: middle;
border:solid 3px red;
oveflow:auto;
}

这对你有用:-)

关于html - Div 未填充高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10546470/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com