The . is the element that contains class="" ... When we use class="" in HTML then in CSS we call the element with . , example:
HTML
<div class="fundo-vermelho">Aqui vai ser um fundo vermelho colocado via class</div>
CSS
.fundo-vermelho{
background:red;
}
With # (old game's checker / game) is the same thing only that applies to ID . When in HTML we use id then in CSS we use #
HTML
<div id="fundo-azul">Aqui vai ser um fundo azul colocado via ID</div>
CSS
.fundo-azul{
background:blue;
}
When we use 2 elements like e1 e2 it means that we are going to apply the CSS command inside the element e2 that is inside e1 / p>
HTML
<div class="box">
<div class="conteudo">
Esse é o conteúdo
</div>
</div>
CSS
.box .conteudo{
font-weight:bold;
background:pink
}
When we separate the element by a comma, it means that the style we are applying to one will also apply to the other
HTML
<div id="elemento1">Elemento 1</div>
<div class="elemento2">Elemento 2</div>
<div id="elemento3">Elemento 3</div>
CSS
#elemento1, .elemento2, #elemento3{
background:red;
}
When you use the element * then we'll apply the entire style to all elements within element
When we do not use . or # we only set the name of the element so the style can only be attributed to tags
HTML
<a href="">Aqui vai ser um fundo vermelho colocado via class</a>
CSS
a{
background:purple;
}
And when we use something like : hover (pseudo-elements) are to apply the style to specific parts of the element. I'll give an example of the link ( <a>
)
HTML
<a href="" id="meu-link">Passe o mouse aqui</a>
CSS
#meu-link:hover{
background:red;
}
Pseudo-elements are specific items, that is, they can not be any name.