This is a bit of code from Twitter Bootstrap
.navbar .nav.pull-right .dropdown-menu,
.navbar .nav .dropdown-menu.pull-right {
left: auto;
right: 0;
}
So from that what does .nav.pull-right
mean? (note that there are two dots)
I have searched here because I assumed it was some kind of selector but I couldn't find it.
That means an element with both classes
nav
andpull-right
.The selector looks for any element with the class
nav
that also has a class ofpull-right
:As a side note, the order doesn't matter both in the selector and in the
class
attribute.This is my answer on a duplicated question. I've put so much effort in it that I wanted to share it with the "original" post.
It just selects elements with the classes "move" and "up". http://www.w3schools.com/cssref/css_selectors.asp
The two dots indicate two classes.
I.E. It is selecting all elements with a class of nav AND pull-right it's target HTML would look like this
it doesn't necessarily mean that it's looking for a div either. It could be any element.
According to your selector in full, it would match something like these
.navbar .nav.pull-right .dropdown-menu, .navbar .nav .dropdown-menu.pull-right
as well as
.nav.pull-right
means match elements that have the class "nav" and the class "pull-right".2 dots are actually matching for 2 classes(selector) simultaneously
After reading the pooled answer, I am still not very clear and do a research and come up with a thoughtful understanding after reading .container div { } and div.container { } ,which discussed the difference of dot ( this case) & space between selectors (matching for child of 1st selector).
Recall the rule of thumbs about CSS selector:
in which Rule 2 & 3 are somehow interchangable
original scenario:
Transform 1st dot class selector to tag selector (interchange rule 2 with rule 3) become tag+dot scenario
Finally , the result are trivial , it match all ul tag with pull-right class defined
P.S. I will never confuse again , hope every reader won't confuse it again