【问题标题】:Blue underscore showing up in img tag HTML5 [duplicate]蓝色下划线出现在 img 标签 HTML5 [重复]
【发布时间】:2020-04-28 21:19:04
【问题描述】:

我正在为电子邮件编写 HTML5。 因此,我必须内联完成所有 CSS 样式。我有一张包含三张图片的表格(全部托管在谷歌驱动器上),但是这个奇怪的蓝色下划线出现了?

如图: https://imgur.com/a/F4Metod

相关 HTML:

    <table align="center"  style="max-width: 400px">
        <tr align="center">
            <td>
                <a href='https://www.twitter.com'>
                    <img src="http://drive.google.com/uc?export=view&id=1txAOBZTXT_J8RcM7fDaKXT-oO8hWV1fb" width="40" height="40"/>
                </a>


                <a href='https://www.facebook.com'>
                    <img  style="margin:0px 10px" src="http://drive.google.com/uc?export=view&id=1nFoCmmlS1Kl3nKXkJk9eDaRqglpTeVP1" width="40" height="40"/>
                </a>


                <a href='https://www.instagram.com'>
                    <img src="http://drive.google.com/uc?export=view&id=1LcrU78sAidvlnnzL28TgdaIYBY9xcN7q" width="40" height="40"/>
                </a>
            </td>

        </tr>
    </table>

【问题讨论】:

  • 文本装饰:没有链接

标签: html css image


【解决方案1】:

看起来这些是锚标记 (&lt;a&gt;) 的默认下划线,因此在它们上添加 style="text-decoration: none" 应该可以解决它。

【讨论】:

    【解决方案2】:

    下划线很可能是链接中的空格字符。尝试删除链接标签中标签之间的所有空格。并删除链接中源文档中的所有换行符。

    【讨论】:

      【解决方案3】:

      要删除此蓝色下划线,请将 text-decoration: none; 添加到 &lt;a&gt; 元素的样式中。

      这是您的代码:

      a {
        text-decoration: none;
      }
      <table align="center"  style="max-width: 400px">
              <tr align="center">
                  <td>
                      <a href='https://www.twitter.com'>
                          <img src="http://drive.google.com/uc?export=view&id=1txAOBZTXT_J8RcM7fDaKXT-oO8hWV1fb" width="40" height="40"/>
                      </a>
      
      
                      <a href='https://www.facebook.com'>
                          <img  style="margin:0px 10px" src="http://drive.google.com/uc?export=view&id=1nFoCmmlS1Kl3nKXkJk9eDaRqglpTeVP1" width="40" height="40"/>
                      </a>
      
      
                      <a href='https://www.instagram.com'>
                          <img src="http://drive.google.com/uc?export=view&id=1LcrU78sAidvlnnzL28TgdaIYBY9xcN7q" width="40" height="40"/>
                      </a>
                  </td>
      
              </tr>
          </table>

      现场演示:https://codepen.io/marchmello/pen/PoPjgZE?editors=1100

      【讨论】:

        猜你喜欢
        • 2021-12-01
        • 2015-04-14
        • 2021-09-06
        • 2017-11-19
        • 1970-01-01
        • 1970-01-01
        • 2012-04-26
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多