Character Entities (Escape Characters)
Character entities are used when you need to display reserve characters that browsers would otherwise interpret as HTML code, or characters not readily available on a standard keyboard.
|
Character |
Description |
Numeric Entity |
Named Entity |
Common Use Case |
|---|---|---|---|---|
|
" |
Quotation mark |
" |
" |
Used inside attribute values or text |
|
& |
Ampersand |
& |
& |
Used to display bare ampersands in text |
|
< |
Less-than (left angle bracket) |
< |
< |
Prevents browser from mistaking as tag start |
|
> |
Greater-than (right angle bracket) |
> |
> |
Prevents browser from mistaking as tag end |
|
|
Non-breaking space |
  |
|
Forces a space without line wrapping |
|
© |
Copyright symbol |
© |
© |
Footer copyright notices |
Comment
Syntax: Opens with <!-- and closes with -->.
It's ignored by the browser and will not appear on the page.
Comments are still visible to anyone viewing the web page's raw source code.
Never place sensitive information (passwords, private keys, API credentials) inside HTML comments.
Primary Uses:
Documentation: Labeling major section starts/ends (e.g., <!-- Start Header -->).
Developer Notes: Recording who modified code, dates, or layout reasons.
Debugging: Temporarily disabling lines of code without deleting them.
No comments:
Post a Comment
Thank you to visit Bapi's Page.