+ 1
difference between id and class
the tutorial mentioned that an id can only be used once in a page unlike a class , I don't understand this exactly cause I've used ids alot and no errors came up ... or so I think
2 Respostas
+ 2
I think it's more you can't have the same two id's on one page. Because the id defines one thing where as the class defines everything using that class. At least that's how I interpreted it. Not sure if that helps
0
# is id and . is class for exampel
#body{
text-align: center;
color: black;
background-color: #FFFFFF;
}
<div id="body"> This text </div>
this is div id exampel