Stage 2: Frontend Fundamentals

HTML · Lesson 01

HTML Basics

Document structure, meta tags, headings, paragraphs, lists and comments — the skeleton of every web page.

HTML4 min readFree lesson

Learn the basic structure that forms the skeleton of an HTML document and the tags you will use most often.


1. What is HTML?

HTML (HyperText Markup Language) is the language that describes the structure and content of a web page. It is not a programming language but a markup language, and it uses tags to express the structure of a document.

<tag-name>content</tag-name>
  • An opening tag (<tag>) and a closing tag (</tag>) come in pairs.
  • Some tags are used on their own without a closing tag (for example: <br>, <img>, <input>)

2. The DOCTYPE Declaration

<!DOCTYPE html>
  • It must always be written on the first line of an HTML document.
  • It is a declaration that tells the browser "this document is in HTML5 format."
  • <!DOCTYPE html> is the HTML5 standard declaration and is not case sensitive.

3. The Basic Structure of an HTML Document

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Page title</title>
  </head>
  <body>
    <!-- Write the content that actually appears on screen here -->
    <h1>Hello!</h1>
    <p>This is my first HTML document.</p>
  </body>
</html>
Tag Role
<html lang="en"> The top-level tag that wraps the whole document. The lang attribute specifies the language
<head> The area that holds document information that is not shown in the browser
<body> The content actually displayed on the browser screen

4. Meta Tags

Meta tags are written inside <head> and provide extra information about the document.

<!-- Character encoding: set to UTF-8 so that text does not break -->
<meta charset="UTF-8">

<!-- Viewport setting for responsive web pages -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!-- Page description for search engines -->
<meta name="description" content="This page is an example page for learning the basics of HTML.">

<!-- Keywords for search engines -->
<meta name="keywords" content="HTML, web, basics, lesson">

<!-- Author information -->
<meta name="author" content="John Doe">

<!-- Title shown in the browser tab -->
<title>My First HTML Page</title>

5. Heading Tags (h1 ~ h6)

HTML has six levels of heading tags. The larger the number, the smaller the text.

<h1>Level 1 heading - the largest and most important heading (one per page recommended)</h1>
<h2>Level 2 heading - the title of a main section</h2>
<h3>Level 3 heading - a subheading</h3>
<h4>Level 4 heading</h4>
<h5>Level 5 heading</h5>
<h6>Level 6 heading - the smallest heading</h6>

Caution: Heading tags are used to express the hierarchy of the document, not to adjust font size. Adjust font size with CSS.


6. Paragraph Tag (p)

<p>This is the first paragraph. Paragraphs automatically get space above and below.</p>
<p>This is the second paragraph. Even if you add line breaks inside a p tag, the browser treats them as a single space.</p>

7. div and span

Tag Characteristic Use
<div> A block-level element (takes up an entire line) Grouping large areas
<span> An inline element (takes up only as much as its content) Grouping part of a text
<!-- div: block level - a line break appears automatically -->
<div>This area takes up a whole line.</div>
<div>The next div starts on a new line.</div>

<!-- span: inline - used within the flow of text -->
<p>In this sentence, only <span>this part</span> can be styled separately.</p>

8. List Tags

Unordered List (ul - Unordered List)

<ul>
  <li>Apple</li>
  <li>Banana</li>
  <li>Strawberry</li>
</ul>

Result:

  • Apple
  • Banana
  • Strawberry

Ordered List (ol - Ordered List)

<ol>
  <li>Prepare the ingredients</li>
  <li>Boil the water</li>
  <li>Add the ingredients</li>
  <li>Done in 5 minutes!</li>
</ol>

Result:

  1. Prepare the ingredients
  2. Boil the water
  3. Add the ingredients
  4. Done in 5 minutes!

Nested Lists

<ul>
  <li>Fruit
    <ul>
      <li>Apple</li>
      <li>Banana</li>
    </ul>
  </li>
  <li>Vegetables
    <ul>
      <li>Carrot</li>
      <li>Spinach</li>
    </ul>
  </li>
