How to Comment Out HTML

To make a comment tag is really easy. See the examples below. Comments can be added into the document. They are usually notes about the document. Your comments will not be viewable to your website visitor, meaning it will not show up on your web page. Comment can help make reading the html code easier. They are great for taking note explaining about an element or tag function, but will help you and other designers when updating the code.

Example 1

<!-- This is a comment, your visitors will not see this on their displays-->


Example 2 Find the comment in example 2 below.


Indentation

When writing your HTML code, do you use the tab or space bar for indentation? I'm not sure which is the right or wrong choice. I haven't been able to get a clear answer on the subject.

I use a text editor like Brackets, Notepad++, or even Notepad, believe it or not. I use them because it takes the guess work out of where to indent, it a great feature to have. When I first started off in web designing I used notepad, I was on a lower budget and needed any editor; The low feature Notepad did the job.

Well anyway, it's important to make sure that when you are writing your HTML codes, they are readable, not only to you, but, to others that may want to read your sources codes. You will learn more about source codes in another tutorial.

Example 1 Nicely Written HTML Document This document is legible


Example 2 Badly Written HTML Document



If you have any questions about using HTML, CSS, or Javascript please use the dussicion group or send me an PM here at Wealthy Affiliate. If you like this tutorial, please click on the like button and tell me how I can make it better.

UP NEXT - HTML Code: On The Job Training



Join the Discussion
Write something…
Recent messages
Snoetjies Premium
Very good, thank you!
Reply
seconds2work Premium
Thank you, Ylandi, for picking my tutorials to read. If you have any questions about any of them, please contact me.
Reply
reanna1 Premium
Bookmarked, LeNard! Thank you so much!
Reply
seconds2work Premium
Good morning, Rebecca. Thank you for looking over my tutorial. Bookmark, do that mean you like it? LOL.

You know I have a lot more on the way?
Reply
amgolf Premium
THis is great training about HTML that I have not seen before.
Thank you so much
Reply
seconds2work Premium
Thank you brother, for choosing my training. I hope it help you. Do you have any questions?
Reply
MKearns Premium
This is a great training LeNard. I used to-do some HTML coding back before the 2001 dotcom crash!
Reply
seconds2work Premium
Hi, Michael, I've been playing around with coding off and on for some time now. It's not as hard as I thought it would be. It's got is hard moments at times, it's truly is one of the easy languages to learn.

Thanks for the comments.
Reply
gs1954 Premium
Thanks for the lessons. I like wordpress because you don't have to use html,css and javascript. I have learnt a few html things for using in widgets, but otherwise i just use the normal post editor and don't touch html. Only when i have problems, which are very few, do i touch html code.
I like it that way.
Cheers
Reply
seconds2work Premium
Gregory, thank you, for reading the tutorial. I also like to use Wordpress, but every once in a while you will run into someone who wants a picture in a special spot.

Coding is great to learn about. It will allow you complete control of your outlook.
Reply
Top