利用CSS控制SELECT中的OPTION是否不允許選_CSS/HTML

來源:互聯網
上載者:User
<html> <head> <style type="text/css"> .disabled { } .disabled optgroup{ font-size: 12px; font-style: normal; font-weight: normal; font-variant: normal; color:#CCCCCC; background-color: #F5F5F5; } .disabled option { padding-left:0px; } </style> <title></title> </head> <body> <select name="carCos" class="disabled"> <optgroup label="American"></optgroup> <option value="General Motors">General Motors</option> <option value="Ford">Ford Motor Company</option> <option value="Chrysler">DaimlerChrysler</option> <optgroup label="Japanese"> </optgroup> </select> 用這種變態的方式可以實現,在firefox和ie6下看效果很好 </body> </html>
[Ctrl+A 全選 注:如需引入外部Js需重新整理才能執行]
  • 相關文章

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.