【问题标题】:text-decoration: none; not working on button | css [duplicate]文字装饰:无;按钮不工作 | css [重复]
【发布时间】:2022-01-24 02:15:02
【问题描述】:

我的代码无法正常工作,我正在尝试制作视频按钮 我试过 text-decoration: none!important;和边框底部:0; 但似乎没有任何效果

css

    .btn1 {
      font-family: 'Be Vietnam Pro', sans-serif;
      background-color: rgb(255, 255, 255);
      border: none;
      color: rgb(0, 0, 0);
      padding: 14px 40px;
      text-align: center;
      text-decoration: none;
      display: inline-block;
      margin: 4px 2px;
      cursor: pointer;
      font-size: 30px;
      border-radius: 32px;
      background-color: #ffffff;
      border-bottom: 0;
      box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24), 0 17px 50px 0 rgba(0,0,0,0.19);
    }
    
    .btn1:hover {
      text-decoration: none;
      box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24), 0 17px 50px 0 rgba(0,0,0,0.19);
    }

html

  <button class="btn1" data-aos="zoom-in-up" data-aos-duration="1500" ><a href="https://www.youtube.com">Why us?</a></button>

我真的很需要帮助 谢谢

【问题讨论】:

  • 您希望看到什么,而您又看到了什么?另外,使用的 HTML 是invalid

标签: html css text-decorations


【解决方案1】:

您必须将其应用于锚标记,而不是将其应用于按钮。 应该是这样的:

.btn1 a {
  text-decoration: none;
}

【讨论】:

  • 那将是正确的答案! +1 对我来说
猜你喜欢
  • 1970-01-01
  • 2020-07-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-04-10
  • 2013-01-12
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多