首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >覆盖Chrome UA文本输入样式

覆盖Chrome UA文本输入样式
EN

Stack Overflow用户
提问于 2012-02-20 17:07:30
回答 1查看 2.1K关注 0票数 0

因此,在Chrome中,文本输入添加了类似于2px inset的边框。我得到的是:

代码语言:javascript
复制
.search-form p input[type=text] {    
    width: 170px;        
}

.search-form是:

代码语言:javascript
复制
.search-form {
    width: 174px;    
    padding: 10px;
    border: 1px solid #F2E1D5;
}

如何检查这是否是Chrome UA,或者如何覆盖规则?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-02-20 18:00:26

Chrome重新启动输入的默认样式表如下所示:

代码语言:javascript
复制
input, input[type="password"], input[type="search"], isindex {
    -webkit-appearance: textfield;
    padding: 1px;
    background-color: white;
    border: 2px inset;
    border-image: initial;
    -webkit-rtl-ordering: logical;
    -webkit-user-select: text;
    cursor: auto;
}

input, textarea, keygen, select, button, isindex {
    margin: 0em;
    font: -webkit-small-control;
    color: initial;
    letter-spacing: normal;
    word-spacing: normal;
    line-height: normal;
    text-transform: none;
    text-indent: 0px;
    text-shadow: none;
    display: inline-block;
    text-align: -webkit-auto;
}

因此,只需使用您自己的属性覆盖这些属性。假设你想让所有地方的东西看起来都一样,所以只要按照你喜欢的方式设计边框就行了。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9358497

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档