我正在创建一个小的 HTA 应用程序,我需要使用 table
标记进行布局。因为 HTA 使用旧的 IE 渲染引擎,所以这是我能让事情正常进行的唯一方法。
HTML:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="x-ua-compatible" content="IE=9">
<title>0nurky Hacks</title>
<link rel="Stylesheet" type="text/css" href="./style.css">
</head>
<body>
<table id="head">
<td>#head</td>
</table>
<table id="menu" align="left">
<td>#menu</td>
</table>
<table id="aside" align="left">
<td>#aside</td>
</table>
<table id="foot" valign="left">
<td>#foot</td>
</table>
</body>
</html>
CSS:
body {
margin:0px;
padding:0px;
}
table#head {
background:#000;
width:100%;
height:15.5%;
color:#fff;
}
table#head td {
padding-left:3%;
padding-right:3%;
}
table#menu {
background:gray;
width:25%;
}
table#aside {
background:lightgray;
width:75%;
}
table#foot {
background:darkgray;
width:100%;
height:8.9%;
}
基本上,我将 align="left"
放在每个 table
标签上,而不是 table#head
。
如您所见,第四个 table
没有与底部对齐,即使它是 width
是 100%,但它向左对齐,触及第三个 table
。
~ 我知道人们会说,当你可以通过 node.js 和其他一切来完成时,为什么还要使用 HTA。 ~ 是的,我正在为我的 friend 做这个。
提前谢谢大家。
最佳答案
这很容易。
将此添加到您的 CSS 代码中:
.jump {
display:inline-block;
height:25px;
}
...以及第 4 个表之前的 HTML 代码:
<div class="jump"></div>
关于html - 第 4 个表未与底部对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45888815/