【发布时间】:2014-01-29 09:37:42
【问题描述】:
我想在文本输入获得焦点时添加蓝色阴影突出显示:
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 中看起来不错,但 Chome 添加了一些内部 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 中的外观?
【问题讨论】:
-
您是否在 html 页面的第一行添加了
<!DOCTYPE html>?
标签: css html google-chrome firefox input