JomMula

Frontend Development: HTML to React · HTML · Lesson 02

Text, links, images, and lists

The small set of tags that covers most of the web: headings, paragraphs, emphasis, links, images, and lists. Learn these and you can structure almost anything.

7 min readHTMLbasicsUpdated October 2026

Most websites are made from a surprisingly small set of tags. Headings, paragraphs, links, images, and lists. That’s the bulk of it. Once you’re comfortable with these, the rest of HTML is mostly details.

The tags you’ll use every day

Headings

There are six levels, <h1> through <h6>. They describe importance, not size:

<h1>The page title</h1>
<h2>A section</h2>
<h3>A smaller section</h3>

Use one <h1> per page. It’s the main title. Then use <h2> for sections and <h3> for subsections. Don’t pick a heading because it “looks the right size” — that’s CSS’s job. Pick it because it describes the structure.

Paragraphs and emphasis

<p>This is a paragraph. It holds a block of text.</p>
<p>You can make text <strong>important</strong> or <em>emphasized</em>.</p>

<strong> means “this matters” and usually renders bold. <em> means “stress this word” and usually renders italic. They’re not just styling shortcuts — they tell the browser (and screen readers) what the text means.

<a href="https://example.com">Visit example.com</a>
<a href="/about">About this site</a>

The href is where the link goes. It can be:

  • Absolute — a full URL, like https://example.com.
  • Relative — a path inside your site, like /about or contact.html.
  • An anchor — a jump to a section on the same page, like #food-log.

If the link opens in a new tab, add target="_blank" and rel="noopener". The rel part is a small security habit worth keeping.

Images

<img src="food.jpg" alt="A bowl of chicken and rice" width="480" height="320">
  • src is the file path or URL.
  • alt is the text alternative. It’s what screen readers say, and what shows if the image fails to load. Never skip it. If the image is purely decorative, use alt="".
  • width and height help the browser reserve space while the image loads, so the page doesn’t jump around.

Lists

<ul>
  <li>Chicken breast</li>
  <li>Rice</li>
  <li>Broccoli</li>
</ul>

<ol>
  <li>Enter your details</li>
  <li>Pick a goal</li>
  <li>Add your food</li>
</ol>

<ul> is an unordered list (bullets). <ol> is ordered (numbers). Each item is an <li>. Lists can nest — just put the nested list inside the <li> it belongs to.

Putting them together

Here’s a small “about” section using everything above. Edit it, break it, fix it:

Preview

Edit the code, then hit Run (or Ctrl + Enter) and watch the preview. This is a safe sandbox — you can't break the page.

Make it yours

the plan's verify step

Change the heading, add a third item to the list, and replace the image with one you like. Then try removing the alt attribute and see what the browser shows if the image fails.

To test a broken image, change the src to a file that doesn't exist.

The mistakes everyone makes

  • Forgetting the closing tag. <p>Hello works until it doesn’t. Close your tags.
  • Using <br> to create space. Use paragraphs, lists, and later CSS margins. <br> is for a line break inside a sentence, like an address.
  • Using <div> for everything. We’ll cover semantic tags next lesson. They make your page easier to read and better for accessibility.
  • Empty alt text on meaningful images. If the image carries information, describe it.
  • Headings picked by size. Pick by hierarchy; style with CSS.

Headings h1–h6 describe structure, not size. One h1 per page.

p is for paragraphs; strong and em add meaning, not just looks.

Links use a href; relative paths point inside your site.

Images need src and alt. Always.

ul is unordered, ol is ordered, li is an item.

Next: semantic structure. We’ll take these pieces and arrange them into a page skeleton that actually makes sense.

Previous: How the web works (and your first page)
03

Up next

Semantic structure: build the skeleton

A page isn't just a pile of divs. Learn the tags that describe the parts of a page — header, nav, main, section, footer — and why they make everything easier.

Read now