</ul>

9. Comments

<!-- This is a comment. It is not shown on the browser screen. -->
<!-- Used to explain code or to temporarily disable code -->

Summary

Tag Description
<!DOCTYPE html> HTML5 document declaration
<html> The top-level element of the document
<head> Document meta information
<body> Content displayed on screen
<meta> Extra document information
<title> Browser tab title
<h1>~<h6> Headings (hierarchy)
<p> Paragraph
<div> Block-level container
<span> Inline container
<ul> Unordered list
<ol> Ordered list
<li> List item

Next Steps

  • View the example file - A self-introduction page example
  • Check the assignment - Build a page introducing your family
  • Next lesson: Text Elements

Example files

Complete, runnable files used in this lesson. Copy them into your project and experiment.

index.htmlHTML
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="HTML basics example - self-introduction page">
  <meta name="author" content="John Doe">
  <title>John Doe's Self-Introduction</title>
</head>
<body>

  <h1>Hello! I'm John Doe.</h1>

  <h2>About Me</h2>
  <p>
    I am John Doe, a 25-year-old living in Seoul.
    I am currently studying web development, starting with HTML one step at a time.
  </p>
  <p>
    I enjoy learning new technologies,
    and someday I would like to build a great website of my own.
  </p>

  <h2>Basic Information</h2>
  <ul>
    <li>Name: John Doe</li>
    <li>Age: 25</li>
    <li>Residence: Seoul</li>
    <li>Occupation: Student</li>
    <li>Email: [email protected]</li>
  </ul>

  <h2>Hobbies</h2>
  <p>I have a variety of hobbies:</p>
  <ul>
    <li>Reading - I mostly read novels and self-development books</li>
    <li>Watching movies - I like action and science fiction</li>
    <li>Coding - I am studying web development</li>
    <li>Hiking - I climb nearby mountains every weekend</li>
    <li>Cooking - I enjoy making simple Korean dishes</li>
  </ul>

  <h2>My Favorite Foods, Ranked</h2>
  <ol>
    <li>Kimchi stew</li>
    <li>Grilled pork belly</li>
    <li>Bibimbap</li>
    <li>Soybean paste stew</li>
    <li>Tteokbokki</li>
  </ol>

  <h2>What I Am Learning Now</h2>
  <ol>
    <li>HTML - the structure of a web page
      <ul>
        <li>Types of tags and how to use them</li>
        <li>The basic structure of a document</li>
      </ul>
    </li>
    <li>CSS - the design of a web page (upcoming)
      <ul>
        <li>Colors and fonts</li>
        <li>Layout</li>
      </ul>
    </li>
    <li>JavaScript - the behavior of a web page (upcoming)
      <ul>
        <li>Basic syntax</li>
        <li>DOM manipulation</li>
      </ul>
    </li>
  </ol>

  <h2>My Goal</h2>
  <p>
    My goal is to build my own portfolio website within this year.
    I want to learn HTML, CSS, and JavaScript and become a full-stack developer.
  </p>

  <div>
    <h2>A Final Word</h2>
    <p>
      Thank you for visiting!
      <span>I will keep learning hard and build a great website.</span>
    </p>
  </div>

</body>
</html>

Assignment

Lesson 01 Assignment — Build a Page Introducing Our Family

Assignment Goal

Using the basic HTML tags, build a web page that introduces your family.


Requirements Checklist

Complete the page so that it includes every item below.

Required Structure

  • Includes the <!DOCTYPE html> declaration
  • Uses the <html lang="en"> top-level tag
  • Includes <meta charset="UTF-8"> in the <head> area
  • Includes <title> in the <head> area (for example: "Introducing Our Family")
  • Writes all content inside <body>

Heading Tags (h1~h6)

  • Writes the overall page title with an <h1> tag (for example: "Let Us Introduce Our Family!")
  • Writes a subheading for each family member with an <h2> tag (at least 3 people)

Paragraph Tag (p)

  • Writes an introductory sentence about each family member with a <p> tag (at least 1 per person)
  • Includes 1 paragraph introducing the family as a whole

