【发布时间】:2015-10-24 21:34:55
【问题描述】:
我正在尝试将我的网站背景分成两个垂直的项圈。全屏高度和宽度。我在这里做错了什么?希望有人可以提供帮助。问候
我有一个链接到测试页面here
HTML:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>testing fullscreen</title>
<link href="assets/css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
<table id="maintable" border="0" cellspacing="0" cellpadding="0">
<tr>
<td id="table1">How to get this fullscreen height?</td>
<td id="table2">
<div id="logomelonmania">
</div>
<table id="menu-div" >
<tr>
</tr>
</table>
<div id="paragraphtext"></div>
</td>
</tr>
</table>
</div>
</body>
</html>
CSS:
@charset "utf-8";
/* CSS Document */
body {
margin:0px;
}
tablepage {
border-spacing: 0;
border-collapse: collapse;
}
#table1 {
background-color: #88b56d;
width:50%;
height:100%;
}
#table2 {
background-color: #435;
height:100%;
width:50%;
}
#wrapper {
height:100%;
}
#maintable {
height:100%;
width:100%;
}
【问题讨论】:
-
您使用表格是否有原因?该元素用于显示表格数据,而不是用于布局页面(就像我们 10 年前所做的那样)。
-
所以你的意思是我应该只使用 div?
-
如果与 html5 元素(如页眉、页脚、main、article、section 等)一起使用会更加语义化。
-
我明白了 :) 对编码还是很陌生
-
我们都在某个时刻。提问是最好的学习方式之一。
标签: html css height width fullscreen