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 {
}
No. You should combine individual class names using .
:
.twelve-col.col.main-menu
:)
I mean, what do you mean? Both are same no?
Commented
Jul 16, 2017 at 15:51
.nav.
but it's just nav.
for Tag Selectors. .
is used for classes and #
is used for ids.
Commented
Jul 16, 2017 at 15:53
The most effective selector will be nav.twelve-col.col.main-menu
you can also use nav.main-menu
which makes some sense.
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)