如何删除Bootstrap 4中输入元素周围的蓝色边框?

发布于 2025-02-09 11:11:01 字数 763 浏览 1 评论 0原文

每当我单击输入字段时,周围都会出现蓝色边框。如何删除或更改此问题?

        <div class="input-group mb-3">
          <input type="text" class="form-control" placeholder="Recipient's username" 
           aria-label="Recipient's username" aria-describedby="basic-addon2">
           <div class="input-group-append">
               <button type="button" class="btn btn-outline-primary mb- 2">Subscribe</button>
            </div>
          </div>

对于此代码,我编写了以下代码,但是它不是周围的蓝色边框,而是删除了输入内部的边框。

.input:focus {
outline: none !important;
}

enter image description here

Whenever I click on the input field, a blue border appears around it. How do I remove or change this?

        <div class="input-group mb-3">
          <input type="text" class="form-control" placeholder="Recipient's username" 
           aria-label="Recipient's username" aria-describedby="basic-addon2">
           <div class="input-group-append">
               <button type="button" class="btn btn-outline-primary mb- 2">Subscribe</button>
            </div>
          </div>

For this code, I wrote the following code, but instead of the blue border around it, it removed the border inside the input.

.input:focus {
outline: none !important;
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

锦爱 2025-02-16 11:11:02

您可以将box-shadow属性设置为none喜欢:

.form-control:focus {
    color: #495057;
    background-color: #fff;
    border-color: #80bdff;
    outline: 0;
    box-shadow: none!important;
}

如果您不需要,请删除Border Color属性。

You can set the box-shadow property to none like:

.form-control:focus {
    color: #495057;
    background-color: #fff;
    border-color: #80bdff;
    outline: 0;
    box-shadow: none!important;
}

remove the border color property too if you don't need it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文