设定input的CSS用input {
}如果只针对input下的text类型,也就是文本匡该如何设定

解决方案 »

  1.   


    <style>
    .googleSearch
    {
        border: 1px solid rgb(126, 157, 185); 
        padding: 2px; 
        background: rgb(255, 255, 255) url(http://www.google.com/coop/images/google_custom_search_water.gif) no-repeat scroll left center; 
        -moz-background-clip: -moz-initial; 
        -moz-background-origin: -moz-initial; 
        -moz-background-inline-policy: -moz-initial;
    }
    .tipSearch
    {
        background:#FFFFFF url(http://blog.eshangrao.com/themes/WebPlume/img/q.png) no-repeat scroll 4px center;
        padding-left:18px;}
    </style>
    <body>
    <input type="text" size="40" class="googleSearch"/>
    <input type="text" size="40" class="tipSearch"/>
    </body>
      

  2.   

    新的方法
    input[type=text] 
    {
    background-color: #FFCC33;
    }
      

  3.   

    新建一个CSS样式表文件,命名为textbox.css,添加如下的样式代码。input
    {
       font-family:verdana;
       font-size:9pt;
       color:#FF6699;
       background-color:#CCCCFF;
    }然后将此css文件应用到页面中。
      

  4.   

    给id或class是目前最好的方法,input[type=text]不兼容某些老的浏览器。
      

  5.   


    <head>
    <style>
      .txt 
      {
         BORDER-RIGHT: #2C59AA 1px solid;
         BORDER-TOP: #2C59AA 1px solid;
         BORDER-LEFT: #2C59AA 1px solid;
         BORDER-BOTTOM: #2C59AA 1px solid;
                
         CURSOR: hand;
         COLOR: black;     height: 21px;
         padding-top: 3px;
      }
    </style><body>
    <form>
    <asp:TextBox ID="tParentId" runat="server" Enabled="False" Width="350px" CssClass="txt"></form>
    </body>cssclass中引用你定义的style名