By Larry J. Riemann
When developing SharePoint Web Parts, there is often a need to style the content of those Web Parts using cascading style sheets (CSS). For Web Parts that will leverage known or existing styles, this is as easy as adding the class name to each element that is to be styled. However, for creating new styles or extending existing ones, that matter is not so clear-cut. In these scenarios, you have many options at your disposal, all of which have pluses and minuses.
Some of the options include:
Including the new or extended styles in a new or existing CSS file that will be linked on every page whether the Web Part is in use or not.
Declare the styles inline in the HTML using style tags.
Add the link to the CSS file through code.
The last option can be the cleanest. It allows you to only load the style(s) for the Web Part if needed, and it keeps the styles in a separate file.
Read the rest of the article here.
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment