In someway, in the beginning you think comments are waste of time, but when you have multiple CSS stylesheets or HTML pages, you will find comments very useful!
Let's take a look at this simple syntax.
CSS Comments tags
The CSS comment syntax is very simple, you just have to remember it always starts with /* and ends with */, no matter if it is one line or multiline comment.Let's take a look at the CSS example:
/*Image container*/
.img {
width:200px;
height:300px;
background-color:#DF0101 /*Red color for the background*/
/*border:2px solid #0101DF; Naah, i don't need borders right now, maybe i'll need them later*/
}
/*End of image container*/
/*One line comment*/
/*
Multiline
comment
*/
.img {
width:200px;
height:300px;
background-color:#DF0101 /*Red color for the background*/
/*border:2px solid #0101DF; Naah, i don't need borders right now, maybe i'll need them later*/
}
/*End of image container*/
/*One line comment*/
/*
Multiline
comment
*/
HTML Comments tags
HTML comments have much the same syntax as CSS comments, the only thing you have to remember is, that they start with <!-- and end with -->, and can also be multiple lines long.Let's take a look at the example:
<!-- Here is a simple uncommented paragraph -->
<p>One simple uncommented paragraph</p>
<!-- Here is multiline commented paragraph -->
<!-- Multiline commented paragraph
<p>I always wanted</br>
to play guitar!</p>
-->
<p>One simple uncommented paragraph</p>
<!-- Here is multiline commented paragraph -->
<!-- Multiline commented paragraph
<p>I always wanted</br>
to play guitar!</p>
-->
That's all, see ya next time and stay tuned!