Comments, Entities & Symbols
Comments let you leave notes in your HTML that browsers ignore. Character entities let you show characters that would otherwise be read as HTML — like < — and symbols that are hard to type. With UTF-8, you can also use any emoji or script directly.
Comments
Anything between <!-- and --> is ignored. Use comments to label sections of long pages, explain unusual code, or temporarily hide something.
Why entities exist
The characters <, > and & have special meaning in HTML. To display them as text, write them as character entities:
Common entities
| Character | Named entity | Numeric | Notes |
|---|---|---|---|
| < | < | < | Less than |
| > | > | > | Greater than |
| & | & | & | Ampersand |
| " | " | " | Inside attribute values |
| (space) | |   | Non-breaking space |
| © | © | © | Copyright |
| — | — | — | Em dash |
| € £ ¥ | € £ ¥ | Currencies | |
| → × | → × | Arrows, maths |
Every character also has a numeric form: decimal (©) or hexadecimal (©), based on its Unicode code point.
Non-breaking spaces
joins two words so they never wrap onto separate lines — useful for numbers with units, initials and short phrases. It isn't a tool for adding spacing; use CSS for that.
UTF-8, symbols and emoji
With <meta charset="utf-8"> in your head, you can type any character directly — accents, other scripts, symbols and emoji:
Typing characters directly is usually clearer than entities. You only need entities for <, & and quotes in attributes, plus invisible characters like .
<span aria-hidden="true">; meaningful ones should have a text equivalent.