Course Content
KM-01: Hypertext Markup Language (HTML) Basics
This module introduces learners to the foundational concepts required to begin working with HTML programming. It covers basic computer concepts, the introduction to HTML programming, suitable Integrated Development Environments (IDEs), Git and GitHub, problem-solving in programming, the life cycle for developing a solution, and an overview of the look and feel of a website. The module builds the learner’s understanding of the fundamentals of HTML as a programming language and prepares them for more detailed HTML document structure, styling, and practical web development work in later modules.
0/15
KM-02: HTML Programming Principles
This module builds on the foundational knowledge from KM-01 and focuses on the core principles of HTML programming. It introduces learners to the structure of an HTML document, including tags, elements, and attributes, and how these are used to organise and present content on web pages. The module also covers HTML data types, text formatting, tables, file and folder structures, and semantic organisation of content. In addition, learners are introduced to how web pages communicate with remote servers. By the end of this module, learners will have a solid understanding of how to create well-structured, readable, and functional HTML documents that form the backbone of web development.
0/21
KM-03: HTML and Cascading Style Sheets (CSS) Styling Principles
This module introduces learners to the principles of styling web pages using Cascading Style Sheets (CSS). While HTML provides the structure of a webpage, CSS is used to control the appearance, layout, and visual presentation. Learners will develop the ability to design visually appealing and user-friendly web pages by applying styling techniques such as colours, fonts, spacing, layouts, and responsive design. The module also introduces HTML forms, which are used to collect user input and are an important part of interactive web applications. By the end of this module, learners will be able to apply CSS styling principles to improve the readability, usability, and overall user experience of web pages.
0/7
KM-04: HTML Intermediate Programming Functionalities
This module builds on foundational HTML knowledge and introduces learners to more advanced and interactive web development features. Learners will explore how to create dynamic and interactive web pages using HTML5 functionalities and APIs, as well as how to work with multimedia, offline capabilities, and modern web technologies. The module focuses on improving user experience and preparing learners for real-world web development environments.
0/15
WM-01: Workplace Module
Introduction to Workplace Modules Workplace Modules are designed to ensure that learners: -Apply their skills in a real or simulated work environment -Demonstrate industry readiness -Perform tasks aligned with real job roles
0/1
HTML Programmer

Lesson Outcomes

After completing this lesson, learners will be able to:

  • Define HTML attributes.
  • Explain the purpose of attributes in HTML elements.
  • Identify common HTML attributes.
  • Understand how attributes are written in HTML tags.
  • Apply attributes to enhance HTML elements.

Overview

HTML attributes provide additional information about HTML elements. They are used to modify or enhance the behaviour and appearance of elements on a web page.

Attributes are always included in the opening tag of an element and are written as name-value pairs.

Understanding attributes is important because they allow developers to:

  • Add links to elements
  • Display images correctly
  • Control styling and behaviour
  • Provide extra information to browsers

1. What are HTML Attributes?

HTML attributes are used to define additional properties of HTML elements.

They:

  • Provide extra information about an element
  • Modify how an element behaves
  • Help customise content display

Attributes are always written inside the opening tag.


2. Structure of Attributes

Attributes follow a specific format.

Syntax

 
<tag attribute="value">Content</tag>
 

Example

 
<a href="https://example.com">Visit Site</a>
 

In this example:

  • href is the attribute
  • "https://example.com" is the value

Key Points

  • Attributes are written in the opening tag
  • Values are usually placed inside quotation marks
  • Multiple attributes can be added to one element

3. Common HTML Attributes

There are many attributes used in HTML.

3.1 href Attribute

Used in links.

Example:

 
<a href="https://example.com">Visit</a>
 

Purpose:

  • Specifies the destination of a link

3.2 src Attribute

Used in images.

Example:

 
<img src="image.jpg">
 

Purpose:

  • Specifies the source of the image

3.3 alt Attribute

Used in images.

Example:

 
<img src="image.jpg" alt="A description">
 

Purpose:

  • Provides alternative text if the image cannot be displayed
  • Improves accessibility

3.4 class Attribute

Used for styling and grouping elements.

Example:

 
<p class="intro">Welcome</p>
 

Purpose:

  • Applies styles using CSS
  • Groups elements together

3.5 id Attribute

Used to uniquely identify elements.

Example:

 
<h1 id="main-title">Title</h1>
 

Purpose:

  • Identifies a specific element
  • Used in styling and scripting

4. Multiple Attributes

An element can have more than one attribute.

Example:

 
<img src="image.jpg" alt="Image" width="300" height="200">
 

This example includes:

  • src → image source
  • alt → description
  • width and height → size

5. Importance of Attributes

Attributes are important because they:

  • Add functionality to elements
  • Improve accessibility
  • Help structure and organise content
  • Enable styling and interaction

Without attributes, HTML elements would be very limited in functionality.


Key Notes

  • Attributes provide additional information about HTML elements.
  • They are written inside opening tags.
  • Attributes use name-value pairs.
  • Common attributes include href, src, alt, class, and id.
  • Multiple attributes can be used in a single element.
  • Attributes improve functionality, accessibility, and structure.
Scroll to Top