gpt4 book ai didi

HTML 电子邮件仅在 Thunderbird 中未正确对齐

转载 作者:行者123 更新时间:2023-11-28 02:59:34 27 4
gpt4 key购买 nike

我正在创建一个 html 日历 (cal.ics) 邀请,它适用于 Gmail、Firefox 和 YahooMail 等电子邮件客户端。但是当我在雷鸟中尝试时,段落(p)标签总是偏向右侧,即使我已经明确设置了左对齐、 float :无等属性。我做错了什么吗?电子邮件在下面,我的 css 中是否缺少某些内容?

<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Follow-Up! Meeting</title>
<style>
/* -------------------------------------
GLOBAL
------------------------------------- */
* {
font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif;
font-size: 100%;
line-height: 2.0em;
margin: 0;
padding: 0;
text-align: left;
}

img {
max-width: 600px;
width: 100%;
}

body {
-webkit-font-smoothing: antialiased;
height: 100%;
-webkit-text-size-adjust: none;
width: 100% !important;
}

/* -------------------------------------
ELEMENTS
------------------------------------- */
a {
color: #348eda;
}

.btn-primary {
margin-bottom: 10px;
width: auto !important;
}

.btn-primary td {
background-color: #348eda;
border-radius: 25px;
font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-size: 14px;
text-align: center;
vertical-align: top;
}

.btn-primary td a {
background-color: #348eda;
border: solid 1px #348eda;
border-radius: 25px;
border-width: 10px 20px;
display: inline-block;
color: #ffffff;
cursor: pointer;
font-weight: bold;
line-height: 2;
text-decoration: none;
}

.last {
margin-bottom: 0;
}

.first {
margin-top: 0;
}

.padding {
padding: 10px 0;
}

/* -------------------------------------
BODY
------------------------------------- */
table.body-wrap {
padding: 20px;
width: 100%;
}

table.body-wrap .container {
border: 1px solid #f0f0f0;
}

/* -------------------------------------
FOOTER
------------------------------------- */
table.footer-wrap {
clear: both !important;
width: 100%;
}

.footer-wrap .container p {
color: #666666;
font-size: 12px;
}

table.footer-wrap a {
color: #999999;
}

/* -------------------------------------
TYPOGRAPHY
------------------------------------- */
h1, h2, h3 {
color: #111111;
font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 200;
line-height: 1.2em;
margin: 40px 0 10px;
}

h1 {
font-size: 36px;
}
h2 {
font-size: 28px;
}
h3 {
font-size: 22px;
}

p, ul, ol {
font-size: 14px;
font-weight: normal;
margin: 0;
padding: 0;
margin-bottom: 10px;
float: none;
text-align: left;
}

ul li, ol li {
margin-left: 5px;
list-style-position: inside;
}

/* ---------------------------------------------------
RESPONSIVENESS
------------------------------------------------------ */

/* Set a max-width, and make it display as block so it will automatically stretch to that width, but will also shrink down on a phone or something */
.container {
clear: both !important;
display: block !important;
Margin: 0 auto !important;
max-width: 600px !important;
}

/* Set the padding on the td rather than the div for Outlook compatibility */
.body-wrap .container {
padding: 20px;
}

/* This should also be a block element, so that it will fill 100% of the .container */
.content {
display: block;
margin: 0 auto;
max-width: 600px;
}

/* Let's make sure tables in the content area are 100% wide */
.content table {
width: 100%;
}

</style>
</head>

<body bgcolor="#f6f6f6">

<!-- body -->
<table width="100%" class="body-wrap" bgcolor="#f6f6f6" cellpadding="0" cellspacing="0" border="0">
<tr>
<td></td>
<td class="container" bgcolor="#FFFFFF"><!-- content -->
<div class="content">
<table width="100%" style="width: 100%; text-align: left;" cellpadding="0" cellspacing="0" border="0">
<tr style="width: 100%; text-align: left;" >
<td align="left" style="width: 100%; text-align: left;" >

Hi John Doe,

<p style="text-align: left; margin: 0px; padding: 0px; float: none; display: block;">
You have been invited to attend a meeting.
</p>
<h4>Topic</h4>
<p style="mso-table-lspace:0;mso-table-rspace:0; margin:0; text-align:left;" >A Samle Meeting!</p>

<h4>Summmary</h4>
<p style="mso-table-lspace:0;mso-table-rspace:0; margin:0; text-align:left;" >
A sample meeting to prove the concept work andthen take it form there
</p>


<h4>Location</h4>
<p>
123 Example Street New york, NY
</p>


<h4>Time</h4>
<p>
From: February 7, 2016, 2:28 am GMT-0500 <br />
To: February 9, 2016, 3:50 pm GMT-0500
</p>
<h4>Next Steps</h4>
<p>
You may view more information on the meeting by clicking the link below
</p><!-- button -->
<table class="btn-primary" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><a href="http://www.example.com">View Meeting</a></td>
</tr>
</table><!-- /button -->
<p>
Please adjust your meeting schedule infomration there.
</p>
<p>
Thanks,
</p>

</td>
</tr>
</table>
</div><!-- /content --></td>
<td></td>
</tr>
</table>
<!-- /body -->

<!-- footer -->
<table class="footer-wrap">
<tr>
<td></td>
<td class="container"><!-- content -->
<div class="content">
<table>
<tr>
<td align="center">
</td>
</tr>
</table>
</div><!-- /content --></td>
<td></td>
</tr>
</table>
<!-- /footer -->

</body>
</html>

最佳答案

在最新的 Thunderbird 中测试了您的电子邮件,段落似乎在应有的位置。

不过,您可能指的是在白色背景的“容器”上设置的 20 像素内边距。删除填充将使文本粘在空白的左侧。

由于 Gmail 和 Yahoo 都忽略了 HEAD 中的 CSS,因此您看不到那里的填充。

就个人而言,出于美观原因,我建议不要移除填充物。

Preview in Thunderbird 38.5.1 (Windows)

关于HTML 电子邮件仅在 Thunderbird 中未正确对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35253566/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com