当文本输入框获得焦点时,我想添加蓝色阴影高亮:
input:focus {
box-shadow:0px 0px 5px #6192D1;
-webkit-box-shadow: 0px 0px 5px #6192D1;
-moz-box-shadow: 0px 0px 5px #6192D1;
outline: 0;
}
在Firefox中看起来很好,但是Chrome添加了一些内部3D边框。
Chrome添加了以下样式:
border-top-style: inset;
border-top-width: 2px;
border-bottom-style: inset;
border-bottom-width: 2px;
border-left-style: inset;
border-left-width: 2px;
border-right-style: inset;
border-right-width: 2px;
如果我设置了以下内容:
border-width: 2px;
border-color: transparent;
border-style: inset;
在Chrome中边框消失了,但在FF中会使字段在聚焦时调整大小。
有什么想法可以摆脱3D边框而不影响FF的外观?
<!DOCTYPE html>
吗? - Sid M