【问题标题】:Absolutely ZERO bolding, cant get rid of bold text绝对零粗体,无法摆脱粗体文本
【发布时间】:2020-02-25 16:41:56
【问题描述】:

我正在整理一封 html 电子邮件,但似乎无法摆脱粗体文本。从下面提供的代码中可以看出,没有什么可以解释为什么我的正文被限制为粗体。我不知道为什么会这样,我的代码中没有任何内容启用了粗体。有谁碰巧知道为什么会这样?我没有使用标签,没有,也没有字体粗细。这让我发疯了。

<html>
    <head>
    <meta charset="utf-8">
    <!-- utf-8 works for most cases -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- Forcing initial-scale shouldn't be necessary -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <title>text</title>


    <!-- CSS Reset -->
    <style type="text/css">

html,  body {
    margin: 0 !important;
    padding: 0 !important;
    height: 100% !important;
    width: 100% !important;
}
/* What it does: Stops email clients resizing small text. */
* {
    -ms-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}
/* What it does: Forces Outlook.com to display emails full width. */
.ExternalClass {
    width: 100%;
}
/* What is does: Centers email on Android 4.4 */
div[style*="margin: 16px 0"] {
    margin: 0 !important;
}
/* What it does: Stops Outlook from adding extra spacing to tables. */
table,  td {
    mso-table-lspace: 0pt !important;
    mso-table-rspace: 0pt !important;
}
/* What it does: Fixes webkit padding issue. Fix for Yahoo mail table alignment bug. Applies table-layout to the first 2 tables then removes for anything nested deeper. */
table {
    border-spacing: 0 !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
    margin: 0 auto !important;
}
table table table {
    table-layout: auto;
}
/* What it does: Uses a better rendering method when resizing images in IE. */
img {
    -ms-interpolation-mode: bicubic;
}
/* What it does: Overrides styles added when Yahoo's auto-senses a link. */
.yshortcuts a {
    border-bottom: none !important;
}
/* What it does: Another work-around for iOS meddling in triggered links. */
a[x-apple-data-detectors] {
    color: inherit !important;
}
</style>

    <!-- Progressive Enhancements -->
    <style type="text/css">

        /* What it does: Hover styles for buttons */
        .button-td,
        .button-a {
            transition: all 100ms ease-in;
        }
        .button-td:hover,
        .button-a:hover {
            background: #555555 !important;
            border-color: #555555 !important;
        }

        /* Media Queries */
        @media screen and (max-width: 600px) {

            .email-container {
                width: 100% !important;
            }

            /* What it does: Forces elements to resize to the full width of their container. Useful for resizing images beyond their max-width. */
            .fluid,
            .fluid-centered {
                max-width: 100% !important;
                height: auto !important;
                margin-left: auto !important;
                margin-right: auto !important;
            }
            /* And center justify these ones. */
            .fluid-centered {
                margin-left: auto !important;
                margin-right: auto !important;
            }

            /* What it does: Forces table cells into full-width rows. */
            .stack-column,
            .stack-column-center {
                display: block !important;
                width: 100% !important;
                max-width: 100% !important;
                direction: ltr !important;
            }
            /* And center justify these ones. */
            .stack-column-center {
                text-align: center !important;
            }

            /* What it does: Generic utility class for centering. Useful for images, buttons, and nested tables. */
            .center-on-narrow {
                text-align: center !important;
                display: block !important;
                margin-left: auto !important;
                margin-right: auto !important;
                float: none !important;
            }
            table.center-on-narrow {
                display: inline-block !important;
            }

        }

    </style>
    </head>
    <body bgcolor="white" width="100%" style="margin: 0;" yahoo="yahoo">
    <table bgcolor="white" cellpadding="0" cellspacing="0" border="0" height="100%" width="100%" style="border-collapse:collapse;">
      <tr>
        <td><center style="width: 100%;">

            <!-- Visually Hidden Preheader Text : BEGIN -->
            <div style="display:none;font-size:1px;line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;mso-hide:all;font-family: sans-serif;"> Title</div>
            <!-- Visually Hidden Preheader Text : END --> 


            <!-- BEGIN -->
            <table cellspacing="0" cellpadding="0" border="0" align="center" bgcolor="white" width="700" class="email-container"><br>



            <!-- BODY - START -->
        <tr>
            <td>
                <table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
                    <tr>
                        <td style="padding: 0px; font-family: Proxima Nova, sans-serif; font-size: 14px; line-height: 15px; color: black;">
                        <br>

                            <div style="max-width: 100%; max-height: 100%;">
                            <img src="" style="width: 25%; position: relative; margin-bottom: -12px;" align="left">
                            </div>

                            <!-- line break -->
                            <div align="center">
                                <hr height="1px" width="98%" color="#555555" align="center" style="display:inline-block;">
                            </div>
                            <br>
                            <br>

                            <!-- title --->
                            <div style="max-width: 100%; padding-left: 5px; position: relative;">

                                <h2>Text</h2>


                                <h3>Text</h3>

                            </div>
                            <br>
                            <br>
                            <br>


                            <!-- Image --> 
                            <div style="max-width: 100%; max-height: 100%">
                                <img src="" width="100%" alt="text">

                            </div>


                        <br><br>
                             <u><h4>Text</h4></u>
                                <ul>
                                    <li>Text</li><br>
                                    <li>Text</li><br>
                                    <li>Text</li><br>
                                    <li>Text</li><br>
                                </ul>

                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <br>
        </center>
        </td>
      </tr>
    </table>
</body>
</html>

【问题讨论】:

    标签: html css


    【解决方案1】:

    检查字体系列。我会说删除 font-family: "Proxima Nova" 并再次检查。尝试同时删除 proxima nova 和 sans-serif

    【讨论】:

      【解决方案2】:

      也许用户代理样式表添加了粗体

      font-weight: 100;
      

      这将去掉粗体。

      【讨论】:

        【解决方案3】:

        h3 {
          font-weight: normal;
        }
        <h2>This TEXT is Bold</h2>
        <h3>This TEXT is Normal</h3>

        根据 HTML 标准 h1,h2,h3..h6 被视为标题,因此您可以根据需要对其进行修改。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2014-09-04
          • 1970-01-01
          • 2011-03-09
          • 1970-01-01
          • 2013-01-31
          • 1970-01-01
          • 2016-03-18
          相关资源
          最近更新 更多