Lesson 2 of 6 · HTML + CSS

Text, lists and links

Good page structure starts with meaningful content. Use headings in a logical order, paragraphs for text, lists for related items and links for navigation between pages and resources.

Headings and paragraphs

HTML provides six heading levels, from <h1> to <h6>. Choose a heading based on document hierarchy, not merely the font size you want. A page heading should describe the main topic, with lower-level headings used for sections.

Use <p> for paragraphs. Use <strong> when the text has strong importance and <em> when the text deserves emphasis. These elements communicate meaning as well as appearance.

Ordered and unordered lists

An unordered list uses <ul> when the order does not matter. An ordered list uses <ol> when sequence matters, such as steps in a process. Each item belongs inside an <li> element.

Do not use repeated spaces or manual bullet characters to imitate a list. Real list elements provide structure for screen readers and are easier to style with CSS.

Create useful links

The <a> element creates a hyperlink. Its href attribute tells the browser where to go. A relative link such as about.html points to a page in the same site, while a full URL points to an external destination.

Write link text that explains the destination. "Read the course outline" is more useful than "click here" because it still makes sense when read out of context.

index.html
<main>
  <h1>Learning Web Development</h1>
  <p>Start with the <strong>structure</strong> of a page.</p>
  <h2>Topics</h2>
  <ul>
    <li>HTML structure</li>
    <li>CSS styling</li>
    <li>Responsive layouts</li>
  </ul>
  <a href="contact.html">Contact the department</a>
</main>
steps.html
<h2>Build a page</h2>
<ol>
  <li>Write the document skeleton.</li>
  <li>Add headings and paragraphs.</li>
  <li>Connect the page with useful links.</li>
</ol>

Try it yourself

The code examples above are for reference. Copy the relevant example into the editor, press Run, then change it and run it again.

Code Campus
Your turn

Build a short "My Learning Plan" page with a heading, a paragraph, an unordered list of three topics and a link to a second page.

Show a hint
<h1>My Learning Plan</h1>
<p>I am learning web development.</p>
<ul><li>HTML</li><li>CSS</li><li>JavaScript</li></ul>
<a href="next.html">Next lesson</a>

#CodeCampus

Code Campus