我的样式表中有
INPUT
{
font-size: 9pt;
font-family: SimSun;
height: 20px;
 border-style: groove  }
.checkbox
{
border-style: none; }
本意是除Checkbox中不要边框外,其他都要,但在Checkbox中指定的checkbox样式后还是没有用,该怎么写?

解决方案 »

  1.   

    看看这个
    http://www.iecn.cn/blog-html-do-showone-uid-8355-type-blog-itemid-2599.html
      

  2.   

    INPUT 

    font-size: 9pt; 
    font-family: SimSun; 
    height: 20px; 
     border-style: groove  } 
    .checkbox 

    border-style: none; border:0} 
      

  3.   

    或者INPUT  
    {  
    font-size: 9pt;  
    font-family: SimSun;  
    height: 20px;  
     border-style: groove  }  
    .checkbox  
    {  
     border:0}  
      

  4.   

    因为CheckBox生成的CLASS是放在SPAN中,所以不行
      

  5.   

    方法有2种:
    第一:
    input
    {
    font-size: 9pt;
    font-family: SimSun;
    height: 20px;
    border-style: groove;

    .span input
    {
    border-style: none;
    } 然后 <asp:CheckBox ID="CheckBox1" runat="server" Text="it is a check box" CssClass="span" /> 调用
      

  6.   

    第二,针对不同的类型,用不同的方式控制,这个也是以前在网上找的,是转载,供参考:<script language=javascript>
    switch(type)
    {
      case 'text':
      case 'file':
      case 'password': 
        style.border="1px solid #666666";
        style.backgroundColor="#FEFEFE";
        style.height="18px";
        style.font="normal 12px 細明體";
        style.color="#000000";
        break;
      case 'submit':
      case 'reset':
      case 'button': 
        style.border="1px solid #999999";
        style.backgroundColor="#E9E9E9";
        style.height="18px";
        style.font="normal 12px 細明體";
        style.color="#000000";
        break;
      default: 
        ;
    }
    </script>把上面的代碼存為input.htc(名字隨意,但要保證引用時統一),然後定義CSS:<style>
    input{behavior:url(input.htc)}
    </style>
      

  7.   

    input {
    font-family: 宋体;
    font-size: 12px;
    color: #000000;
    border: expression((this.type=="checkbox"||this.type=="radio"?"!important":"1px #ced4e2 solid")); /*如果定义0px,则在xp系统下就没有凹凸的效果了,所以这里只是把之前的定义取消*/
    background-color: #DBFBF7;
    }