屬性選擇器(通常用在input)


  1.  input[type="text"]{}

                   選中屬性值為text的input

       2.  input[type|="text"]{}

                   選中以text-開始的input的type屬性值

                   <input type="text-sadads">

        3. input[type^="text"]{}

                   選中標簽中type屬性以text屬性值開始

                   注:該聲明表示屬性值有多個並每一個屬性值之間用空格隔開

                    例如:    <input type="text sadads">

       4.  input[type*="text"]{}

                   選中input標簽中type屬性包含text屬性值,屬性值之間可不隔開

                     例如:   <input type="sadtextsadads">

       5.  input[type~="text"]{}

                   選中input標簽中type屬性包含text屬性值

                   注:該聲明表示屬性值有多個並每一個屬性值之間用空格隔開

                    例如:<input type="sadds text sadads">

       6.  input[type$="text"]{}

                   選中標簽中type屬性以text屬性值結束

                   例如:<input type="ssd text">


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM