Special Characters in HTML

HTML - Hypertext Markup Language

Created: 2022-08-21
Tags: #fleeting


Using this symbols below will cause errors as this are part of HTML syntax itself
< > " ' &

To print those symbols above as a text, use Character Reference or Special Characters
< -> &lt;
> -> &gt;
" -> &quot;
' -> &apos;
& -> &amp;

Special Characters are easy to identify as it follows a pattern:

  • All starts with & and ends with ;
  • Text lt in &lt; means less than

Note:
You don't need to use entity references for any other symbols,
as modern browsers will handle the actual symbols just fine as long as your HTML's character encoding is set to UTF-8.