尝试在小屏幕上使基于边框的按钮变为全角。需要通过CSS和HTML工作,因为这是一个无法使用JS的电子邮件。在小屏幕上使表格按钮变为全角
任何想法?
尝试使用媒体查询,但它没有奏效。
P.S.边框按钮这里描述的:https://litmus.com/blog/a-guide-to-bulletproof-buttons-in-email-design
.container {
width: 100%;
height: 300px;
background-color: #000000;
}
.link-button {
font-size: 16px;
font-family: Helvetica, Arial, sans-serif;
color: #ffffff;
text-decoration: none;
border-radius: 20px;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
background-color: #EB7035;
border-top: 12px solid #EB7035;
border-bottom: 12px solid #EB7035;
border-right: 18px solid #EB7035;
border-left: 18px solid #EB7035;
display: inline-block;
}
@media only screen and (max-width: 480px) {
.inner-table {
width: 100%;
}
}
<div class="container">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="outer-table">
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="0" class="inner-table">
<tr>
<td>
<a class="link-button" href="http://google.com" target="_blank">I am a button</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
你没有为小屏幕制作按钮100% – inarilo
你真的需要在不同分辨率下的不同行为吗?我的意思是,你可以让每个人都变宽,也可以保持原样。 – Anarion
为什么不使用'button'或'a'而不使用边框技巧呢? –