简体   繁体   English

带有自定义框阴影和焦点指示器的奇怪边框

[英]Strange border with custom box-shadow and focus indicator

I made sample with two number inputs with custom outline and box-shadow.我制作了带有自定义轮廓和框阴影的两个数字输入的示例 In Google Chrome I see strange black-gray border after focus on bottom input element.在谷歌浏览器中,我在关注底部输入元素后看到奇怪的黑灰色边框。

在此处输入图片说明

For this input I use对于这个输入,我使用

                  .shadowBox:focus {
                    outline: 1px black dotted !important;
                    box-shadow: 1px 1px grey;                    
                  }   

If I set box-shadow: none this strange border doesn`t appear.如果我设置box-shadow: none这个奇怪的边框box-shadow: none出现。 What I do wrong?我做错了什么?

在此处输入图片说明

EDITED .已编辑 Why this "strange border" appears on 'focus' if I use box-shadow?如果我使用 box-shadow,为什么这个“奇怪的边框”会出现在“焦点”上? This border exists only in Google Chrome, but not in Mozilla Firefox.此边框仅在 Google Chrome 中存在,而在 Mozilla Firefox 中不存在。

If you want to have both, the dotted outline And border solid you can have this instead:如果你想同时拥有,虚线轮廓和边框固体你可以用这个代替:

.shadowBox:focus {
  outline: 1px dotted black;
  border: 2px black solid;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM