Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What do two dots in a CSS declaration mean?

Tags:

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.

like image 457
byronyasgur Avatar asked May 30 '12 20:05

byronyasgur


People also ask

What does dot symbol means in CSS?

. in CSS means it is a class & it can be applied to many elements with use space between classes.

What do the two dots mean in HTML?

Double dots (“..”) refer to the previous directory, eg. “../test. html” would refer to the file “test. html” in the previous directory. To refer to a location which is more than one directory level up, use a combination of double dots, eg.

What is the DOT before in CSS?

In CSS, ::before creates a pseudo-element that is the first child of the selected element. It is often used to add cosmetic content to an element with the content property. It is inline by default.


1 Answers

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

<div class="nav pull-right"></div> 

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

<element class='navbar'>     <element class='nav pull-right'>         <element class='dropdown-menu'>It would match this!</element>     </element> </element> 

as well as

<element class='navbar'>     <element class='nav'>         <element class='dropdown-menu pull-right'>It would also match this!</element>     </element> </element> 
like image 129
dockeryZ Avatar answered Oct 16 '22 03:10

dockeryZ