Search the Whole World Here.,.,

HTML Comment Tags

HTML Comment Tags

You can add comments to your HTML source by using the following syntax:
Notice that there is an exclamation point (!) in the opening tag, but not in the closing tag.
Note: Comments are not displayed by the browser, but they can help document your HTML source code.
With comments you can place notifications and reminders in your HTML:

Example



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

Try it Yourself »
Comments are also great for debugging HTML, because you can comment out HTML lines of code, one at a time, to search for errors:

Conditional Comments

Conditional Comments

You might stumble upon conditional comments in HTML:

Conditional comments defines some HTML tags to be executed by Internet Explorer only.
HTML <var> For Variables

HTML For Variables

The HTML  element defines a variable.
The variable could be a variable in a mathematical expression or a variable in programming context:

Example

Einstein wrote: <var>E</var> = <var>m</var><var>c</var><sup>2</sup>.
Result:
Einstein wrote: E = mc2.
Try it Yourself »

HTML <code> For Computer Code

HTML For Computer Code

The HTML  element defines a piece of programming code:

Example

<code>
var x = 5;
var y = 6;
document.getElementById("demo").innerHTML = x + y;
</code>
Result:
var x = 5; var y = 6; document.getElementById("demo").innerHTML = x + y;
Try it Yourself »
Notice that the element does not preserve extra whitespace and line-breaks.
To fix this, you can put the element inside a 

 element:

Example

<pre>
<code>
var x = 5;
var y = 6;
document.getElementById("demo").innerHTML = x + y;
</code>
</pre>
Result:
var x = 5;
var y = 6;
document.getElementById("demo").innerHTML = x + y;
Try it Yourself »

HTML <samp> For Computer Output

HTML For Computer Output

The HTML  element defines sample output from a computer program:

Example

<samp>
demo.example.com login: Apr 12 09:10:17
Linux 2.6.10-grsec+gg3+e+fhs6b+nfs+gr0501+++p3+c4a+gr2b-reslog-v6.189
</samp>
Result:
demo.example.com login: Apr 12 09:10:17 Linux 2.6.10-grsec+gg3+e+fhs6b+nfs+gr0501+++p3+c4a+gr2b-reslog-v6.189
Try it Yourself »
HTML Computer Code Formatting

HTML Computer Code Formatting

HTML normally uses variable letter size and spacing.
This is not what we want when displaying computer code.
The , and  elements are all displayed in fixed letter size and spacing.

Ads by Google