1

What does it mean if the style is missing inside the css rule? It also has no effect on the element.

There's an empty CSS rule in firebug. I know that if a certain style is overwritten, the style is crossed but I'm not sure what it means if the style is missing inside the css rule. I created the rule to affect the padding-top for the element below.

<div id="leadspace-head" class="alternate"> <div id="leadspace-body"> <ul id="navigation-trail"> <li>test</li> </ul> <h1 class="small">Title for this page</h1> </div> </div> 

Here's the scenario. I have 3 css rules below for the html code above. The first one is inside the body and the other 2 rules can be found in the css file. The 2nd rule overwrites the 3rd rule. I added the 1st rule to overwrite the 2nd rule but it has no effect and shows empty rule in firebug.

CSS within body

.landing-page #leadspace-head.alternate #navigation-trail + h1 { padding-top: 9px !important; } 

CSS in mystyle.css

.landing-page #leadspace-head.alternate #navigation-trail + h1 { padding-bottom: 10px; padding-top: 9px; } .landing-page #leadspace-head #navigation-trail + h1 { padding-top: 5px; } 
3

1 Answer 1

1

Your styles seem to be overriding each other a lot. You may want to investigate ways in which you can get better use of the inheritance rules in CSS.

That aside, try re-writing your rule to this:

#navigation-trail h1.small { padding-top: 9px; } 

That will specifically target those H1 elements that fall under your #navigation-trail list element.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.