Developing ASP.NET Server Controls and implementing CSS in it

You can implement CSS in the server controls that you add to the web pages during design time and even for the server controls that are created dynamically during runtime. We know that you need a placeholder to add controls to it dynamically when the program runs. You can add CSS styles to it if needed.

CSS is used to control the looks of a server control. Your browser needs to support CSS in order to view the controls properly as per the style you have created.

The appearance of the server controls like backcolor, height, width, and forecolor are determined by the CSS used for that control. Apart from these there are certain controls that also support style objects.

For example the Font style property exposes the FontInfo style object and you can use this object to set properties like Size, Bold, and Name. Inheritance of the style is also supported in some complex controls like the Calendar control.

If you are using CSS, you can either use it inline or as an external file and attach it to the page. if you are mixing both inline and external CSS, then the result cannot be predicted.