相关疑难解决方法(0)

我可以在css中指定maxlength吗?

我可以用CSS中的某些东西替换maxlength属性吗?

<input type='text' id="phone_extension" maxlength="4" />
Run Code Online (Sandbox Code Playgroud)

html css

78
推荐指数
4
解决办法
10万
查看次数

input [type ='text'] CSS选择器不适用于默认类型的文本输入?

默认输入类型是"text".我一直认为,input[type='text']即使未在控件上显式声明类型,CSS声明目标也会影响这些输入.但是,我只是注意到我的默认类型文本输入没有获得样式.为什么会这样?我该如何解决这个问题呢?

input[type='text'] {
  background: red;
}
Run Code Online (Sandbox Code Playgroud)
<input name='t1' type='text' /> /* Is Red */
<input name='t1' /> /* Is Not Red */
Run Code Online (Sandbox Code Playgroud)

css css-selectors

64
推荐指数
3
解决办法
22万
查看次数

标签 统计

css ×2

css-selectors ×1

html ×1