Customer Support Portal
Home>Knowledge Base>Root>DNN Development>How can I add an additional stylesheet to my skin or container in DNN?
User Login
Article ID15
Created On7/16/2009
Share With Others

How can I add an additional stylesheet to my skin or container in DNN?

By default skins and containers implement the stylesheet skin.css and container.css which resides in the skin/container folder. Sometimes however you may find you need to add an additional stylesheet to a specific skin or container. The easiest way to do this is by simply creating a new stylesheet file in you skin/container folder and giving it the same name as you skin/container. For example if your skin file is called "myskin.ascx" name your stylesheet "myskin.css". DotNetNuke will automatically recognize the stylesheet as belonging to your skin and will insert it for you.

This method is a great way to separate your base classes which apply to all your skins/containers and create individual stylesheets for each skin with specific classes for that particular skin/container.

Note: When creating a new skin or container sometimes it seems DNN does not see your stylesheet. This happens if you create a container/skin and test it before creating your stylesheet. DNN caches the skin/container without its stylesheet so if you later add your stylesheet it may not be recognized by DNN. To resolve this simply restart the application from the host settings to flush the cache. Reload your page and the stylesheet is now loaded.