17

position:absolute在电子邮件模板中使用是否安全?

4

5 回答 5

13

取决于您的用户使用的邮件客户端。例如 Outlook 处理位置:绝对好,另一方面,Thunderbird 没有。

我会尝试将您的邮件模板设计为尽可能“正常”。例如,表格有很大帮助(糟糕)。

有关 HTML 邮件的样式提示,请参阅以下页面,包括一些绝对位置建议:

于 2010-10-28T10:30:13.413 回答
12

添加到一个老问题,我知道 - 但我可以确认 GMail 目前都不支持 position: absolute 。

于 2011-11-10T08:35:49.813 回答
8

在电子邮件中使用绝对位置不是一种安全的方式,因为所有电子邮件服务器都不支持标签..而不是使用绝对位置,你们可以使用

<table width="100%" align="center" style="Margin:0px; Padding:0px; border-collapse:collapse; background-color:rgb(255,255,255);max-width:600px;" border="0" cellspacing="0" cellpadding="20" background="http://wallpapercave.com/wp/BGGdOwY.jpg">
  <tbody>
    <tr>
            <td align="left" valign="top">
              <p Style="Margin-top:45px; text-align:left; line-height: 24px; letter-spacing: 0.55px; Margin-bottom:10px; font-family:'Open Sans',arial,sans-serif!important; width: 540px;">Dear Artist/Vendor,</p>
              <p Style="text-align:justify; line-height: 24px; letter-spacing: 0.55px; Margin-top:10px; Margin-bottom:10px; font-family:'Open Sans',arial,sans-serif!important; width: 540px;">We've received a request to reset your password. If you didn't make the request, just ignore this email. Otherwise, you can reset your password using this link:</p>
            </td>
          </tr>
        </tbody>
      </table>

甚至你们也可以通过在另一个 td 中添加此代码来使用可点击按钮

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
	<meta name="viewport" content="width=device-width" >
	<title></title>
</head>
<body style="Margin:0px; Padding:0px;">
	<table width="100%" align="center" style="Margin:0px; Padding:0px; border-collapse:collapse; background-color:rgb(255,255,255);" border="0" cellspacing="0" cellpadding="0">
		<tbody>
			<tr>
				<td align="center" valign="top">
					<table width="100%" align="center" style="Margin:0px; Padding:0px; border-collapse:collapse; background-color:rgb(255,255,255);max-width:600px;" border="0" cellspacing="0" cellpadding="20" background="http://wallpapercave.com/wp/BGGdOwY.jpg">
						<tbody>
							<tr>
								<td align="center" valign="top">
									<table width="100%" align="center" style="Margin:0px auto; Padding:0px; border-collapse:n-left: 20px; max-width:600px; " border="0" cellspacing="0" cellpadding="0" >
										<tbody>
											<tr>
												<td align="left" valign="top">
													<p Style="Margin-top:45px; text-align:left; line-height: 24px; letter-spacing: 0.55px; Margin-bottom:10px; font-family:'Open Sans',arial,sans-serif!important; width: 540px;">Dear Artist/Vendor,</p>
													<p  Style="text-align:justify; line-height: 24px; letter-spacing: 0.55px; Margin-top:10px; Margin-bottom:10px; font-family:'Open Sans',arial,sans-serif!important; width: 540px;">We've received a request to reset your password. If you didn't make the request, just ignore this email. Otherwise, you can reset your password using this link:</p>
												</td>
											</tr>
										</tbody>
									</table>
									<table width="100%" align="left" style="Margin:0px auto; Padding:0px; border-collapse:collapse;  max-width:600px; Margin-left: 20px;  Margin-top:15px;" border="0" cellspacing="0" cellpadding="0" >
										<tbody>
											<tr>
												<td align="left" valign="top">
													<a href="https://www.google.co.in/" style="padding: 10px 35px; text-decoration: none; color: #ffffff; background-color:#000000; letter-spacing: 0.55px; text-align:left; line-height: 24px; font-family:'Open Sans',arial,sans-serif!important;">Reset Your Password</a>
												</td>
											</tr>
										</tbody>
									</table>
									
					
				</td>
			</tr>
		</tbody>
	</table>

在这里输入代码

于 2016-01-21T11:25:04.263 回答
3

根据Style in EmailAOL(在第 9 版之前)和Mozilla Mail/ ThunderBird(所有版本)都不支持电子邮件正文中的绝对定位。

于 2010-10-28T10:31:04.113 回答
0

绝对在 css 中不适用于 HTML 电子邮件。如果你要使用绝对的图像组合,你可以使用这种风格。

 background-image: url(url_to_your_image);

希望它会帮助你。

于 2018-12-28T07:25:38.127 回答