If you are starting to work with HTML, you have surely come across one of its most important features: comments. In this post we will tell you what they are and how you can add them.
What are comments in HTML?
Comments in HTML are fragments within the code that do not always have to fulfill a programming function on the website. These are indications, notes or observations to take into account. as you design your website, without these fragments being visible within the browser.
The comments section in HTML may seem trivial, but when you have been working on the design of a page for months and you are forced to go back over a specific area of the code, it will be of great help to you.. This is especially important in «real» programming languages, considering that HTML is a markup language.
How to add comments in HTML?
The basic structure, the html codes to add a comment in HTML are to put ««, followed by your comment; then, you close with «––>«. It is worth mentioning that to comment in other languages the structure is different. Also note that you can make comments that are longer than one line if you add the comment closure as you normally would.
Don’t limit yourself, comments can have many other uses and many developers and companies use them in very creative ways. This is the case of Flickr, who They devised a way to find and recruit candidates for their development team through comments that they had in the HTML code of their website. At Flickr they assumed that if someone is taking a look at the code, they must at least have a fairly technical background, as well as be a curious person.
In conclusion, the comments They are one of the characteristics that most go unnoticed when working in web development. Even so, they are of great importance, since they can save you from many setbacks or even help you improve your work performance.
Where to continue?
Now that you know how to add comments in HTML, Do you want to continue acquiring knowledge in the area? With our Full Stack Web Development Bootcamp you will be able to master this and many other essential tools and technologies in the world, such as JavaScript, React, microservices and even server deployment. You will train with the guidance of great experts in the sector and you will learn the theory and practice necessary to, in a few months, succeed in the labor market. Sign up now and transform your future!