CSS Selector for <input type=“?”

前端 未结 4 1498
Happy的楠姐
Happy的楠姐 2020-11-28 21:54

Is there any way with CSS to target all inputs based on their type? I have a disabled class I use on various disabled form elements, and I\'m setting the background color fo

4条回答
  •  失恋的感觉
    2020-11-28 22:52

    Sadly the other posters are correct that you're ...actually as corrected by kRON, you are ok with your IE7 and a strict doc, but most of us with IE6 requirements are reduced to JS or class references for this, but it is a CSS2 property, just one without sufficient support from IE^h^h browsers.

    Out of completeness, the type selector is - similar to xpath - of the form [attribute=value] but many interesting variants exist. It will be quite powerful when it's available, good thing to keep in your head for IE8.

    • w3 reference

    • browser support reference

提交回复
热议问题