views:

124

answers:

2

DotNetNuke uses quite a few preset classes like .Normal, .Head, .SubHead, etc. in spans inside other classless spans etc. that I find really annoying and rather than figuring out how to work with them I'm considering overriding them by having them all inherit their styles from their parent, but I'm curious if others have already given this a try and have stories to tell of success or fallen foul of something on the module / admin end that makes this a fruitless task?

Thanks, Steve

+1  A: 

This really depends on your project. If you're developing a commercial product, my recommendation is to learn how to work with the styles so that you have high compatibility with the DotNetNuke core as well as third party extensions (skins & modules).

I would say if you have complete control over the site it may well be worth it to you to follow your own conventions and bypass the DNN selectors altogether.

That approach would be to create skins and containers that define regions with specific class names. You could then define styles for elements within those regions based on what the element actually is rather than what class is applied to it.

You will probably want to clean up or remove the contents of the default.css file as well (\portals_default\default.css).

Ian Robinson
Thanks Ian - We're in a commercial environment supporting many DNN sites. I'm loath to do anything with the default.css as I have a nagging suspicion that someone will override it during an upgrade at some point. This is what prompted me to think of .Head,.Normal,.SubHead{color:inherit;font-family:inherit;} etc.
Steve Perks
A: 

I would add another stylesheet that appends or overrides the default styles. This way, you can recast the default styles without editing the default stylesheet.

Use the cascading nature of CSS to your favor!

In cases where styles are new, make sure to namespace them with an outside container.

mmcglynn