Introduction

If we see the all controls which we created using HTML Helper, they all are overloaded. There is overload method in which we pass HtmlAttribute of type object. In this object we pass the object in which we define the style of control.

For Example

		
		@Html.Label("Enter your First name", new { style = "background-color:green; color:white; font-family:Arial" })
		
		

Similarly we can pass the CSS style to each control.

If we want to pass CSS class to any Control then we can use this code in following way:-

First create the CSS file. I added the CSS file name TechAltum in which I added one CSS code for Label

		
		.LableStyle { background-color:green; color:white; font-family:Arial}

		
		

Now pass this class code to the control

		
		@Html.Label("Enter your First name", new { @class="LableStyle" })
		
		

Note:-kindly attach the CSS file in head tag using following code:-

		
	<link href="~/TechAltum.css" rel="stylesheet" />
	
		

Output of this code as follows:-

		
		
		css implementation
		Figure 1
		
		

Email Address

For any query you can send mail at info@techaltum.com
Thanks