0
I wanted to know the difference between those two ways:
primeiro {
width: 50px;
float: left;
background-color: blue;
height: 50px;
padding: 7px;
}
.primeiro {
width: 50px;
float: left;
background-color: red;
height: 50px;
padding: 7px;
}
<primeiro> </primeiro>
<div class="primeiro"></div>
The first is a tag and the second a class.
– Sam
The difference is just how you selected the element.
– Wictor Chaves
I can make a whole site tag then?
– Thiago Vinícius
"Can", doesn’t mean you should...
– Leandro Angelo
Yes, but you must be careful with semantics
– Costamilam
Got it, guys. I’m going to do a little research and a little digging into this. Thank you all very much.
– Thiago Vinícius
You also have to see what the context of this tag is <first></first>. If you are using a framework JS like Angular or Vue, for example, this tag indicates a component.
– LeAndrade
What if you have two tags with the same name, but want a left and a right Coo will do? The first option you put in is like a global selector for all elements of the same name, it can be good or bad...
– hugocsl