【问题标题】:How to remove outline on circular button when clicked单击时如何删除圆形按钮上的轮廓
【发布时间】:2017-10-13 05:12:47
【问题描述】:

当我单击圆形按钮时,如何移除圆形按钮周围的蓝色边框。

【问题讨论】:

  • 按钮:焦点{大纲:无;}
  • @RachelGallen 我很抱歉,不知道接受的答案功能。

标签: html css


【解决方案1】:

在本例中,我将border-color 从蓝色更改为transparent,并在:focus 上添加了outline:none;(也可以添加未启用)

希望对你有帮助

button {width:50px;
height:50px;
background-image:url("http://www.rachelgallen.com/images/purpleflowers.jpg");
background-size:70% 70%;
background-repeat:no-repeat;
background-position:center center;
border-width:3px;
border-style: solid;
border-color:#000099;
}
button:focus{
 border-color:transparent!important;
 outline:none;
}
<button>

</button>

【讨论】:

  • 有没有办法用 CSS 使轮廓变成圆形?
  • @evolross 你的问题已经被问过好几次了。查看this answer 以及相应问题的其他答案。
【解决方案2】:

使用outline属性:

selector {

 outline:none;

}

示例:

.btn {

     outline: none;
}
&lt;button class="btn"&gt;Click Me!&lt;/button&gt;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-09-24
    • 1970-01-01
    • 2016-04-10
    • 1970-01-01
    • 2021-07-09
    • 1970-01-01
    • 2014-01-02
    • 1970-01-01
    相关资源
    最近更新 更多