【问题标题】:HTML Email - How to achieve spacing between links on same row in ALL email clientsHTML 电子邮件 - 如何在所有电子邮件客户端中的同一行上实现链接之间的间距
【发布时间】:2018-06-08 12:20:45
【问题描述】:

在典型的 HTML 网页上,这将非常容易。对于电子邮件,没那么多。

我相信你们都熟悉让电子邮件客户端以一致的方式呈现内容的挑战。它基本上会把 div 扔出窗外。

我关心的是 About、Practice Areas 等链接。

这是我想要实现的目标

这就是它在网络浏览器中的呈现方式,非常完美。

但这就是我在 Outlook 2010 中得到的。

我的问题是.. 我需要在父元素上使用 text-align:center 来使所有内容居中。但在 Outlook 2010 中,它将子元素垂直堆叠,而不是排成一行。

当我将其更改为只有表内的链接(而不是嵌套表)时,我会丢失链接上的所有填充。

No padding on links..

有没有办法做到这一点?

<!DOCTYPE HTML>
<html>
    <HEAD>
        <meta name='viewport' content='width=device-width, initial-scale=1'>
        <meta http-equiv='X-UA-Compatible' content='IE=edge'>
        <meta charset="utf-8">

        <title>|Jan '18|</title>
        <style type="text/css">

            @media(max-width: 500px) {
                .frame {
                    width: 97% !important;
                }
                .fullIMG {
                    width: 100% !important;
                }
                #contentGrid {
                    padding: 10px 20px !important;
                }
            }

        </style>
    </head>
    <BODY>

            <!-- Beginning of white background table -->
            <table align="center" cellspacing="0" cellpadding="0" border="0" style="width: 550px; background-color: white; border-left:1px solid black; border-right:1px solid black; opacity:.95" class="frame">
            <tr>
            <td>

                    <!-- Pre-Header -->
                    <tr>
                    <td style="text-align:center; padding: 0px 20px;">
                        <p style="font-family: Arial, Helvetica, sans-serif; line-height: 20px"><i>We have collected <strong>MORE THAN $1 BILLION</strong> for thousands of clients.</i></p>
                    </td>
                    </tr>
                    <!-- End of Pre-Header -->

                    <!--  Header Row  -->   
                    <tr>
                    <td>
                        <!--  Header Table  -->
                        <table align="center" style="padding: 10px 20px 0px 20px;">
                        <tr>
                        <td align="center">
                            <a href="https://www.hupy.com/" target="_blank">
                             <img alt="Voted Best, Rated Vest" style="width: 90%; height: auto; " src="https://image.ibb.co/nai2NG/logo_tight.jpg"/>
                            </a>
                        </td>
                        </tr>
                        </table>
                        <!-- End of Header Table -->
                    </td>
                    </tr>
                    <!-- End of Header Row  --> 

                    <!-- Homebase Links Row -->
                    <tr>
                    <td>

                        <hr align="center" style="width:90%;">

                        <!-- Homebase Links Table -->
                        <table align="center">
                        <tr>
                        <td>
                                <table align="left" style="padding: 10px;">
                                <tr>
                                <td>
                                    <a style="text-decoration: none; color: black; font-family: Arial, Helvetica, sans-serif; font-size: 18px; line-height: 30px; text-shadow: 1px 1px 3px rgba(165,42,42,.7);" href="https://www.hupy.com/aboutus.cfm"><strong>About</strong></a>
                                </td>
                                </tr>
                                </table>

                                <table align="left" style="padding: 10px;">
                                <tr>
                                <td>
                                    <a style="text-decoration: none; color: black; font-family: Arial, Helvetica, sans-serif; font-size: 18px; line-height: 30px;text-shadow: 1px 1px 3px rgba(165,42,42,.7);" href="https://www.hupy.com/practice_areas/"><strong>Practice Areas</strong></a>
                                </td>
                                </tr>
                                </table>

                                <table align="left" style="padding: 10px;">
                                <tr>
                                <td>
                                    <a style="text-decoration: none; color: black; font-family: Arial, Helvetica, sans-serif; font-size: 18px; line-height: 30px; text-shadow: 1px 1px 3px rgba(165,42,42,.7);" href="https://www.hupy.com/library/"><strong>Legal Info</strong></a>
                                </td>
                                </tr>
                                </table>

                                <table align="left" style="padding: 10px;">
                                <tr>
                                <td>
                                    <a style="text-decoration: none; color: black; font-family: Arial, Helvetica, sans-serif; font-size: 18px; line-height: 30px; text-shadow: 1px 1px 3px rgba(165,42,42,.7);" href="https://www.hupy.com/case-results.cfm"><strong>Results</strong></a>
                                </td>
                                </tr>
                                </table>

                                <table align="left" style="padding: 10px;">
                                <tr>
                                <td>
                                    <a style="text-decoration: none; color: black; font-family: Arial, Helvetica, sans-serif; font-size: 18px; line-height: 30px; text-shadow: 1px 1px 3px rgba(165,42,42,.7);" href="https://www.hupy.com/contact.cfm"><strong>Contacts</strong></a>
                                </td>
                                </tr>
                                </table>
                        </td>
                        </tr>
                        </table>
                        <!-- End of Homebase Links Table -->

                    </td>
                    </tr>
                    <!-- End of Homebase Row -->

                        <!-- Snipppet Row -->
                        <tr>
                            <td style="padding: 0px 20px" align="center">
                                <h2 style="font-family: Helvetica; font-size: 25px; text-align:left;">CASE RESULT: $1.5 Million for Rider Struck by Inattentive Driver</h2>
                                    <a href="https://www.hupy.com/case_results/-1-5-million-for-rider-struck-by-inattentive-driver.cfm" target="blank"> 
                                        <img class="fullIMG" src="https://image.ibb.co/eNfVbb/1_5mill.jpg" alt="$1.5 Million" style="width: 100%; height: auto; box-shadow: 3px 3px 5px rgba(165,42,42,.7)">
                                    </a>
                                <p style="font-family: Helvetica; font-size: 16px; line-height: 24px; text-align:left;">In July 2017, our client and his wife were on a casual motorcycle ride in Waukesha County when the driver of a minivan failed to see their motorcycle and turned left in front of them. A terrible crash occurred and both occupants of the motorcycle were ejected. Find out what happened when Hupy and Abraham fought the insurance company to get a $1.5 million settlement.</p>
                            </td>                       
                        </tr>
                        <tr>
                        <td>
                            <a href="https://www.hupy.com/case_results/-1-5-million-for-rider-struck-by-inattentive-driver.cfm">Click me</a>
                        </td>
                        </tr>
                        <!-- End of Snippet Row -->

                    <!-- Facebook Fans Row -->
                    <tr>
                    <td>
                        <!-- Facebook Fans Table  -->
                        <table align="center" style="padding: 20px 20px 0px 20px;">
                        <tr>
                        <td align="center">
                            <a href="https://www.facebook.com/HupyandAbraham/">
                                <img src="https://preview.ibb.co/e6mYUw/18000fans_tight.jpg" alt="18000fans" style="width: 85%; height: auto;">
                            </a>
                        </td>
                        </tr>
                        </table>
                        <!-- End of Facebook Fans Table -->
                    </td>
                    </tr>
                    <!-- End of Facebook Fans Row -->

                        <!-- Social Links Row -->
                        <tr>
                        <td>
                            <!-- Social Links Table -->
                            <table align="center" cellspacing="5" cellpadding="5" border="0">
                                <tr align="center">
                                    <td align="center">                                     
                                        <a href="https://twitter.com/HupyandAbraham" target="_blank" style="text-decoration: none;">
                                            <img style="filter: drop-shadow(1px 1px 3px #1DA1F2);" alt="Twitter link" src="https://cdn-images.mailchimp.com/icons/social-block-v2/outline-dark-twitter-96.png">
                                        </a>

                                        <a href="https://www.youtube.com/user/hupyandabrahamSC" target="_blank" style="text-decoration: none;">
                                            <img style="filter: drop-shadow(1px 1px 3px #ff0000);" alt="YouTube link" src="https://cdn-images.mailchimp.com/icons/social-block-v2/outline-dark-youtube-96.png">
                                        </a>

                                        <a href="http://instagram.com/hupyandabraham" target="_blank" style="text-decoration: none;">
                                            <img style="filter: drop-shadow(1px 1px 3px #C32AA3);" alt="Instagram link" src="https://cdn-images.mailchimp.com/icons/social-block-v2/outline-dark-instagram-96.png">
                                        </a>
                                    </td>
                                </tr>
                                <tr align="center">
                                    <td>
                                        <a href="https://www.pinterest.com/hupyandabraham/" target="_blank" style="text-decoration: none;">
                                            <img style="filter: drop-shadow(1px 1px 3px #BD081C);" alt="Pinterest link" src="https://cdn-images.mailchimp.com/icons/social-block-v2/outline-dark-pinterest-96.png">
                                        </a>

                                        <a href="https://www.linkedin.com/company/hupy-&-abraham" target="_blank" style="text-decoration: none;">
                                            <img style="filter: drop-shadow(1px 1px 3px #007BB5);" alt="Pinterest link" src="https://cdn-images.mailchimp.com/icons/social-block-v2/outline-dark-linkedin-96.png">
                                        </a>

                                        <a href="https://plus.google.com/+HupyandAbrahamSC" target="_blank" style="text-decoration: none;">
                                            <img style="filter: drop-shadow(1px 1px 3px #DB4437);" alt="Pinterest link" src="https://cdn-images.mailchimp.com/icons/social-block-v2/outline-dark-googleplus-96.png">
                                        </a>
                                    </td>
                                </tr>
                            </table>
                            <!-- End of Social Links Table -->
                        </td>
                        </tr>
                        <!-- End Social Links Row -->

            </td>
            </tr>
            </table>
                <!-- End of white background table -->


    </BODY>
