W3-Video WEB Tutorials

w3-video.com is a Free eLearning Website with over 500 video tutorials on HTML5, XAMPP, .htaccess, Firefox, Notepad++

HTML5 Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++

!-- -- comment

Share it

comment intro comment scripts comment browser display comment parents - children comment forbidden characters comment warningcomment syntax

HTML5 comment

allows you to comment your source code for various reasons:

  1. explain your code, comment irrelevant or buggy code »video
  2. conditional comments to ensure cross browser compatibility »video
  3. comment scripts: prevent the display of text within the JavaScript code in browsers with no JavaScript support »video

About comments

Display & support comment

Firefox iconChrome iconIE iconOpera iconSafari icon

Parents, children comment

Attributes comment

not applicable


Within a comment, the next characters are not allowed [where are not allowed]: >[start], ->[start], --[contain], -[end] »video

Avoid adding comments within elements that expect text content: e.g. title, textarea.. (the risk of being included in the text content) »video

Syntax comment

1<!–– add a comment here ––> »example

Attributes and Values comment (comma separated)

not applicable

Video demonstration comment

HTML5 Comments Tutorial

min video details
00:00 video demonstration comments in HTML5
00:05 a comment allows you to comment your source code for various reasons: 2 of them presented next
00:17 this article presents the section element
00:20 reason 1: explain your code (for you in order to easily maintain) or (for others: to maintain, test, improve,... )
00:20 the start part of a comment
00:23 the end part of a comment
00:26 commented part
00:41 note: the 2 comments do not display in browser
00:49 reason 2: irrelevant code (which will no longer display in browser)
00:50 let's say that part of code represents irrelevant⁄no longer needed code
00:53 commenting that part (goes between the start part and the end part of the comment)
01:00 no longer displayed in browser