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

來源:互聯網
上載者:User

<br /><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><p><title></title><br /><select name="carCos" class="disabled"><optgroup label="American"></optgroup><br /><option value="General Motors">General Motors</option><option value="Ford">Ford Motor Company</option><option value="Chrysler">DaimlerChrysler</option><p><optgroup label="Japanese"></optgroup></select><p>用這種變態的方式可以實現,在firefox和ie6下看效果很好<br />
相關文章

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.