小さな画面でボーダーベースのボタンを全幅にしようとしています。これはJSを使用できない電子メール用であるため、CSSとHTMLを介して作業する必要があります。小さな画面で表のボタンを全幅にする
アイデア?
メディアクエリを使用しようとしましたが、動作しませんでした。
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'を使っていないのはなぜですか? –