Here is an example from MSDN : // Create a Style object for the section of the Web page. Style bodyStyle = new Style(); bodyStyle.ForeColor = System.Drawing.Color.Blue; bodyStyle.BackColor = System.Drawing.Color.LightGray; // Add the style to the header of the current page. Page.Header.StyleSheet.CreateStyleRule(bodyStyle, this, "BODY"); It is the simple and handy method but has a few flaws. 1. Output is far from optimal. For example, following code that adds a border someStyle.BorderColor = System.Drawing.Color.Red; someStyle.BorderStyle = BorderStyle.Solid; someStyle.BorderWidth = new Unit("1px"); produces this output border-color:Red;border-width:1px;border-style:Solid; instead of border:Solid 1px Red; It has no matter if you don't pay attention to the size of pages you develop, but it is taken into consideration if you take into consideration your visitor's needs (sorry for tautology). But it's a trifle, of course. I mentioned it just for completene...