</html>

【问题讨论】:

  • 添加代码 sn-p 而不是发布代码截图。您希望我们输入整个内容吗?
  • 你为什么要为 5 个超链接制作单独的表格?你只需要 1 个 和 1 个 和 5
  • 我尝试不为链接设置单独的表格,但它没有在 Outlook 2010 中呈现填充。但它在 Web 浏览器上出现了。在我看来,表格允许有填充,但网络链接不允许。在 Outlook 2010 的世界中..
  • 试试这个
  • 适用于网络浏览器,但不适用于 Outlook。我读过 Outlook 2010 根本不支持 Flex。我尝试了有和没有儿童桌的情况。它居中,但链接之间没有间距。最终解决一个问题并创造另一个问题。我猜这都是因为 Outlook 不会在链接上呈现填充。

标签: html css email html-table


【解决方案1】:

好的,这是一个修改后的 HTML 电子邮件模板。

首先 - 你必须做一些事情。 Outlook 是超级次要的,但不幸的是人们仍在使用它。太可怕了。

因此,您可以通过多种方式来解释这一点 - 在代码中和标题中。幸运的是,您的电子邮件并不太复杂,因此电子邮件正文中并没有真正调用 !mso

其次 - 尝试使您的电子邮件也响应。请记住,所有电子邮件中有 75% 是在手机上阅读的。你的电子邮件看起来有点像混搭。还不错。