List Tags (ul, ol, li)

  • Uses <ul> to write a list of family members (name, age, relationship, etc.)
  • Uses <ol> to write a list of things you want to do with your family (3 or more, in order)

Additional Items

  • Uses <div> or <span> at least once
  • Writes HTML comments (<!-- -->) in at least 2 places

Example Structure (for reference)

Let Us Introduce Our Family!  ← h1

Our family has 4 members in total...  ← p

Family Members  ← h2
- Father (James Doe, 55)   ← ul > li
- Mother (Mary Doe, 50)
- Me (John Doe, 25)
- Younger sister (Emily Doe, 20)

Father  ← h2
My father is an office worker and...  ← p

Mother  ← h2
My mother is a teacher and...  ← p

Things We Want to Do Together as a Family  ← h2
1. Trip to Jeju Island       ← ol > li
2. Going camping
3. Eating out

Hints

Hint 1: Basic structure template
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Introducing Our Family</title>
</head>
<body>
  <!-- Write your content here -->
</body>
</html>
Hint 2: The difference between ul and ol
<!-- ul: an unordered list (shown with •, -, *, etc.) -->
<ul>
  <li>Father</li>
  <li>Mother</li>
  <li>Me</li>
</ul>

<!-- ol: an ordered list (shown with 1, 2, 3...) -->
<ol>
  <li>The first thing I want to do</li>
  <li>The second thing I want to do</li>
  <li>The third thing I want to do</li>
</ol>
Hint 3: Using nested lists

If you want to introduce each family member's hobbies as well, you can use a nested list:

<ul>
  <li>Father
    <ul>
      <li>Hobby: fishing</li>
      <li>Job: office worker</li>
    </ul>
  </li>
  <li>Mother
    <ul>
      <li>Hobby: reading</li>
      <li>Job: teacher</li>
    </ul>
  </li>
</ul>

How to Submit the File

  1. Create a new index.html file.
  2. Implement all of the requirements above.
  3. Open the file in a browser and check that it displays correctly.
  4. Compare it with the solution file.

Grading Criteria

Item Points
Basic HTML structure (DOCTYPE, html, head, body) 20 points
Correct use of heading tags (h1, h2) 20 points
Use of the paragraph tag (p) 20 points
Unordered list (ul, li) 15 points
Ordered list (ol, li) 15 points
Writing comments 10 points
Total 100 points
Show the reference solution

Try the assignment yourself first — comparing your attempt with a working solution is where most of the learning happens.

index.htmlHTML
<!DOCTYPE html>
<!-- HTML5 document declaration: tells the browser that this document is in HTML5 format -->

<html lang="en">
<!-- html: the top-level tag that wraps the entire document -->
<!-- lang="en": states that this document is written in English (important for screen readers and search engines) -->

<head>
  <!-- head: the area that holds document information that is not shown on screen -->

  <meta charset="UTF-8">
  <!-- charset="UTF-8": sets the character encoding to UTF-8 so that text does not break -->

  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <!-- viewport: makes the page fit the screen size on mobile devices -->

  <meta name="description" content="A page introducing the Doe family.">
  <!-- description: meta information shown as the site description by search engines -->

  <title>Introducing Our Family</title>
  <!-- title: the page title shown in the browser tab and bookmarks -->
</head>

