gpt4 book ai didi

css - :focus not working as expected in IE

转载 作者:太空宇宙 更新时间:2023-11-04 11:29:59 28 4
gpt4 key购买 nike

我对我处理过的聊天后调查窗口的可访问性有疑问。右上角有一个关闭按钮(作为 X 的图像),我通过放置焦点伪类来包含视觉焦点,现在我面临的问题是关闭按钮在聚焦时周围有白色边框,这在 chrome、Mozilla 中如预期的那样发生,但在 IE 中会出现蓝色边框。谁能帮我去掉这个蓝色边框并用白色代替它?

我正在分享我使用焦点的代码片段

a.close-link:focus {
outline: 1px dotted white;
}

最佳答案

虽然 active 和 focus 是不同的状态,但我认为你可以同时尝试两者以达到你的目的

:active       Adds a style to an element that is activated
:focus Adds a style to an element that has keyboard input focus
:hover Adds a style to an element when you mouse over it
:lang Adds a style to an element with a specific lang attribute
:link Adds a style to an unvisited link
:visited Adds a style to a visited link

关注来源 http://www.w3schools.com/CSS/css_pseudo_classes.asp

a.close-link:focus, a.close-link:active {
outline: 1px dotted white;
}

关于css - :focus not working as expected in IE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32087313/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com