【问题标题】:I have a Problem with a border from a button tag我对按钮标签的边框有疑问
【发布时间】:2020-09-23 19:02:29
【问题描述】:

我用这段代码做了一个按钮:

我已经添加了一些 CSS 代码:

.btn {
  width: 100%;
  height: 50px;
  background-color: #3f9a39;
  color: white;
  border: none;
  text-transform: uppercase;
  letter-spacing: 2px;
}
fieldset{
  padding:0;
}
<fieldset>
   <button type="submit" class="btn btn-lg" id="submit" value="Submit">Ihre Nachricht absenden</button>
</fieldset>

目前它看起来像这样: https://i.stack.imgur.com/JSxKG.png

您可以看到我有一个边框,但我怎样才能删除边框?

我已经试过了:

    border: none;
    outline: none;

此致

【问题讨论】:

    标签: html css button border fieldset


    【解决方案1】:

    这是因为fieldset 没有带按钮。试试这个

    fieldset {
       border: none; // or use border:0;
    }
    

    现场演示

    .btn {
      width: 100%;
      height: 50px;
      background-color: #3f9a39;
      color: white;
      border: none;
      text-transform: uppercase;
      letter-spacing: 2px;
    }
    fieldset{
      border:none;
    }
    <fieldset>
       <button type="submit" class="btn btn-lg" id="submit" value="Submit">Ihre Nachricht absenden</button>
    </fieldset>

    【讨论】:

    • 您能否接受它作为答案,以便将问题标记为已解决。谢谢。
    • 当然 - 对不起,我是新来的,所以不知道堆栈溢出的每个函数。
    猜你喜欢
    • 1970-01-01
    • 2021-12-22
    • 1970-01-01
    • 1970-01-01
    • 2014-12-01
    • 1970-01-01
    • 2023-03-22
    • 2022-09-27
    • 2020-12-30
    相关资源
    最近更新 更多