This is Video 3 of ManoraTech's free 30-video web development course. HTML (HyperText Markup Language) is a markup language, not a programming language: you label your content so the browser knows what each part is. You will learn tags, elements, attributes and nesting, type the HTML boilerplate line by line (doctype, html, head, meta charset, meta viewport, title and body), create it in one second with the Emmet shortcut in VS Code, and start your own website with an h1 heading, paragraphs and HTML comments.
What you will learn
- Explain tags, elements, attributes and nesting.
- Write the HTML boilerplate (doctype, html, head, body) by hand and with the Emmet ! shortcut.
- Use the meta charset, meta viewport and title tags correctly.
- Start the course website with a heading, paragraphs and comments.
Key takeaways
- HTML labels your content: a tag is the label, an element is tag plus content, and an attribute adds extra information.
- Close nested tags in reverse order: last opened, first closed.
- The head holds information about the page; the body holds everything visitors see.
- The Emmet shortcut writes the boilerplate in one second. Always change the Document title to something meaningful.
What you will build
The first version of the course website (my-website/index.html): the full HTML boilerplate, an h1 with your name, two paragraphs and two HTML comments.
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 page 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>
<!-- About me -->
<p>Hi! I am learning web development, one line of code at a time.</p>
<p>This is my first website. I built it with HTML.</p>
</body>
</html>
Practice challenge
Add a third paragraph about what you want to build after this course. Put an HTML comment above it that says "My goal". Check the browser: the comment must not appear on the page.
Show the solution
The solution is in index.html below (the new comment and paragraph are at the end of the body).
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>
<!-- About me -->
<p>Hi! I am learning web development, one line of code at a time.</p>
<p>This is my first website. I built it with HTML.</p>
<!-- My goal -->
<p>After this course, I want to build a website for my family's bakery.</p>
</body>
</html>
Quick quiz
Check what you learned. Pick an answer to see if it is right.
Question 1 of 3In <a href="about.html">About</a>, what is href?
Show the answer
C. An attribute Attributes live inside the opening tag and give extra information. Here, they say where the link goes.
Question 2 of 3Where does the content that visitors see go?
Show the answer
B. Inside <body> <head> holds information about the page; <body> holds everything visible.
Question 3 of 3Which line tells the browser "this is a modern HTML5 document"?
Show the answer
C. <!DOCTYPE html> <!DOCTYPE html> is always the very first line of an HTML5 page.
Frequently asked questions
What is HTML?
HyperText Markup Language, the language that gives every web page its structure. It is a markup language, not a programming language.
What is the difference between a tag and an element?
A tag is a short word inside angle brackets, like the opening p tag. An element is the opening tag, the content and the closing tag together.
What is an HTML attribute?
Extra information inside the opening tag, written as a name, an equals sign and a value in quotes. For example, href tells a link where to go.
What is the HTML boilerplate?
The standard starting code of every page: doctype html, the html element with lang, a head with meta charset, meta viewport and title, and a body for everything visitors see.
What is the Emmet shortcut for HTML?
In VS Code, type an exclamation mark in an empty .html file and press Enter. The whole boilerplate appears instantly.
What is an HTML comment?
A note for humans that the browser ignores completely. In VS Code, press Ctrl + / to turn a line into a comment.
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 three: Your First HTML Page.
0:16 A real page from an empty file
This file is completely empty. Ten minutes from now, it will be a real web page that any browser in the world can open, and you will understand every single line of it. Today you learn the three words that unlock all of HTML: tags, elements and attributes.
Then you will write the code that every professional page starts with, learn a shortcut that types it for you in one second, and start building your own website.
0:43 Tags, elements and attributes
HTML stands for HyperText Markup Language. It is not a programming language. It is a markup language: you mark up your content to tell the browser what each piece is. This is a heading. This is a paragraph. This is a link. And you do that with tags.
Think of tags as labels you stick on your content. A tag is a short word inside angle brackets. Here, the opening p tag says "a paragraph starts here". The closing tag looks the same, but with a forward slash before the p, and it says "the paragraph ends here".
The opening tag, the content and the closing tag together are called an element. So this whole line is one paragraph element. Now, attributes. An attribute gives an element extra information, and it always lives inside the opening tag. Look at this link. The a tag creates a link, and href is an attribute.
An attribute has a name, an equals sign, and a value inside double quotes. Here the value tells the link where to go. You will meet many attributes in this course: href for links, src for images, and lang, which you will see in a minute.
Elements can also sit inside other elements. We call that nesting. In this line, the word coffee is inside a strong element, and the strong element is inside the paragraph. The rule is simple: close tags in the reverse order you opened them, like small boxes inside a bigger box.
2:19 The HTML boilerplate, line by line
Every HTML page starts with the same basic structure. Developers call it the boilerplate. Let us type it by hand once, so you know exactly what each line does. After today, you will recognise it on every website you inspect. The first line, doctype html, tells the browser: this is a modern HTML5 document.
It is always the very first line. Next comes the html element. It wraps the whole page, and its lang attribute says the page is written in English. That small detail helps screen readers and search engines. Inside the html element there are two parts: head and body.
The head holds information about the page that visitors do not see on the page itself. The meta charset line makes sure every letter shows correctly, even accents and emojis. The viewport line makes the page fit phone screens, and we will use it a lot later in the course.
The title is the text on the browser tab and in Google search results. Notice that the meta tags have no closing tag. Some elements, like meta, image and line break, have no content inside them, so they do not need one. We call them empty elements.
Also notice the spaces at the start of each line. The browser ignores them, but they show humans which element sits inside which. The body holds everything visitors actually see: text, images, links and buttons. Save the file and open it with Live Server. The page is blank because the body is empty, but look at the tab.
There is your title. Change the title text, save again, and the tab updates right away. 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.
4:17 The Emmet shortcut
Typing all that every time would get boring, so here is a shortcut. VS Code has a built-in tool called Emmet. In a new HTML file, type an exclamation mark and press Enter. The whole boilerplate appears instantly. Emmet can do much more, like typing just the letter p and pressing Tab to get a full paragraph tag, and we will use it throughout the course.
Two things to check. Emmet writes the title as the word Document, so always change it to something meaningful. And if the shortcut does nothing, look at the bottom-right corner of VS Code and make sure the language mode says HTML. If you use Prettier, it may write doctype in small letters and add a slash at the end of meta tags.
Both styles are correct.
5:07 Start your website: heading, paragraphs, comments
Now let us start the website you will build throughout this course. I am using an example name, Sara Ahmed, but please use your own. Inside the body, add an h1 tag. The h1 is the main heading of the page, the biggest and most important one.
Below it, add two paragraphs about yourself. Keep them short and friendly; you can always change them later. Save, and the browser updates on its own. The heading is big and bold, and each paragraph starts on a new line. That is because the browser gives every element a default style.
In module three you will replace those defaults with your own design. Let us peek with DevTools. Right-click the heading and choose Inspect. There is your h1, inside the body, inside the html element. It is exactly the nesting you typed. You can even double-click the text in the Elements panel and change it, and the page changes instantly.
But that change lives only in the browser. Refresh, and it is gone. To change your website for real, you always edit the file in VS Code. One more tool: comments. A comment is a note for humans, and the browser ignores it completely. You start it with a less-than sign, an exclamation mark and two dashes, and you end it with two dashes and a greater-than sign.
Use comments to label sections or leave reminders for yourself. Quick tip: put your cursor on a line and press Control and slash, and VS Code turns it into a comment for you. Common mistake: forgetting a closing tag. If text suddenly turns bold everywhere, or one paragraph swallows the next, look for a missing closing tag first.
The colours in VS Code help here: matching tags are highlighted together when you click on one of 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:12 Practice challenge
Your turn. Add a third paragraph that says what you want to build after this course. Maybe a website for a business, a portfolio, or your first freelance project. Above it, add an HTML comment that says "My goal". Remember to save, so Live Server can refresh the page.
Then check the browser: the paragraph should appear, and the comment should not. Pause the video now and try it. The solution is in the course files linked in the description.
7:43 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. In a link like the one on screen, what is href? A: A tag. B: An element. C: An attribute. D: A comment.
The answer is C. Attributes live inside the opening tag and give extra information. Here, href says where the link goes. Question two. Where does the content that visitors see go? A: Inside the head tag. B: Inside the body tag. C: Inside the title tag.
D: Before doctype html. The answer is B. The head tag holds information about the page, the body tag holds everything visible. Question three. Which line tells the browser: this is a modern HTML5 document? A: an html5 tag. B: the meta charset line. C: doctype html.
D: an HTML comment. The answer is C. Doctype html is always the very first line of an HTML5 page.
9:11 Outro and next video
Today you learned tags, elements and attributes, wrote the HTML boilerplate by hand and with Emmet, and started your own website. In the next video, Headings, Text Formatting and Lists, we will make your page easy to scan. If this helped, give it a like, and tell me in the comments what your goal is.
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!