我有一个包含 2 列的表格,并且在每一列上我都有不同大小的字体(更大的字体也很强大)。 我的问题是文本的垂直对齐方式:它没有垂直对齐(见图):
这是我的 html 代码:
<html>
<head>
<style>
.big-text-size {
font-size: 3.5em;
}
.small-text-size {
font-size: 1.1em;
}
</style>
</head>
<body>
<table>
<td class="big-text-size">
<strong>My doctor's name</strong>
</td>
<td class="small-text-size"> Daniel Boro </td>
</table>
</body>
</html>
有什么建议为什么会发生吗?
最佳答案
调整不同大小文本的垂直对齐方式 ( see here ):
<html>
<head><style>
.big-text-size {
font-size: 3.5em;
vertical-align: text-bottom;
}
.small-text-size {
font-size: 1.1em;
vertical-align: text-bottom;
}
</style></head>
<body>
<table>
<td class="big-text-size">
<strong>My doctor's name</strong>
</td>
<td class="small-text-size"> Daniel Boro </td>
</table>
</body>
</html>
关于html - 在表格的 2 列中垂直对齐文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33363114/