This is Video 4 of ManoraTech's free 30-video web development course. You will use headings h1 to h6 like the outline of a book, add line breaks with br and topic breaks with hr, make important words stand out with strong and em, and build unordered (ul), ordered (ol) and nested lists with li, plus an Emmet shortcut that types a whole list for you. By the end, your website has a real About Me section with a hobbies list and a goals list.
What you will learn
- Use h1 to h6 in the right order (one h1 per page).
- Format text with strong, em, br and hr, and know when not to.
- Build unordered, ordered and nested lists.
- Write an About Me section with a hobbies list and a goals list.
Key takeaways
- Headings are an outline: one h1, then h2 and h3 in order. Choose them by importance, never by size.
- strong and em add meaning. Use them sparingly so the important words really stand out.
- ul is for bullets, ol is for numbers, and every list item is an li.
- A nested list always sits inside an li.
What you will build
The About Me part of the course website (my-website/index.html), starting from the end of Video 3:
- a subtitle paragraph under the
h1(the name stays the onlyh1on the page) - an
h2"About Me" heading and two new About paragraphs withstrongandem - an
h3"My Hobbies" with an unordered list (ul) - an
h3"My Goals This Year" with an ordered list (ol) and a nestedulinside the second item
Headings h1–h6, br and hr are demonstrated in a separate practice file, text-formatting-demo.html, so the website itself stays clean.
The code from this lesson
This is the code as it is at the end of the video. Copy it into VS Code and open the page with Live Server to see it in your browser.
index.html The website at the end of the video
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sara Ahmed | Aspiring Web Developer</title>
</head>
<body>
<!-- Main heading: my name -->
<h1>Sara Ahmed</h1>
<p>Aspiring web developer · Coffee lover · Lifelong learner</p>
<!-- About me -->
<h2>About Me</h2>
<p>Hi! I'm <strong>Sara</strong>, and I'm learning web development from scratch. I started this course because I want to build websites for small businesses — and maybe one day for my own.</p>
<p>When I'm not coding, you'll usually find me with a cup of <em>very</em> strong coffee and a good book.</p>
<h3>My Hobbies</h3>
<ul>
<li>Photography</li>
<li>Reading mystery novels</li>
<li>Cooking new recipes</li>
<li>Hiking on weekends</li>
</ul>
<h3>My Goals This Year</h3>
<ol>
<li>Finish this web development course</li>
<li>Build and publish three websites:
<ul>
<li>A personal website (this one!)</li>
<li>A to-do list app</li>
<li>A website for a local business</li>
</ul>
</li>
<li>Get my first freelance client</li>
</ol>
</body>
</html>
text-formatting-demo.html Practice file used in the video: the six heading levels, ignored white space, br (line break) and hr (change of topic). It is not part of the website.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Text Formatting Demo</title>
</head>
<body>
<!-- Six heading levels: h1 is the most important -->
<h1>Heading level 1</h1>
<h2>Heading level 2</h2>
<h3>Heading level 3</h3>
<h4>Heading level 4</h4>
<h5>Heading level 5</h5>
<h6>Heading level 6</h6>
<!-- Extra spaces and new lines in your code are ignored -->
<p>This sentence has lots of
extra spaces, but the browser shows it normally.</p>
<!-- br: a line break inside one paragraph -->
<p>
Sara Ahmed<br>
12 Garden Road<br>
Lahore, Pakistan
</p>
<!-- hr: a change of topic -->
<hr>
<p>This paragraph starts a new topic.</p>
</body>
</html>
Practice challenge
Add a "Favourite Foods" section with an h3 and an unordered list of five foods. Make your number-one favourite bold with strong.
Show the solution
The solution is in index.html below. The new h3 and ul are at the end of the body, after the goals list. It is an h3 (not an h2) because it belongs inside the About Me section. The first list item is wrapped in <strong> so the number-one favourite shows in bold. The strong element goes inside the li, never around it.
index.html Solution
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sara Ahmed | Aspiring Web Developer</title>
</head>
<body>
<!-- Main heading: my name -->
<h1>Sara Ahmed</h1>
<p>Aspiring web developer · Coffee lover · Lifelong learner</p>
<!-- About me -->
<h2>About Me</h2>
<p>Hi! I'm <strong>Sara</strong>, and I'm learning web development from scratch. I started this course because I want to build websites for small businesses — and maybe one day for my own.</p>
<p>When I'm not coding, you'll usually find me with a cup of <em>very</em> strong coffee and a good book.</p>
<h3>My Hobbies</h3>
<ul>
<li>Photography</li>
<li>Reading mystery novels</li>
<li>Cooking new recipes</li>
<li>Hiking on weekends</li>
</ul>
<h3>My Goals This Year</h3>
<ol>
<li>Finish this web development course</li>
<li>Build and publish three websites:
<ul>
<li>A personal website (this one!)</li>
<li>A to-do list app</li>
<li>A website for a local business</li>
</ul>
</li>
<li>Get my first freelance client</li>
</ol>
<!-- Challenge: Favourite Foods (h3, because it belongs inside About Me) -->
<h3>Favourite Foods</h3>
<ul>
<li><strong>Chicken biryani</strong></li>
<li>Mango ice cream</li>
<li>Vegetable pizza</li>
<li>Grilled fish</li>
<li>Chocolate cake</li>
</ul>
</body>
</html>
Quick quiz
Check what you learned. Pick an answer to see if it is right.
Question 1 of 3How many <h1> headings should a normal page have?
Show the answer
A. One Use one h1 for the main title, then h2 to h6 for sections, in order. Screen readers and search engines rely on it.
Question 2 of 3Which tag creates a numbered list?
Show the answer
D. <ol> <ol> is an ordered (numbered) list, <ul> is a bulleted list and <li> is each item.
Question 3 of 3Which tag marks text as important (bold by default)?
Show the answer
B. <strong> <strong> means "important" and shows in bold. <em> adds emphasis and shows in italics.
Frequently asked questions
How many h1 headings should a page have?
One. Use the h1 for the main title, h2 for the main sections and h3 for parts inside them, in order, without skipping levels.
What is the difference between strong and b, and between em and i?
strong marks text as important and em adds emphasis, so both carry meaning for screen readers and search engines. b and i only change the look.
When should I use br and hr?
br is a line break inside one paragraph, like an address or a poem. hr marks a change of topic. Never stack br tags to add space; spacing is a job for CSS.
What is the difference between ul and ol?
ul is an unordered list with bullets, for items whose order does not matter. ol is an ordered list with numbers, for steps or rankings. Every item is an li element.
How do you make a nested list in HTML?
Put the whole inner ul or ol inside an li, just before its closing tag, never between two li elements.
Why do headings matter for SEO?
Search engines and screen readers use your headings to understand the outline of the page, so clear headings help both people and Google.
Read the full transcript
0:00 Welcome to ManoraTech
Hello, and welcome to ManoraTech! This is Web Development for Beginners, a free course in thirty short videos. This is video four: Headings, Text Formatting and Lists.
0:16 Pages people can scan
Nobody reads a web page word by word. People scan it. Their eyes jump from heading to heading, and then down a list. Today you will make your page easy to scan, with headings, bold and italic text, and lists. You will even learn a shortcut that types a whole list for you.
And here is a bonus: Google reads your headings too, to understand what your page is about. Ten minutes from now, your website will have a real About Me section.
0:45 Headings h1 to h6 and the one-h1 rule
HTML has six heading levels, from h1 to h6. Let us try them in a practice file, so your website stays clean. Create a new file called text-formatting-demo dot html. Use the Emmet shortcut from the last video to get the boilerplate, change the title, and add one heading of each level.
Open it with Live Server. The h1 is the biggest, and the h6 is the smallest. But size is not the point. Headings work like the outline of a book. The h1 is the title of the book, the h2s are the chapters, and the h3s are the sections inside a chapter.
Screen readers let blind users jump from heading to heading, and search engines use your headings to understand the page. So here are the rules. Use exactly one h1 per page, for the main title. Use h2 for the main sections, and h3 for smaller parts inside them.
Never skip a level, and never choose a heading because of its size. Choose it by importance. You will change the size with CSS later. Now your website. Open index dot html. Under your name, add a short line that describes you. I separate the words with a small dot, but a dash works just as well.
Then add an h2 called About Me, under the About me comment. Your name stays the only h1.
2:14 Paragraphs, line breaks and horizontal rules
Here is something that surprises every beginner. The browser ignores extra spaces and new lines in your code. Press the space bar ten times, or Enter five times, and the page still shows just one space. If you want a new paragraph, you need a new p element.
But sometimes you want a new line inside the same paragraph, for example in an address or a poem. For that, use the br tag, short for line break. Like the meta tag, br is an empty element, so it has no closing tag. Save, and look at the browser.
The address sits on three lines, and a horizontal line separates the two topics. The hr tag draws that horizontal line across the page. It is also an empty element. Its real meaning is a change of topic, for example between two parts of an article.
Use br and hr only when they mean something. Never stack br tags just to add space between paragraphs. Spacing is a job for CSS, which you will learn in module three. Quick pause. If you are enjoying this video, please give it a like, share it with a friend who wants to learn web development, and subscribe to ManoraTech, so you never miss a lesson.
3:34 Bold and italic: strong and em
Back to your website. Replace the two test paragraphs from Video 3 with a real introduction. Write a few sentences about who you are and why you are learning. I am using an example name, Sara Ahmed, but please use your own. The strong tag marks text as important, and browsers show it in bold.
The em tag adds emphasis, like when you stress a word as you speak, and browsers show it in italics. Notice that both sit inside the paragraph, around just a few words. That is nesting, which you learned in the last video. A simple test: if the reader must not miss it, like a warning, use strong.
If you would say the word with extra force, use em. HTML also has b and i tags. They mainly change the look, without saying that the text matters. When a word is really important, or really stressed, use strong and em. And use them sparingly.
If a whole paragraph is bold, nothing stands out anymore.
4:36 Lists: ul, ol and li
Lists are everywhere on the web: menus, steps, features and ingredients. HTML has two main kinds. An unordered list, ul, shows bullet points. Use it when the order does not matter. An ordered list, ol, shows numbers. Use it for steps or rankings. Inside both kinds, every item is an li element, short for list item.
Why not just type lines with dashes in front? Because a real list tells the browser and screen readers that these items belong together. A screen reader even tells the listener how many items the list has. Let us add your hobbies. Type an h3 called My Hobbies.
It is an h3 because it belongs inside the About Me section. Now an Emmet trick: type ul, a greater-than sign, li, a star and the number 4, then press Tab. Emmet writes a list with four empty items for you. Fill them in. Save, and the browser shows four bullet points, slightly indented.
Notice the code too: every li is indented inside the ul, so you can see the structure at a glance. Now a numbered list. Add an h3 called My Goals This Year, and an ol with three goals. You never type the numbers yourself. The browser counts for you, and if you move an item, the numbers update automatically.
6:02 Nested lists and a goals list
Your second goal is a big one: three websites. Let us list them inside that goal. A list inside another list is called a nested list. To nest a list, put the whole new ul inside the li, just before its closing li tag. Save and look.
The three websites appear as bullets, indented under goal number two, and the numbering continues with three. You can also put a numbered list inside a bulleted one. It works both ways. Nested lists are perfect for menus with sub-menus, or a recipe with steps and ingredients.
And in the next video, you will turn a list into a navigation menu. Common mistake: placing the inner ul between two li elements, instead of inside one. A ul or an ol may only contain li elements directly. If your bullets or numbers look strange, check that every nested list sits inside an li.
Click any li tag in VS Code, and its matching closing tag is highlighted. DevTools confirms it. The ul sits inside the second li, and that li sits inside the ol. Boxes inside boxes, exactly the way you typed them. If this lesson is helping you, a like, a share and a subscribe really help ManoraTech keep making free lessons like this one.
Thank you! Now, let us keep going.
7:30 Practice challenge
Your turn. Add a new part to your About Me section called Favourite Foods. Use an h3 for its heading, because it belongs inside About Me. Below it, make an unordered list of five foods you love. Then make your number-one favourite bold, with a strong tag inside its list item.
Save and check the browser. You should see five bullets, and one of them in bold. Remember the two rules from today: the right heading level, and strong only for what really matters. Pause the video now and try it. The solution is in the course files linked in the description.
8:08 Quick quiz
Quick quiz time! Three questions about this video. Answer out loud, or pause the video and write your answers in the comments. Question one. How many h1 headings should a normal page have? A: One. B: None. C: Exactly six. D: As many as you like.
The answer is A. Use one h1 for the main title, then h2 to h6 for sections, in order. Screen readers and search engines rely on it. Question two. Which tag creates a numbered list? A: The ul tag. B: The li tag. C: The nl tag.
D: The ol tag. The answer is D. The ol tag makes an ordered, or numbered, list. The ul tag makes a bulleted list, and the li tag is each item. Question three. Which tag marks text as important, bold by default? A: The em tag.
B: The strong tag. C: The i tag. D: The important tag. The answer is B. The strong tag means important and shows in bold. The em tag adds emphasis and shows in italics.
9:35 Outro and next video
Today you used headings in the right order, formatted text with strong and em, and built bulleted, numbered and nested lists. In the next video, Links, Images and File Paths, your page gets clickable links, a real picture and a second page. Tell me in the comments: what is your number-one favourite food?
Thank you for watching ManoraTech! If you learned something new today, like this video, share it with a friend, and subscribe. I will see you in the next video. Goodbye!