标题链接在 Outlook 上一直向下排列,因为您在它自己的表中都有每个链接。 Outlook 将其解释为表格(显然)并将每个表格设为电子邮件宽度的 100%。如果您将链接放在表格中,然后将每个链接放在&lt;td&gt; 中,您将获得更好的结果。

最后,您的电子邮件中存在一些有趣的阴影,它们可能适用于所有电子邮件客户端,也可能不适用于所有电子邮件客户端。我离开了他们,但如果他们离开了,我会感到惊讶。

我想说,您可能可以使用此代码并将其放入几乎任何 ESP 中,它应该可以工作。您必须始终注意为谁编写电子邮件,并在设计时牢记这一点。

祝你好运!还有很多,所以如果您有任何问题,请继续提问。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="format-detection" content="date=no"/>
<meta name="format-detection" content="telephone=no"/>
<!--[if !mso]><!-- -->
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!--<![endif]-->
<title>Royal Caribbean - Advantage Program</title>
<style type="text/css">
		a[x-apple-data-detectors] {
    		color: inherit !important;
    		text-decoration: none !important;
    		font-size: inherit !important;
    		font-family: inherit !important;
    		font-weight: inherit !important;
    		line-height: inherit !important;
		}
		u + #body a {
    		color: inherit;
    		text-decoration: none;
    		font-size: inherit;
    		font-family: inherit;
    		font-weight: inherit;
    		line-height: inherit;
		}
		#outlook a{
			padding:0;
		}
		.ReadMsgBody{
			width:100%;
		}
		body{
			width:100% !important;
			min-width:100%;
			-webkit-text-size-adjust:100%;
			-ms-text-size-adjust:100%;
			-webkit-font-smoothing: antialiased;
		}
		v*{
		   	behavior:url(#default#VML);
			display:inline-block;
		}
		.ExternalClass{
			width:100%;
		}
		td{
			border-collapse: separate !important;
		}
		.ExternalClass,
		.ExternalClass p,
		.ExternalClass span,
		.ExternalClass font,
		.ExternalClass td,
		.ExternalClass div{
			line-height:100%;
		}
		a img{
			border:none;
		}
		a {
			text-decoration:none !important;
		}
		img{
			display:block;
			outline:none;
			text-decoration:none;
			border:none; 
			 -ms-interpolation-mode: bicubic;
		}
		table{
			border-spacing:0;
			border-collapse:separate;
			mso-table-lspace:0pt;
			mso-table-rspace:0pt;
		}
		table[class=full] {
			width: 100%;
			clear: both;
		}
	div {
		padding: 0;
		margin: 0;
	}
		p{
			margin:0;
			padding:0;
			border:0;
			font-size:100%;
			line-height:1.4em;
			font-family: Helvetica, Arial, sans-serif;
		}
		h1{
			margin:0;
			padding:0;
			border:0;
			font-size:100%;
			line-height:1.4em;
			font-family: Helvetica, Arial, sans-serif;
		}
		#wrappertable{
			margin:0;
			padding:0;
			width:100% !important;
			line-height:100% !important;
		}
		br[class=show]{
			display: none !important;
			max-height: 0px;
			font-size: 0px;
			overflow: hidden;
			mso-hide: all;
		}
	@media screen and (max-width:600px){
		table{
			width:100% !important;
		}
		table[class=content]{
			width:95% !important;
		}
		td[class=hide]{
			display: none !important;
			max-height: 0px !important;
			font-size: 0px !important;
			overflow: hidden !important;
			mso-hide: all !important;
			width: 0 !important;
		}
		td[class=fullwidth]{
			width:100% !important;
			float:left !important;
		}
		/*replace image with mobile version*/
		td#pic1 img{
			content:url("") !important;
		}
		/*repeat ID as necessary*/
		img[class=fullwidth]{
			width:100% !important;
			height:auto !important;
		}
		img[class=threequarters]{
			float: none !important;
			width: 75% !important;
			height: auto !important;
			margin: auto !important;
		}
		img[class=twothirds]{
			float: none !important;
			width: 66.6666% !important;
			height: auto !important;
			margin: auto !important;
		}
		img[class=halfwidth]{
			float: none !important;
			width: 50% !important;
			height: auto !important;
			margin: auto !important;
		}
		img[class=onethird]{
			width: 33.3333% !important;
			height: auto !important;
			margin: auto !important;
			padding-top: 5px !important;
			padding-bottom: 5px !important;
		}
		img[class=quarterwidth]{
			width: 25% !important;
			height: auto !important;
			margin: auto !important;
			padding-top: 5px !important;
			padding-bottom: 5px !important;
		}
		img[class=hide]{
			display: none !important;
			max-height: 0px !important;
			font-size: 0px !important;
			overflow: hidden !important;
			mso-hide: all !important;
			width: 0 !important;
		}
		div[class=fullwidth]{
			max-width: 95% !important;
		}
		p,h1,h2[class=centered]{
			text-align: center !important;
		}
		br[class=show]{
		display: inline !important;
		}
		br[class=hide]{
			display: none !important;
			max-height: 0px;
			font-size: 0px;
			overflow: hidden;
			mso-hide: all;
		}
		span[class=hide]{
			display: none !important;
			max-height: 0px;
			font-size: 0px;
			overflow: hidden;
			mso-hide: all;
		}

	}
