Lesson Outcomes
After completing this lesson, learners will be able to:
- Define Hypertext Markup Language (HTML).
- Explain the purpose of HTML in web development.
- Identify basic HTML elements, tags, and attributes.
- Describe how HTML is used to structure web pages.
- Understand how HTML works with web browsers.
Overview
HTML (Hypertext Markup Language) is the standard language used to create and structure web pages.
It is not a programming language in the traditional sense, but a markup language that uses tags to define elements on a web page.
HTML allows developers to:
- Structure content (text, images, links)
- Create web pages
- Link pages together
- Embed multimedia content
Understanding HTML is the first step in becoming a web developer.
1. What is HTML?
HTML stands for Hypertext Markup Language.
It is used to create the structure of web pages by marking up content with tags.
Key concepts of HTML include:
- Hypertext
- Allows linking between web pages
- Enables navigation using hyperlinks
- Markup Language
- Uses tags to define elements
- Tells the browser how content should be displayed
- Web Pages
- HTML is the foundation of all web pages
- Every website uses HTML in some form
HTML provides the structure, while other technologies like CSS and JavaScript add styling and interactivity.
2. Purpose of HTML
HTML is used to organise and present content on the web.
The main purposes of HTML include:
2.1 Structuring Content
HTML helps organise content into sections such as:
- Headings
- Paragraphs
- Lists
- Tables
This makes web pages easy to read and understand.
2.2 Creating Links
HTML allows developers to create hyperlinks that connect:
- Web pages
- Files
- Sections within a page
These links make navigation possible across websites.
2.3 Embedding Media
HTML supports adding media such as:
- Images
- Audio
- Video
This improves user experience and engagement.
2.4 Supporting Accessibility
HTML helps make web content accessible by:
- Structuring content properly
- Supporting screen readers
- Using meaningful tags
3. HTML Tags, Elements, and Attributes
HTML uses tags to define elements on a page.
3.1 Tags
Tags are keywords enclosed in angle brackets.
Examples include:
<p>for paragraphs<h1>for headings<a>for links
Tags usually come in pairs:
- Opening tag →
<p> - Closing tag →
</p>
3.2 Elements
An HTML element consists of:
- Opening tag
- Content
- Closing tag
Example:
<p>This is a paragraph</p>
This is a complete HTML element.
3.3 Attributes
Attributes provide additional information about elements.
They are included in the opening tag.
Examples:
hrefin linkssrcin imagesaltfor image descriptions
Example:
<a href="https://example.com">Visit Site</a>
4. Structure of an HTML Page
An HTML document has a standard structure.
Basic structure includes:
<!DOCTYPE html>→ Defines the document type<html>→ Root element<head>→ Contains metadata<title>→ Page title<body>→ Visible content
Example structure:
<!DOCTYPE html>
<html>
<head>
<title>My Page</title>
</head>
<body>
<h1>Hello World</h1>
<p>This is my first webpage.</p>
</body>
</html>
Key Points
- The
<head>section is not visible to users. - The
<body>contains all visible content. - Browsers read HTML from top to bottom.
5. How HTML Works
HTML works together with web browsers.
Process of how HTML works:
- A developer writes HTML code.
- The file is saved with a
.htmlextension. - A web browser reads the HTML file.
- The browser interprets the tags.
- The content is displayed as a web page.
Role of the Browser
Browsers such as:
- Google Chrome
- Microsoft Edge
- Mozilla Firefox
are responsible for:
- Rendering HTML content
- Interpreting tags and elements
- Displaying the page visually
6. HTML in Web Development
HTML is one of the core technologies used in web development.
It works together with:
6.1 CSS (Cascading Style Sheets)
- Controls appearance and layout
- Adds colours, fonts, spacing
6.2 JavaScript
- Adds interactivity
- Handles user actions
- Creates dynamic content
Together, these technologies form the foundation of modern web development.
Key Notes
- HTML stands for Hypertext Markup Language.
- It is used to structure content on web pages.
- HTML uses tags, elements, and attributes.
- A basic HTML page includes
<html>,<head>, and<body>. - Browsers interpret HTML and display it to users.
- HTML works with CSS and JavaScript to create complete web applications.