topskill.dev
CoursesTracks
0
All courses/Introduction to HTMLHTML Entities
Head and Metadata
3 / 4
← Introduction to HTML
○What Is HTML? See Tags in Action○Build the Meridian Signal○Complete HTML5 Page Structure○Build a Complete HTML5 Page✦Module Quiz
○Heading Hierarchy: H1 and H2○Extend the Signal Brief○Paragraphs and Inline Tags○Write Meridian's Survey Notes○List Types: Steps, Items, and Terms○Build a Crew Member Loadout○Challenge: Transmit a Rescue Signal✦Module Quiz
○Hyperlinks○Links between project files○Images○Applying Styles to HTML✦Module Quiz
○Div and Span○HTML Tables○Classes and IDs○Review: Structured Profile✦Module Quiz
○Project 1 - Visiting Card Structure○Project 1 - Visiting Card Actions✦Module Quiz
○The Head Element and Page Title○Meta Tags●HTML Entities✦Module Quiz
○Form Basics: Join the Meridian Relay○Build a Night-Shift Check-In○Input Types: Build a Mission Profile○Record Beacon Maintenance○Choice Controls: Select Training Modes○Plan a Supply Pickup○Response Controls: Send a Mission Reply○Build a Rescue Dispatch Report○Form validation and submission○Challenge: Send an Emergency Beacon✦Module Quiz
○Project 2 - Contact Us Form Structure○Project 2 - Contact Us Form Actions✦Module Quiz
○Embedding Video○Embedding Audio○Iframes✦Module Quiz
○Semantic HTML Tags○Details, Figure, and Figcaption○A keyboard-friendly page✦Module Quiz
○Project 3 - Resume Semantic Structure○Project 3 - Resume Links and Actions✦Module Quiz

HTML Entities

The walking-club route notes need to show a trail rule, a copyright line, and “Maps & Snacks” exactly as written. Some of those characters mean something special to HTML, so use entities to make the browser display the intended text. Your preview should show the symbols, not broken markup.

The starter supplies the document and heading; add four short route notes below it, each in its own <p>. The tests check these paragraphs, not the heading or page scripts.

Escape characters that HTML reads as markup

An entity starts with & and ends with ;. Use it when you need a reserved character to appear as text.

html
<p>5 &lt; 10</p>    <!-- displays: 5 < 10 -->
<p>10 &gt; 5</p>    <!-- displays: 10 > 5 -->
<p>Maps &amp; Snacks</p>

A < before a tag name starts markup, so &lt; is the safe way to show it as text. A > in ordinary text does not usually need escaping, but &gt; makes the pair easy to recognize. &amp; displays a literal ampersand.

Keep small units together

&nbsp; is a non-breaking space: it keeps the words on either side on the same line. Use it for a unit such as a distance, not to create page layout spacing.

html
<p>Meet at the 3&nbsp;km marker.</p>

A compact symbol kit

EntityCharacterUseful for
&lt;<Less-than sign
&gt;>Greater-than sign
&amp;&Ampersand
&quot;"Double quote
&apos;'Apostrophe / single quote
&nbsp;(space)Non-breaking space
&copy;©Copyright symbol
&mdash;—Em dash

You can also use numeric forms such as &#60; or &#x3C; for <, but named entities are often easier to read.

Check your page

Run the page. You should see the comparison signs, copyright symbol, and ampersand as ordinary text. If a line disappears or becomes a tag, inspect each entity for its opening & and closing ;.

Your Task

  1. Display the text: 5 < 10 and 10 > 5 using entities.
  2. Show a copyright line using &copy;, including the words All rights reserved.
  3. Use &amp; to display a literal ampersand, for example Maps & Snacks.
  4. Use &nbsp; to prevent a line break between two words.

Edit index.html, Run to read all four notes, then Submit. The checks see the browser’s parsed text, so they cannot distinguish a typed © from &copy;. Practise writing the entity even though either produces the same character.

Hint 1
1 / 4
HINT 1

Use < for < and > for > when you want to display them as text (not as tags).

HINT 2

& is the entity for the & character itself.

HINT 3

  is a non-breaking space — useful to prevent text from wrapping at a specific point.

HINT 4

Write named entities with the terminating semicolon, such as © or &.

Take the Quiz →
Files
  • ⋄index.html
Loading editor…