如何在css指定<input type="text">的控件

2025-02-26 05:50:34
推荐回答(5个)
回答1:

可以使用css的属性选择器来实现这个效果。具体实现方法如下:

input[type=text]{color:#ccc}

这样写就把所有type="text"的input文本框的文字颜色设置成了灰色。

回答2:

排除IE6
用css过滤

input[type=="text"]{
border:1px solid #ddd;
}

恩,这个css只有IE6以上版本才支持

否则,你只有在type==text的input加上特定的class了

回答3:

input[type="text"]{这里写你要对文本框的样式设置的一些属性以及其属性值}

回答4:

input[type=text]    // 属性type为text的input控件

回答5:

input.but
{
border:1px solid #ddd;
}