0

我在两个按钮下方的html 电子邮件中并排有 两个按钮,有一个输入字段,在输入字段下方,有一个提交按钮

我希望这两个按钮起到切换的作用,并且输入字段将接受收件人的可选输入。这样,当单击提交按钮时,我会发送选定状态(即,如果选择了第一个按钮,则为是,如果选择或单击了另一个按钮,则为否)

我还打算通过在单击或悬停时更改所选按钮的背景来显示当前选择的选项。

问题是,我尝试使用

#button:hover

但是颜色变化不会持续存在并且在提交时,我不知道如何选择哪个按钮。

我也尝试将按钮包装在一个标签中,并使用

a:visited table #button

但是更改是永久性的,即使在刷新后,一旦单击它。

任何帮助将不胜感激。谢谢

编辑:

这是按钮的代码

<table cellspacing="0" cellpadding="0" align="center">
    <tr>
        <td id="frown" align="center" width="270" height="40" bgcolor="#D83934" style="-webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; color: #ffffff; display: block;">
            <a style="color: #ffffff; font-size:16px; font-weight: bold; font-family: Helvetica, Arial, sans-serif; text-decoration: none; line-height:40px; width:100%; display:inline-block">
                <img src="frowny.png">
            </a>
        </td>
    </tr>
</table> 

这是我尝试过的css

a:visited table #frown {
  background-color: #fff;
}

但是一旦单击并且背景发生变化,如果单击另一个按钮,我将无法返回原始颜色。

4

1 回答 1

0

Forms are not possible in html emails, mail clients sees forms as phishing attempts. So you need to link to a landingpage with a form on.

And for some email cliens strips the CSS in the top(gmail), so all CSS needs to be inline.

于 2013-11-13T14:50:19.140 回答