</style>
</head>

<body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" offset="0" bgcolor="#eeeeee" style="padding: 0 !important; margin:0 !important;">
	<center>
	<table width="100%" style="border-collapse:collapse; table-layout:fixed;" border="0" cellspacing="0" cellpadding="0" id="wrappertable">
    	<tr>
        	<td align="center">
            	<table cellpadding="0" cellspacing="0" border="0" width="620" bgcolor="#f9f9f9" style="box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.10);">
					<tr>
                    	<td width="618" align="center">
						<!--THIS IS THE CONTENT TABLE-->
                        <table cellpadding="0" cellspacing="0" border="0" width="600">
							<tr>
								<td align="center">
									<p style="font-family: Arial, Helvetica, sans-serif; line-height: 20px"><i>We have collected <strong>MORE THAN $1 BILLION</strong> for thousands of clients.</i></p>
								</td>
							</tr>
							<!--use empty rows for spacing-->
							<tr><td height="20" style="line-height: 20px; font-size: 1px;">&nbsp;</td></tr>
							<tr>
								<td align="center">
									<img src="https://image.ibb.co/nai2NG/logo_tight.jpg" alt="Voted Best, Rated Vest" width="580" height="150" class="fullwidth"/>
								</td>
							</tr>
							<tr>
								<td align="center" height="40" style="line-height: 40px;">
									<hr align="center" width="80%" size="1" noshade="noshade"/>
								</td>
						    </tr>
							<tr>
								<td align="center">
									<table cellpadding="0" cellspacing="0" border="0" class="content" width="95%">
										<tr>
											<td class="fullwidth" align="center">
												<a style="text-decoration: none; color: black; font-family: Arial, Helvetica, sans-serif; font-size: 18px; line-height: 30px; text-shadow: 1px 1px 3px rgba(165,42,42,.7);" href="https://www.hupy.com/aboutus.cfm"><strong>About</strong></a>
											</td>
											<td class="fullwidth" align="center">
												<a style="text-decoration: none; color: black; font-family: Arial, Helvetica, sans-serif; font-size: 18px; line-height: 30px;text-shadow: 1px 1px 3px rgba(165,42,42,.7);" href="https://www.hupy.com/practice_areas/"><strong>Practice Areas</strong></a>
											</td>
											<td class="fullwidth" align="center">
												<a style="text-decoration: none; color: black; font-family: Arial, Helvetica, sans-serif; font-size: 18px; line-height: 30px; text-shadow: 1px 1px 3px rgba(165,42,42,.7);" href="https://www.hupy.com/library/"><strong>Legal Info</strong></a>
											</td>
											<td class="fullwidth" align="center">
												<a style="text-decoration: none; color: black; font-family: Arial, Helvetica, sans-serif; font-size: 18px; line-height: 30px; text-shadow: 1px 1px 3px rgba(165,42,42,.7);" href="https://www.hupy.com/case-results.cfm"><strong>Results</strong></a>
											</td>
											<td class="fullwidth" align="center">
												<a style="text-decoration: none; color: black; font-family: Arial, Helvetica, sans-serif; font-size: 18px; line-height: 30px; text-shadow: 1px 1px 3px rgba(165,42,42,.7);" href="https://www.hupy.com/contact.cfm"><strong>Contacts</strong></a>
											</td>
										</tr>
									</table>
								</td>
							</tr>
							<tr><td height="20" style="line-height: 20px; font-size: 1px;">&nbsp;</td></tr>
							<tr>
								<td align="center">
									<table cellpadding="0" cellspacing="0" border="0" class="content" width="95%">
										<tr>
											<td align="center">
												<h2 style="font-family: Helvetica; font-size: 25px; text-align:left; line-height: 32px;">CASE RESULT: $1.5 Million for Rider Struck by Inattentive Driver</h2>
											</td>
										</tr>
										<tr><td height="10" style="line-height: 10px; font-size: 1px;">&nbsp;</td></tr>
									  <tr>
											<td align="center">
												<a href="https://www.hupy.com/case_results/-1-5-million-for-rider-struck-by-inattentive-driver.cfm" target="blank"> 
                                        		<img src="https://image.ibb.co/eNfVbb/1_5mill.jpg" alt="$1.5 Million" width="580" height="325" style="box-shadow: 3px 3px 5px rgba(165,42,42,.7)" class="fullwidth">
                                    			</a>
										  </td>
										</tr>
										<tr><td height="10" style="line-height: 10px; font-size: 1px;">&nbsp;</td></tr>
										<tr>
											<td align="left">
												<p style="font-family: Helvetica; font-size: 16px; line-height: 24px; text-align:left;">In July 2017, our client and his wife were on a casual motorcycle ride in Waukesha County when the driver of a minivan failed to see their motorcycle and turned left in front of them. A terrible crash occurred and both occupants of the motorcycle were ejected. Find out what happened when Hupy and Abraham fought the insurance company to get a $1.5 million settlement.</p>
											</td>
										</tr>
										<tr><td height="20" style="line-height: 20px; font-size: 1px;">&nbsp;</td></tr>
									</table>
								</td>
							</tr>
							<tr>
                        		<td align="center">
                            		<a href="https://www.facebook.com/HupyandAbraham/">
                                	<img src="https://preview.ibb.co/e6mYUw/18000fans_tight.jpg" alt="18000fans" width="500" height="183" class="fullwidth">
                            		</a>
                        		</td>
                        	</tr>
							<tr><td height="20" style="line-height: 20px; font-size: 1px;">&nbsp;</td></tr>
							<tr>
								<td align="center">
									<table align="center" cellspacing="0" cellpadding="0" border="0">
                                		<tr>
                                    		<td align="center">                                     
                                        		<a href="https://twitter.com/HupyandAbraham" target="_blank" style="text-decoration: none;">
                                            		<img style="filter: drop-shadow(1px 1px 3px #1DA1F2); padding-left: 10px; padding-right: 10px;" alt="Twitter link" src="https://cdn-images.mailchimp.com/icons/social-block-v2/outline-dark-twitter-96.png">
                                        		</a>
                                    		</td>
											<td align="center">
												<a href="https://www.youtube.com/user/hupyandabrahamSC" target="_blank" style="text-decoration: none;">
                                            	<img style="filter: drop-shadow(1px 1px 3px #ff0000); padding-left: 10px; padding-right: 10px;" alt="YouTube link" src="https://cdn-images.mailchimp.com/icons/social-block-v2/outline-dark-youtube-96.png">
                                        		</a>
											</td>
											<td align="center">
												 <a href="http://instagram.com/hupyandabraham" target="_blank" style="text-decoration: none;">
                                            	<img style="filter: drop-shadow(1px 1px 3px #C32AA3); padding-left: 10px; padding-right: 10px;" alt="Instagram link" src="https://cdn-images.mailchimp.com/icons/social-block-v2/outline-dark-instagram-96.png">
                                       			 </a>
											</td>
                                		</tr>
										<tr><td colspan="3" height="20" style="line-height: 20px;">&nbsp;</td></tr>
                                		<tr>
                                    		<td align="center">
                                        		<a href="https://www.pinterest.com/hupyandabraham/" target="_blank" style="text-decoration: none;">
                                            		<img style="filter: drop-shadow(1px 1px 3px #BD081C); padding-left: 10px; padding-right: 10px;" alt="Pinterest link" src="https://cdn-images.mailchimp.com/icons/social-block-v2/outline-dark-pinterest-96.png">
                                        		</a>
                                    		</td>
											<td align="center">
												 <a href="https://www.linkedin.com/company/hupy-&-abraham" target="_blank" style="text-decoration: none;">
                                            		<img style="filter: drop-shadow(1px 1px 3px #007BB5); padding-left: 10px; padding-right: 10px;" alt="Pinterest link" src="https://cdn-images.mailchimp.com/icons/social-block-v2/outline-dark-linkedin-96.png">
                                        		</a>
											</td>
											<td align="center">
												 <a href="https://plus.google.com/+HupyandAbrahamSC" target="_blank" style="text-decoration: none;">
                                            		<img style="filter: drop-shadow(1px 1px 3px #DB4437); padding-left: 10px; padding-right: 10px;" alt="Pinterest link" src="https://cdn-images.mailchimp.com/icons/social-block-v2/outline-dark-googleplus-96.png">
                                        		</a>
											</td>
                                		</tr>
                            		</table>
								</td>
							</tr>
						</table>
					</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
	</center>
</body>
</html>

【讨论】:

  • 谢谢@scoopzilla。我将它们全部放在单独的表格中的原因是它可以更具响应性。在真正的渲染引擎上工作得很好,哈哈。这就是为什么我不想把每一个都放在一个 中。是的,这些阴影都不适用于 Outlook,但它们会出现在更现代的客户端中,如果特定客户端不支持它们也没有什么坏处。当我回到办公室时,我一定会尝试一下。再次感谢!
  • @addison0043 你可以让它们做出响应,而不是把它们放到表格中。
【解决方案2】:

要使表格具有响应性,只需添加这样的媒体查询(直接子选择器不会影响此表格中的表格):

代码

<table class="responsive-table">
    <tbody>
    <tr>
        <td>1</td>
        <td>2</td>
        <td>3</td>
        <td>4</td>
    </tr>
    </tbody>
</table>

媒体查询:

<style>

    @media all and ( max-width: 600px ) {
        .responsive-table, .responsive-table > tbody, .responsive-table > tbody > tr, .responsive-table > tbody > tr > td {
            display: block !important;
            width: 100% !important;
        }
    }
</style>

您可以根据自己的需要进行调整

【讨论】:

    猜你喜欢
    相关资源
    最近更新 更多
    热门标签