Course Content
HTML Basic Examples
In this chapter we will show some basic HTML examples. Don't worry if we use tags you have not learned about yet.
0/1
HTML Editors
A simple text editor is all you need to learn HTML.
0/1
HTML Basic Examples
In this chapter we will show some basic HTML examples.
0/1
HTML Elements
0/1
HTML Attributes
HTML attributes provide additional information about HTML elements.
0/1
HTML Headings
HTML headings are titles or subtitles that you want to display on a webpage.
0/1
HTML Paragraphs
A paragraph always starts on a new line, and is usually a block of text.
0/1
HTML Styles
The HTML style attribute is used to add styles to an element, such as color, font, size, and more.
0/1
HTML Text Formatting
HTML contains several elements for defining text with a special meaning
0/1
HTML Quotation and Citation Elements
0/1
HTML Comments
0/1
HTML Styles – CSS
0/1
HTML Favicon
0/1
HTML Page Title
0/1
HTML Block and Inline Elements
0/1
HTML Div Element
0/1
HTML class Attribute
0/1
HTML id Attribute
0/1
HTML Iframes
0/1
HTML JavaScript
0/1
HTML File Paths
0/1
HTML – The Head Element
0/1
HTML Layout Elements and Techniques
HTML Tutorial
About Lesson

HTML comments are not displayed in the browser, but they can help document your HTML source code.


HTML Comment Tag

You can add comments to your HTML source by using the following syntax:

<!– Write your comments here –>

Notice that there is an exclamation point (!) in the start tag, but not in the end tag.

Note: Comments are not displayed by the browser, but they can help document your HTML source code.


Add Comments

With comments you can place notifications and reminders in your HTML code:

Example

<!– This is a comment –>

<p>This is a paragraph.</p>

<!– Remember to add more information here –>


Hide Content

Comments can be used to hide content.

This can be helpful if you hide content temporarily:

Example

<p>This is a paragraph.</p>

<!– <p>This is another paragraph </p> –>

<p>This is a paragraph too.</p>

You can also hide more than one line. Everything between the <!-- and the --> will be hidden from the display.

Example

Hide a section of HTML code:

<p>This is a paragraph.</p>
<!–
<p>Look at this cool image:</p>
<img border=”0″ src=”pic.jpg” alt=”Pic”>
–>

<p>This is a paragraph too.</p>

Comments are also great for debugging HTML, because you can comment out HTML lines of code, one at a time, to search for errors.


 

Hide Inline Content

Comments can be used to hide parts in the middle of the HTML code.

Example

Hide a part of a paragraph:

<p>This <!– great text –> is a paragraph.</p>