I'm trying to change the text layout of a SharePoint page using css rather than the browser editing tool. Ideally, I would like to apply the css direct into the .ASPX page? How can I achieve this? what are the id's associated with the text layout options?


1 Answer 1


As far as I understand, you want to add <styles> in the head section of generated HTML page. You can do this like this:

HtmlGenericControl styles = new HtmlGenericControl();
styles.TagName = "style";
styles.Attributes.Add("type", "text/css");
styles.InnerHtml = "myClass{color:#000000;}";

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.