Html 文本位于单元格中间,不会向上移动
我有以下代码:Html 文本位于单元格中间,不会向上移动,html,css,html-table,vertical-alignment,Html,Css,Html Table,Vertical Alignment,我有以下代码: <table border="0" cellspacing="0" cellpadding="0" width="130" align="left"> <tbody> <tr> <td><a title="View Member" href="$$app_url$$/member/profile/index.cfm?profileid=24215649&wldsite=$$site_id$$" target="
<table border="0" cellspacing="0" cellpadding="0" width="130" align="left">
<tbody>
<tr>
<td><a title="View Member" href="$$app_url$$/member/profile/index.cfm?profileid=24215649&wldsite=$$site_id$$" target="_blank"><img style="border: 1px solid #666; border-radius: 5px; display: block;" src="http://s.wldcdn.net/newsletters/uploads/assets/000/026/770/336cc11b947060b2ef2bf68ddc2f0c05_original.jpg?1372264611" alt="" width="145" /></a></td>
</tr>
<tr>
<td width="130" height="16">
<p style="text-align: center; font-size: 15px; font-family: Arial, Helvetica, sans-serif;"><span style="text-decoration: underline;"><strong><a title="View Member" href="$$app_url$$/member/profile/index.cfm?profileid=24215649&wldsite=$$site_id$$" target="_blank">George</a></strong></span></p>
</td>
</tr>
</tbody>
</table>
我不知道为什么,也不知道如何修改出现在第二排中间的名字。我希望它直接出现在图像下方,但无法找出正确的代码组合,使其更靠近图像底部
PS:之所以是表格,是因为它是电子邮件时事通讯的一部分
任何帮助都将不胜感激。快速修复:
<table border="0" cellspacing="0" cellpadding="0" width="130" align="left">
<tbody>
<tr>
<td><a title="View Member" href="$$app_url$$/member/profile/index.cfm?profileid=24215649&wldsite=$$site_id$$" target="_blank"><img style="border: 1px solid #666; border-radius: 5px; display: block;" src="http://s.wldcdn.net/newsletters/uploads/assets/000/026/770/336cc11b947060b2ef2bf68ddc2f0c05_original.jpg?1372264611" alt="" width="145" /></a></td>
</tr>
<tr>
<td width="130" height="16" style="vertical-align: top; text-align: center; font-size: 15px; font-family: Arial, Helvetica, sans-serif;">
<strong><a style="text-decoration: underline;" title="View Member" href="$$app_url$$/member/profile/index.cfm?profileid=24215649&wldsite=$$site_id$$" target="_blank">George</a></strong>
</td>
</tr>
</tbody>
</table>
问题在于
标记,默认情况下,该标记具有上下边距
我整合了您的样式,您不需要p
或span
元素
另外,将垂直对齐:top
添加到感兴趣的表格单元格中
除了段落上的默认页边距外,你的答案非常接近,这很容易被忽略
小提琴演示:
PS
我会把
放在链接文本的周围,而不是链接…快速修复:
<table border="0" cellspacing="0" cellpadding="0" width="130" align="left">
<tbody>
<tr>
<td><a title="View Member" href="$$app_url$$/member/profile/index.cfm?profileid=24215649&wldsite=$$site_id$$" target="_blank"><img style="border: 1px solid #666; border-radius: 5px; display: block;" src="http://s.wldcdn.net/newsletters/uploads/assets/000/026/770/336cc11b947060b2ef2bf68ddc2f0c05_original.jpg?1372264611" alt="" width="145" /></a></td>
</tr>
<tr>
<td width="130" height="16" style="vertical-align: top; text-align: center; font-size: 15px; font-family: Arial, Helvetica, sans-serif;">
<strong><a style="text-decoration: underline;" title="View Member" href="$$app_url$$/member/profile/index.cfm?profileid=24215649&wldsite=$$site_id$$" target="_blank">George</a></strong>
</td>
</tr>
</tbody>
</table>
问题在于
标记,默认情况下,该标记具有上下边距
我整合了您的样式,您不需要p
或span
元素
另外,将垂直对齐:top
添加到感兴趣的表格单元格中
除了段落上的默认页边距外,你的答案非常接近,这很容易被忽略
小提琴演示:
PS
我会将
放在链接文本周围,而不是链接周围…请澄清:“我希望它直接出现在图像后面…”这是否意味着图像与文本重叠?请注意,电子邮件客户端因无法很好地呈现HTML/CSS而臭名昭著。在现代浏览器中运行良好的技术将在Outlook等电子邮件客户端中惨遭失败。@MarcAudet我已经更新,将后面的内容改为下面的内容。抱歉。是的,我理解电子邮件中HTML/CSS的限制。谢谢。请澄清:“我希望它直接出现在图像后面…”这是否意味着图像与文本重叠?请注意,电子邮件客户端因无法很好地呈现HTML/CSS而臭名昭著。在现代浏览器中运行良好的技术将在Outlook等电子邮件客户端中惨遭失败。@MarcAudet我已经更新,将后面的内容改为下面的内容。抱歉。是的,我理解电子邮件中HTML/CSS的限制。谢谢