我想把桌子设置成全高和宽
16lz
2021-01-22
Okay so I want to set the table to full height and width I mean I want it to be full screen and I really don't know what is wrong. The width it's okay, it is to full size but something is wrong with the height.
好的,所以我想将表格设置为全高和宽度我的意思是我希望它是全屏的,我真的不知道出了什么问题。宽度没关系,它是全尺寸但高度有问题。
<!DOCTYPE html>
<html>
<head>
<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
<title>Beta design</title>
<style type="text/css">
.tg {border-collapse:collapse;border-spacing:0;}
.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}
</style>
</head>
<body>
<div id="login">
<img src="login.png" alt="Login"s>
</div>
<table class="tg">
<tr>
<td class="tg-031e"></td>
<td class="tg-031e"></td>
<td class="tg-031e"><td>
</tr>
<tr>
<td class="tg-031e"></td>
<td class="tg-031e"></td>
<td class="tg-031e"></td>
</tr>
<tr>
<td class="tg-031e"></td>
<td class="tg-031e"></td>
<td class="tg-031e"></td>
</tr>
</table>
</body>
</html>
and the css:
和CSS:
body {
background-image: url("wallpaper 2 final.png")
}
#login {
position: fixed;
top: 50%;
left: 50%;
height: 400px;
width: 360px;
margin-top: -200px;
margin-left: -180px;
}
.tg {
height: 100%;
width: 100%;
}
1 个解决方案
#1
2
Give this to the top of the CSS:
将它放在CSS的顶部:
html, body {width: 100%; height: 100%;}
更多相关文章
- 保持子div的宽高比与父级的高度和宽度变化
- 填充HTML表格列,两个边框?
- 网站开发进阶(二十五)js如何将html表格导出为excel文件
- 如何在窗体上布局文本和输入以适应特定的宽度?
- 100%高度分区内显示:表格单元分区
- html 防止表格或div被撑开
- 怎样把Excel表格转换成html网页格式输出?急!!
- 当内容宽度为自动时,隐藏滚动条(仍然能够滚动)不起作用
- HTML之表格篇——表格的嵌套