@12Kentos
Posted
Hey @hermannleboss,
Nice job on the project, looks great! I noticed in your scss file you selected some of your elements directly like so.
a{ text-decoration: none; color: white; &:hover{ color: #00FFF8; }
While this isn't a big deal for small projects like this, generally it's not a good idea as this would select every single a element you have and apply those styles. I would highly suggest using a class directly, or using a class and then using the element to select your elements, as this will help you avoid a lot of headache in the future on larger projects.
Keep up the great work!
Marked as helpful
@12Kentos Hello, thanks for your advice. I moov colors specs into a css. Should use class for all style spec for elements ? Usually we have element that have some global style. Like paragraphe style. And then somme ones have a specify style. Did i need to use only class selector ?
@12Kentos
Posted
@hermannleboss If you want it to affect every single element you can use the element itself, like in the example I gave. But rarely will every element have the exact same style on the same page. A lot of them will have similar styles, which is why it's nice to give them a class. For instance most buttons will have a similar width/height/border radius on a page for consistency. So if you give it a class of .btn
for example, you can easily reuse this code for all of the buttons you want to look alike on the page.
However if you wanted to make a new button, if you didn't use a class you would have to do a lot of style resets to get it looking the way you want. I hope that makes sense?
@12Kentos OK thanks