2

What would be the proper CSS selector to target the following tag:

<nav class="twelve-col col main-menu">

Would the proper selector just be:

.twelve-col col main-menu {
}
TylerH
  • 20,799
  • 66
  • 75
  • 101

3 Answers3

3

No. You should combine individual class names using .:

.twelve-col.col.main-menu
Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252
0

No. Your selector is trying to find main-menu INSIDE col which is INSIDE twelve-col. But you are looking for element, that has twelve-col col main-menu classes the same time, so use .twelve-col.col.main-menu

However try BEM methodology, where you use just one class to make all your selectors same specificity (http://getbem.com)

0

The most effective selector will be nav.twelve-col.col.main-menu you can also use nav.main-menu which makes some sense.

Robert Williams
  • 1,370
  • 1
  • 17
  • 38