HTML:
<a href=”index.html”>Home</a>
<!-- Link to Home page -->
<a href=”contact.html”>Contact</a>
<!-- Link to Contact page -->
<a href=”index.html”>Home</a>
<!-- Link to Home page -->
<a href=”contact.html”>Contact</a>
<!-- Link to Contact page -->
The red text shows the comments in HTML. It starts with “<!--“ and ends with “-->”. You can write anything you want between them. The purpose of comments is to write something without changing your code at all. I even like to add fun little comments if I am sharing my code with someone else because I know that whatever I write will NOT show up on the page.
CSS:
p {
font-size: 24px;
/* 24 is also the current font size for the content section on the home page */
}
p {
font-size: 24px;
/* 24 is also the current font size for the content section on the home page */
}
This is what a comment will look like on your CSS style sheet. It looks a little different than a comment in HTML, but it acts the same way. You can write whatever you want without changing your code. Start with “/*” and end with “*/”. It’s as simple as that.
These comments can go anywhere in your code. Just make sure to use the correct format for the type of code you are working with. Remember that the comments will not be interpreted, so you can write in any format you want to.
No comments:
Post a Comment