<body>
  <!-- body: contains everything that is actually displayed on the browser screen -->

  <!-- ====== Overall page title ====== -->
  <h1>Let Us Introduce Our Family!</h1>
  <!-- h1: the most important heading on the page. Using only one per page is recommended -->

  <!-- ====== Paragraph introducing the whole family ====== -->
  <p>
    Our family is a warm household of four members.
    We live in Seoul, and we treasure spending time together every weekend.
  </p>
  <!-- p: short for paragraph. It represents a single paragraph and gets automatic space above and below -->

  <!-- ====== List of family members ====== -->
  <h2>Family Members</h2>
  <!-- h2: the heading level below h1. Used as the main heading of each section -->

  <ul>
    <!-- ul: unordered list. Used when order does not matter -->
    <li>Father - James Doe (55, office worker)</li>
    <!-- li: list item. Represents each item inside a ul or ol -->
    <li>Mother - Mary Doe (50, teacher)</li>
    <li>Me - John Doe (25, university student)</li>
    <li>Younger sister - Emily Doe (20, high school student)</li>
  </ul>

  <!-- ====== Introducing my father ====== -->
  <h2>Father - James Doe</h2>

  <p>
    My father is an office worker at a large company, and he is a very diligent and sincere person.
    On weekends he is also a skilled cook who makes delicious food for the family.
  </p>

  <p>My father's hobbies and skills:</p>
  <!-- Write an explanatory sentence before a list using a p tag -->
  <ul>
    <li>Fishing - he enjoys fishing with friends once a month</li>
    <li>Cooking - he is especially good at Korean dishes</li>
    <li>Hiking - he climbs mountains every weekend to stay healthy</li>
  </ul>

  <!-- ====== Introducing my mother ====== -->
  <h2>Mother - Mary Doe</h2>

  <p>
    My mother is an elementary school teacher.
    She always leads the mood of our family with bright and positive energy.
    Thanks to her, our home is always warm and harmonious.
  </p>

  <p>My mother's hobbies and skills:</p>
  <ul>
    <li>Reading - she enjoys reading literary novels and essays</li>
    <li>Knitting - she gives the family scarves she has made herself</li>
    <li>Gardening - she grows a variety of plants on the balcony</li>
  </ul>

  <!-- ====== Introducing myself ====== -->
  <h2>Me - John Doe</h2>

  <p>
    I am John Doe, a 25-year-old currently majoring in computer science at university.
    I am very interested in web development, so I study HTML, CSS, and JavaScript whenever I have time.
  </p>

  <!-- div: used to group related content into a single block -->
  <div>
    <p>The technology stack I am learning now:</p>
    <ol>
      <!-- ol: ordered list. Used when the order of the content matters -->
      <li>HTML - web page structure (currently learning)</li>
      <li>CSS - web page styling (next goal)</li>
      <li>JavaScript - web page behavior (the goal after that)</li>
    </ol>
  </div>

  <!-- ====== Introducing my younger sister ====== -->
  <h2>Younger Sister - Emily Doe</h2>

  <p>
    My younger sister Emily is a second-year high school student with an artistic temperament and a love of art.
    She hopes to become a web designer, and someday she wants to build a website together with her older brother.
  </p>

  <p>My sister's hobbies:</p>
  <ul>
    <li>Drawing - she enjoys digital art</li>
    <li>Listening to music - she likes K-POP</li>
    <li>Cooking - she is especially good at baking</li>
  </ul>

  <!-- ====== Things we want to do with the family ====== -->
  <h2>Things We Want to Do Together as a Family</h2>

  <p>Here is a list of the things our family wants to do, arranged in order of importance:</p>
  <!-- Use ol to express priority/order -->
  <ol>
    <li>Family trip to Jeju Island - I want to travel with my family to Jeju Island, which we have never visited</li>
    <li>Camping - I want to spend time with my family grilling barbecue in nature</li>
    <li>Family photo shoot - I want to take a great family photo at a studio</li>
    <li>Cooking contest - I want to see whether my father or I cook better</li>
    <li>Watching movies together - I want to have a movie marathon at home with popcorn</li>
  </ol>

  <!-- ====== Closing paragraph ====== -->
  <h2>Closing</h2>

  <p>
    I have introduced our family to you.
    We each have different personalities, but we are a precious family that cares for and loves one another.
    <!-- span: used to mark only a specific part of a sentence separately (currently just to give it meaning) -->
    <span>I hope we always stay healthy and happy!</span>
  </p>

</body>
</html>

Learn this lesson with a mentor

Work through the Build Your Homepage series on your own, or join a guided cohort at our Pitampura campus and online.

Call NowEnroll Now