我想听听纯CSS最好的做法 .
The Situation:
我有一个文本框,我可以在其中搜索特定的项目 . 然而,现在我也在使用几乎相同的文本框进行高级搜索,但advancedSearchTextbox的宽度小于默认值 .
My Question
设置文本框的最佳方法是什么?
My Solution
我现在解决了这个问题:
.defaultTextBox {
padding: 0;
height: 30px;
position: relative;
left: 0;
outline: none;
border: 1px solid #cdcdcd;
border-color: rgba(0,0,0,.15);
background-color: white;
font-size: 16px;
}
.advancedSearchTextbox {
width: 526px;
margin-right: -4px;
}
然后在HTML中,对于advancedSearchTextbox,它看起来像这样:
这是最好的方法吗?或者还有其他选择吗?至于其他1个文本框,它是可行的,但如果我需要更多文本框在其他页面上怎么办?
提前致谢 :)!