New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Stumped by Portal.css in DNN 7.4Stumped by Portal.css in DNN 7.4
Previous
 
Next
New Post
7/7/2015 12:03 PM
 

I'm having difficulty getting changes made in "portal.css" recognized on my site in DNN 7.4.1 using the stock "Gravity" skin, and am confused as to the order of precedence of this stylesheet. My understanding is that portal.css is supposed to be the highest precedence, and anything I define in it would override other declarations, but this doesn't seem to be the case. 

As a simple test, I changed the definition of "Body" to be "background-color: red". (Using Admin->Site Settings->Stylesheet Editor).

I then bring up F12 dev tools in Internet Explorer with a site page loaded, to inspect the CSS rules being applied, and what I see is that "skin.css" is taking precedence over "portal.css". I see where my rule has been defined, but it's being overridden by a rule in skin.css. At least that's how I interpret it. The following screen shot shows what I'm referring to:

Could someone help me understand this, if I am interpreting this correctly, and if this is unexpected (a bug?)?

 

 
New Post
7/7/2015 12:14 PM
 
Hi Robert,

CSS specificity is also important. The id "Body" that is in the skin.css is more specific than the element name. Try changing your CSS definition to use "#Body{background-color:red}" and it should override the skin.css. Also, if this is to be a permanent change to the CSS, it is recommended to make your changes to the skin.css, instead of the portal.css as any Admin could go in and remove all of your updated styles.


Ralph Williams, Jr.
UX Designer / Front-End Web Developer
www.RalphWilliams.com
Ralph Williams Consulting
Twitter: twitter.com/ralphwilliams

Professional DNN7: Open Source .NET CMS Platform
 
New Post
7/7/2015 12:16 PM
 
You have been bitten by specificity. an ID selector trumps an element selector.

http://www.smashingmagazine.com/2007/...

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
New Post
7/7/2015 1:39 PM
 
Thanks guys. I should have known it was my lack of CSS knowledge rather than a DNN issue. ;-)

Bob
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Stumped by Portal.css in DNN 7.4Stumped by Portal.css in DNN 7.4


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.