What does sign for, ::, +, and & in css mean? [duplicate]

1

I'm starting my internship and I do not know the meaning of the following attibutos.

  

Sign of > (higher)

Because .classe-a > classe-b{} is used

  

Double colon

 .classe-a::.classe-b{}
  

Sign of + (more)

.classe-a + classe-b
  

& Signal

&.classe-a{}

I'm going to give maintenance on this CSS but before do I need to know what these signs are?

    
asked by anonymous 05.11.2017 / 05:03

1 answer

3
  • Higher sign > : means child-direct of the element. Selects all parent-children of the element.

Example: div > span

<div>
  <span> <!-- filho direto da div -->
     DvD
     <p>DvD</p> <!-- não é filho direto da div -->
  </span>
</div>
  • Two points :: : stands for pseudo-element (a child element).

Example: div::first-letter

Select the first letter within the div (in the case below, the "d").

<div>
   <span>
      dvd
   </span>
</div>
  

Your example .classe-a::.classe-b{} is incorrect. A class does not   can be a pseudo-element.

Documentation of pseudo-elements in the MDN .

  • - Sign of + : selects the element immediately after.

Example: div + p

<div>
   dvd
</div>
<p>dvd</p> <!-- este é selecionado, pois está após a div -->
<p>dvd</p> <!-- este não é selecionado -->
  • Signal & : This sign does not exist in CSS. It is used in Sass , a language for compiling CSS code.
05.11.2017 / 05:54