Latest solutions
Latest comments
- @aaronli722@Vitiyah
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 - @smirkintj@Vitiyah
Hi Putra,
Follow the DRY method, Don't Repeat Yourself to make the code much shorter, for example
.content h3, .content p { text-align: center; }
This will make the code much shorter. Otherwise, good coding and great start. Wish you all the best
Marked as helpful