css - Using :not to exclude selectors -


i'm ok css, not bag. i've been trying work out efficient way of setting base selectors.

for example:

h3:not([class]) {     /* make */ } 

the example above lets me set base h3, if want exclude base styling, add class.

however, challenging anchor appears in lots of places throughout site - main menu, footer links, quick links, related links, pseudo buttons - picture. there lots of different styles might wan't use style anchor, need remove default styling each time.

i can of course take same approach above, main difference anchor element tends used in bunches inside ul/li elements, doesn't cover scenario.

is there way can exclude links parent li or case of cascading this?

a:not([class]) {     /* make */ } li > a:not([class]) {     /* remove goodness */ } 

i appeciate answers given.

in end works me - work others.

for simple cases

h1:not([class]) {     /* excludes h1's class */ } 

for complex cases inside lists

*:not(li) > a:not([class]), ul.base > li > {     /* excludes class or child in list        includes inside list if ul appended class "base" */ } 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -