开发者

Can I differentiate CSS on the different input types?

开发者 https://www.devze.com 2023-01-17 20:44 出处:网络
input type=text/radio/checkbox - can I treat them differentl开发者_StackOverflow中文版y in my CSS?

input type=text/radio/checkbox - can I treat them differentl开发者_StackOverflow中文版y in my CSS?

Other than by adding class= I mean


YES!

With an awesome thing called attribute selectors:

input[type="text"] { width: 200px; }

Just change that text there and you're good to go!

But note that these don't work on IE6, so you might want to take a look at the dean.edwards.name IE7.js :)


You can use the attribute selector, like this

input[type=text] { ... }

However, this is not supported in all browsers. Your safest bet is to use a class


You can use input[type=text] to do this. Old browsers might not support it though.


Yes you can

eg

input[type="text"]{
/*do something*/
}

and more

input[type="text"] {
font:bold 10px/12px verdana,arial,serif;
padding:3px;
}
input[type="button"],input[type="submit"] {
/* you know what to do */
}


you can do input[type="text"]


You can use

input[type="What ever the type you want to style specifically"]


I've never seen this done (and I've personally tried). I believe you would have to have some JavaScript/jQuery run on the page post render to manipulate the classes of objects based on element attributes.

0

精彩评论

暂无评论...
验证码 换一张
取 消