well , lets address some concepts ( rather than code) here
…but this will most likely affect the navar-inner site wide.
if your style sheet are loaded site wide any and all code will affect the entire site. Sometimes , strategically breaking up style sheets is a good idea. If you want to override a behavior, but only on SOME PAGES and your site is large it is really the best way to do it. The other possibility would be to give the body element an ID or class aand ad those in the stylesheet to override your page rules ( heck even talking about doing it this way gets confusing tho).
incidentally, if you KNOW for certain that some CSS will only apply to ONE document and you wouldn’t be able to re use it, you can consider hard coding the CSS withing a style tag in the page ( as opposed to linking it in). The added advantage of this is that CSS in a style tag OVERRIDES linked CSS… no matter what.
The other concept to address here is CHILDREN vs DESCENDANTS
A child is directly contained within it’s parent … a descendant is within a root parent , but can be any level deep.
let say you wanted to affect ONLY ANCHORS in the root level of a menu (<ul class=‘nav’>…</ul>); we also know ONLY LI can be children of ULs.
.nav>li>a {...}
this means affect only the As which are the CHILD of the LIs whci are a CHILD of .nav
if you used .nav>li a {…}(oops!) this would mean affect ANY A within the LIs which are a CHILD of .nav. So this would mean that any link in sub menus would also be affected, follow? I like to think of ‘>’ as a directory path… you must give the whole path and specifically in order to reach your destination
now, let say you want to change a style 3 levels deep:
.nav li { .. your original style for level 1 & 2}
.nav li li>ul li {.. level 3 OVERRIDE RULES + additions}
if you wanted to make sure the change occured ONLY at level 3, but was back to regular at level 4:
.nav li li>ul>li {.. level 3 OVERRIDE RULES + additions}
I emphasized OVERRIDE RULES , because .nav li would be your general rules so they would still apply 3 level down thus you must override them. seems redundant, but this is the nature of CSS/ It really not about “naming” so much as it is about cascade and specificity. which leads us back to OPTINS.
Another thing you can do is add the class in at an ancestor, let say the root UL
.nav li { .. your original style for level 1 & 2}
.except li li>ul li {.. level 3 OVERRIDE RULES + additions}
<ul class='nav except'>...</ul><!-- 3rd level here would have rules applied to it-->
<ul class='nav'>...</ul><!-- 3rd level here would be the same as the others-->
I the best method to chose will depend on your specific goal and on the rest of your other code ( this is just the nature code). Hopefully this helps tho.