How to use css in TextBox – ASP.NET TextBox Example

– Css is used to apply the style on asp.net control.

STEP 1 :- Create New StyleSheet File in ASP.Net.

How to use css StyleSheet in ASP.NET - ASP.NET Textbox Exmaple

How to use css StyleSheet in ASP.NET – ASP.NET Textbox Exmaple

STEP 2 :- write the below style code in Stylesheet file.

.txt
{
background-color:Yellow;
font-size:large;
font-weight:bold;
}

STEP 3 : After creating Stylesheet file apply that style on webfom by writing below code in HEAD tag:

write below code in head tag:

<head runat=”server”>
<link rel =”Stylesheet” href=”styleSheet.css” />
</head>

Now you can set the CssClass Property of TextBox control CssClass = txt.

Create StyleSheet in ASP.NET - ASP.NET TextBox Example

Create StyleSheet in ASP.NET – ASP.NET TextBox Example

– Now you can see the output like :

Create Stylesheet in ASP.Net - ASP.NET Textbox Example

Create Stylesheet in ASP.Net – ASP.NET Textbox Example

– Css Style sheet we can apply selected control in ASP.Net while the Them will apply whole webform for all control.

– Hope you enjoyed this ASP.Net TextBox Example Css Tutorials.

Leave a Reply

Your email address will not be published. Required fields are marked *

nineteen + eight =