html - 无法排列这些行
问题描述
我有一个表格,用于在页脚上放置图像和一些文本(在 WordPress 上使用 Avada)。对于我的生活,我无法排列这些。有人可以提供一些指导吗?
代码如下以及codepen的链接:
<table width="100%">
<tr>
<td align="center" width="100%">
<img valign="bottom" align="center" src="https://test.seescan.com/wp-content/uploads/2020/02/Underground_Evolved_Horizontal-6.png" alt="Underground_Evolved_Footer" width="500px" height="400px" />
</td>
<td width="100%">
<p style="color: #999999; line-height:8px;" align="center">Copyright ©
<script>
document.write(new Date().getFullYear());
</script> SeeScan. All rights reserved.</p>
</td>
</tr>
</table>
解决方案
您的图像的一侧似乎比另一侧有更多的空白。这使得你不能轻易地将它居中(你可以使用左/右属性,但这在不同尺寸的屏幕上会很挑剔)。我建议裁剪它,使其默认居中。
下面我添加了一行,以便版权在图像下方居中。我还为图像添加了黑色背景和白色边框,以便您可以看到图像在右侧有更多的空白空间。
/* made background black to see white picture */
table {
background-color:black;
}
img {
border:solid 1px white;
}
<table width="100%">
<tr>
<td align="center" width="100%">
<img valign="bottom" align="center" src="https://test.seescan.com/wp-content/uploads/2020/02/Underground_Evolved_Horizontal-6.png" alt="Underground_Evolved_Footer" width="500" />
</td>
<tr>
<td align="center" width="100%">
<p style="color: #999999; line-height:8px;" align="center">Copyright © <script>document.write(new Date().getFullYear());</script> SeeScan. All rights reserved.</p>
</td>
</tr>
</tr>
</table>
推荐阅读
- java - 位图在某些 android 设备上无法保存到图库
- r - 用高于和低于平均值的 SD 值替换异常值
- javascript - 如何编辑 Material UI DataGrid 中的特定行?
- javascript - JavaScript:试图找到一种方法来调整窗口大小时如何刷新我的 div.offsetTop 值
- apigee - 如何在 APIGEE 中公开通过后端服务器上的 API 密钥进行身份验证的后端 API?
- c# - 缺少 Microsoft.Practice.ObjectBuilder2.dll
- windows - 如何在 Windows 上安装 apache kafka?安装错误?
- python - 嗨,我试图用python编写这段代码,但我有一个错误,我希望有人能帮助我
- c# - 从接口为 InterfaceA 的 Unity 容器中获取对象
其中 InterfaceB 是可变的 - griddb - GridDB 连接超时