@Vitiyah
Posted
Hi Aaron, there are no rules/order for general properties, for example width can be followed by height or height followed by width. But for certain types of CSS properties such as flexbox and grid.You cannot place align-items: center first without declaring display: flex. Imagine it like an onion layer.
And for your question on when to use id and class, you're correct, the basic difference is that id is for unique element and class can be used many times for all the elements that you want to apply a particular styling. But class can also be used for unique elements. I preferably use class all the time for styling purpose and use id for Javascript purposes to just select a particular element.
Marked as helpful
@aaronli722
Posted
@Vitiyah Thanks for your advice! I just started learning Javascript, I think I will have more understanding of your advice when I start adding Javascript to my codes~