!--...-- tag
The !--...-- tag, which, when implemented in the code, is written like this - <!--...-->, is an HTML tag that belongs to basic tags. Basic HTML tags are used to define a standard visible layout of almost any type of page. It includes tags that are used on the absolute majority of websites, as well as tags that serve a general purpose and are not related to any specific function that could be used to connect them to any of the other HTML tag categories.
<!--...--> inserts comments in the code. The comments are not displayed by the browser and are generally not counted towards the content
by search engines. Comments are a good way to supplement your code with additional information that provides hints to other developers or yourself, but is not displayed to the end user of a website. Adding comments helps others and yourself understand what certain pieces of a code do, and is considered a good practice among website developers. This tag is supported in the current version of HTML, which is HTML5.
Browser support
Here you can see whether <!--...--> is supported by a certain browser, and, if yes, starting from which version it is supported.
Chrome | Firefox | Edge | Opera | Safari |
---|---|---|---|---|
Is supported | Is supported | Is supported | Is supported | Is supported |
Attributes and values
An attribute is a piece of additional information about a tag. While tags denote the type of objects they mark or create, attributes set the parameters of these objects. These parameters can include anything from the types of possible interactions to its visual style to its actual contents.
Values indicate how a certain attribute is actually implemented, if there is a number of ways it can happen.
What attributes are actually allowed in a certain tag depends on the tag itself. Much like possible attributes depend on a tag, possible values depend on an attribute.
The <!--...--> tag does not support any attributes.
Global Attributes
Global attributes are HTML tag attributes that can be used by any tag, hence the name "global". They are in contrast to unique attributes that are tag-specific.
<!--...--> does not support global attributes.
Event Attributes
Event attributes are HTML tag attributes that allow triggering actions upon specific conditions, hence the name "event". Other types of attributes, namely global and unique attributes, can also trigger actions, but the difference is that even attributes allow calling scripts, such as JavaScript functions, while most other attributes only support a certain type of action.
<!--...--> does not support event attributes.