css - 如何覆盖文本样式 : underline for all anchor tags in one specific case 的 CSS 定义

标签 css html-email

我使用的是预制电子邮件模板,标题中包含简单的 CSS。它定义了所有要加下划线的 anchor 标签。我想在一个用例中覆盖它。当我为那个案例创建一个名为“top-header-links”的类时,虽然它确实覆盖了文本颜色,但它不会覆盖下划线样式。

        <style type="text/css">
        p { padding: 0; margin: 0; }
        h1, h2, h3, p, li { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
        td { vertical-align:top;}
        ul, ol { margin: 0; padding: 0;}
        a {
            color: #455670; text-decoration: underline;
        }
        .title, .date {
            text-shadow: #8aa3c6 0px 1px 0px;
        }
        .title span { 
            font-weight: bold;
        }
        .textshadow {
            text-shadow: #ffffff 0px 1px 0px;
        }
        .trxtshadow-2 {
            text-shadow: #768296 0px -1px 0px;
        }
        .content-item p{
            font-size: 12px; line-height: 20px; font-weight: normal; color: #56667d; margin: 0; margin-bottom: 10px;
        }
        .content-item h3{
             margin:0; margin-left: 17px; padding:0; font-size: 18px; font-weight: normal; color:#324258 !important;
        }
        .footer p{
             margin:0; font-size: 10px; font-weight: bold; color: #96a2b3; font-family: Arial; line-height: 18px;
        }
        .top-header p{
            margin: 0; font-size: 10px; font-weight: normal; color: #777777; line-height: 15px !important;
        }
        .top-header-links p{
            margin: 0; font-size: 10px; color: #aaaaaa; text-decoration:none !important;
        }
    </style>
</head>
<body marginheight="0" topmargin="0" marginwidth="0" leftmargin="0" background="" style="margin: 0px; background-color: #eee; background-image: url(''); background-repeat: repeat;" bgcolor="">
    <table cellspacing="0" cellpadding="0" align="center" width="500">
        <tbody>
            <tr>
                <td valign="middle" align="center" height="78" style="vertical-align: middle;" class="top-header">
                    <multiline label="Open in your Web Browser link" class="top-header-links">
                        <p >Are you having trouble viewing this Newsletter? <a href="http://blah.net">Click Here</a> to open this newsletter in your <a href="http://blah.net">web browser</a>. To let us know your mail client is not compatible with our newsletter, <a href="mailto:info@beyondzeroemissions.org.au"</a>Click Here.</p>
                    </multiline>
                </td>
            </tr>
        </tbody>    
    </table>

最佳答案

这应该可以解决问题:

.top-header-links a{
        margin: 0; font-size: 10px; color: #aaaaaa; text-decoration:none !important;
    }

关于css - 如何覆盖文本样式 : underline for all anchor tags in one specific case 的 CSS 定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8557346/

相关文章:

css - 移动设备和桌面设备的电子邮件布局不同

html - 什么是 MSO? [电子邮件模板 Outlook HTML]

javascript - 我的 css 类没有通过,使用 JQuery toggleClass

html - 第二张图片在 IE 中显示为镜像 --- CSS image FLIP transform- How to fix?

html - 如何让标题中的背景图像保持固定,并且标题小于全屏?

php - 通过嵌套的 while 循环保证 div

javascript - 纯 JavaScript 模态图像的问题

android - 单击电子邮件链接时未找到处理 Intent 操作的 Activity 。查看

html - 我可以抑制 HTML5 "email"字段的 UA 验证吗?

android - 在android中的电子邮件正文中发送带有数据库表的Html电子邮件