Should I put my comments before or after the divs they were meant for?
What is a good way to remember the principles of ids, classes and divs.
It keeps escaping me! Is there a trick to remember what they are for? I feel so thick!
It’s your call. I never put comments in my code, however I believe putting them before is the better option (opinion here).
If you scroll down through a pge and you have a comment saying “The above was my header” you then have to go look back up and see it (if you want, of course)
Never make classes or IDs presentational. Aka never do class=“red” or something like that. There are no real principles to remmeber about classes and IDs. Divs are basically just divisions on the page, used to structure the page. IDs and classes are easy to remember: they are unique (IDs) or can be reused (classes). They are added to HTML elements to help style them in CSS (or mark up in Javascript) :).