Pages

Nov 5, 2012

How to set css for asp.net server controls globally.

Usually Asp.Net controls like textbox, button ,radio button, checkbox are seen as input controls with different types like text,submit,radio etc...

So to set the CSS for the server controls

/* Global font for server controls */

textbox
input[type="text"]
{
    font-family: Verdana;
    font-size: 10px;
      width:160px;
}

textbox with textmode = password 

input[type="password"]
{
      width:160px;
}


Multiline text box
textarea
{
    font-family: Verdana;
    font-size: 10px;
      width:165px;
}


// for radio button/ check boxes
label
{
    font-family: Verdana;
    font-size: 10px;
}

For list boxes
select {
      /*font-family:Arial,Verdana,sans-serif; */
      font-family: Verdana;
      font-size:10px;
      font-weight:500;
}
 
/* Global font for server controls */ 

No comments: