CSS selector for text input fields?

后端 未结 9 756
广开言路
广开言路 2020-12-07 07:46

How can I target input fields of type \'text\' using CSS selectors?

9条回答
  •  北海茫月
    2020-12-07 08:20

    I usually use selectors in my main stylesheet, then make an ie6 specific .js (jquery) file that adds a class to all of the input types. Example:

    $(document).ready(function(){
      $("input[type='text']").addClass('text');
    )};
    

    And then just duplicate my styles in the ie6 specific stylesheet using the classes. That way the actual markup is a little bit cleaner.

提交回复
热议问题