如何在删除原始边框时取消按钮按下后的蓝色高亮显示?

10

如果单击按钮时没有其原始边框,我不想要蓝色边框,以下是HTML代码:

<div id="buttonholder" style="border 1px solid black">
    <button id="previous">&lt; Previous round</button>
    <button id="next">Next round &gt;</button>
    <button id="current">&gt; Current round&lt;</button>

    <div style="font-size: 0;">
        <form id="inputfield" name="inputfield">
            <input type="inputfield" value="Search for round here...">
            <input type="button" value="Go">
        </form>
    </div>

    <div id="displayround">
        1/38
    </div></button>
</div>

如果我需要发布整个CSS,请告诉我,我只是把它加在HTML中以使它更短。

4个回答

11
在Chrome中,蓝色边框是由于focus伪类而不是active所造成的。在该选择器中设置outline: none即可消除这种情况:
button:focus, input[type="button"]:focus {
    outline: none;
}

2

这是由于大多数浏览器默认样式中:active状态下的outline属性引起的。

button:active, input[type="button"]:active {
    outline: none;
}

这个想法本来应该有效,但是它仍然让蓝色出现了? :/ - Duplo W

1

您的问题有点含糊,但是可以尝试使用“outline:none;”


0

我认为你要找的是在CSS中使用:visited。

如果它是一个锚标签,请尝试:

a:visited {
   text-decoration: none;
   border: none;
   color: black; /* change to your desired color */
}

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接