Comments in HTML and CSS

One thing I’ve noticed when working in web teams is that even when you have professionals who are great at coding as individuals, practices vary – which can make it a challenge for developers to look at each other’s code and figure out how everything is organised and laid out.

One way to counter this is to add comments in your code to explain what’s going on.

In HTML it goes like this:

whilst in CSS, it’s a little bit different:


Thus, a developer can explain logic and what they mean – for example, they might group different areas of the page layout in the CSS file so that other developers can find and update the areas quickly.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.