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%;}

更多相关文章

  1. 保持子div的宽高比与父级的高度和宽度变化
  2. 填充HTML表格列,两个边框?
  3. 网站开发进阶(二十五)js如何将html表格导出为excel文件
  4. 如何在窗体上布局文本和输入以适应特定的宽度?
  5. 100%高度分区内显示:表格单元分区
  6. html 防止表格或div被撑开
  7. 怎样把Excel表格转换成html网页格式输出?急!!
  8. 当内容宽度为自动时,隐藏滚动条(仍然能够滚动)不起作用
  9. HTML之表格篇——表格的嵌套

随机推荐

  1. ToggleButton
  2. Android 画椭圆
  3. 开发者必看|Android(安卓)8.0 新特性及开
  4. Maven Android Plugin
  5. android颜色代码
  6. 【Android】自定义权限
  7. Android 电量显示Widgets插件实现
  8. android FloatingActionButton
  9. android 调用摄像头
  10. Android(安卓)应用程序不能全屏显示