HTML
HTML
What is HTML?
HTML is an incredibly powerful and versatile language that lets you create everything from simple web pages
to complex web applications, with the amazing ability to structure content on the web.
<!DOCTYPE html>
<html>
<body>
This is some text.
</body>
</html>
In this example, the text inside the <body> tag will be displayed as text on the webpage.
EASTER 1 | P a g e
HTML
Comments in HTML
Comments are notes in the code that don't appear on the web page. They are useful for:
Explaining complex code
Leaving notes for yourself or others
Temporarily disabling code
In HTML, comments are written between <!-- and -->.
Here's an example:
<!-- This is a comment -->
<p>This is a paragraph.</p>
Headings
You're probably not going to use only plain text on your website, right? If you want to add a title or section
name, the best way is to use headings. There are six levels of headings, from <h1> (the most important)
to <h6> (the least important).
<h1>This is a main heading</h1>
<h2>This is a subheading</h2>
<h3>This is a sub-subheading</h3>
EASTER 2 | P a g e
HTML
"Headings organize your content and make it easier for people and search engines to understand your page.
Start with <h1> for the main title and use <h2> to <h6> for other sections."
Paragraphs
In HTML, paragraphs are used to show blocks of text. You define them with the <p> tag.
When you put text between <p> and </p>, the browser will display it as a separate paragraph with some space
above and below.
Here’s how you can add a paragraph in HTML:
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
For example, if you're creating an article, the title would be a heading, and the actual text would be a
paragraph.
Line Breaks
In HTML, the <br> tag is used to create a line break. This tag is useful when you want to start text on a new
line without creating a new paragraph. Unlike the <p> tag, which adds a blank line before and after the text,
the <br> tag simply moves the text to the next line.
Here's how you can use the <br> tag in HTML:
<p>This is a line.<br>This is another line.</p>
In this example, "This is a line." and "This is another line." will be displayed on separate lines within the same
paragraph. The <br> tag is an empty element, which means it doesn't have a closing tag. You just
write <br> where you want the line break to occur.
EASTER 3 | P a g e
HTML
Recap - Formatting
Now that we have learned the basics of text formatting in HTML, let's recap what we've covered:
Headings: Use <h1> to <h6> tags to create headings of different levels. <h1> is the most important,
and <h6> is the least.
Paragraphs: Use <p> tags to create paragraphs. Browsers automatically add space above and below
each paragraph.
Line Breaks: Use the <br> tag to create a line break within a paragraph without starting a new one.
Bold and Italic Text: Use <strong> tags to make text bold and <em> tags to make text italic.
Here's an example that combines these elements:
<h1>Main Heading</h1>
<p>This is a <strong>bold</strong> paragraph. Here is a line break:<br>This is <em>italic</em> text.</p>
In this example, we have a main heading, a paragraph with bold and italic text, and a line break within the
paragraph. This demonstrates how to use different formatting tags together to create well-structured and
styled content.
Unordered List
In HTML, an unordered list is a list of items that are not ordered by numbers or letters. Instead, each item is
marked with a bullet point. To create an unordered list, you use the <ul> tag. Each item in the list is defined
using the <li> tag.
Here's how you can create an unordered list in HTML:
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
In this example, the <ul> tag defines the unordered list, and each <li> tag represents a list item. When
displayed in a browser, this code will create a list with bullet points:
Item 1
Item 2
Item 3
EASTER 4 | P a g e
HTML
Unordered lists are useful for presenting items where the order doesn't matter, such as a list of ingredients or
features.
Nested Lists
You can place one list inside another—this is called a nested list. This is useful for creating hierarchical
structures, such as outlines or multi-level menus.
To create a nested list, you simply place an <ul> or <ol> element inside an <li> element of another list.
Here's an example of a nested unordered list:
<ul>
<li>Item 1</li>
<li>Item 2
<ul>
<li>Subitem 2.1</li>
<li>Subitem 2.2</li>
</ul>
</li>
EASTER 5 | P a g e
HTML
<li>Item 3</li>
</ul>
The second item contains a nested list with two subitems. In the browser, it will display like this:
Item 1
Item 2
o Subitem 2.1
o Subitem 2.2
Item 3
You can also nest ordered lists or mix both.
Recap - Lists
Let's recap what we've learned about lists in HTML:
Unordered Lists: Use <ul> to create a list with bullet points. Each item is defined using <li>.
Ordered Lists: Use <ol> to create a numbered list. Each item is defined using <li>.
Nested Lists: Place one list inside another by putting an <ul> or <ol> element inside an <li> element of
another list.
HTML Attributes
In HTML, attributes provide additional information about elements. They are used to define properties of an
element, such as its size, color, or behavior. Attributes are always specified in the start tag and usually come in
name/value pairs like name="value".
Here's the general syntax for adding attributes to an HTML element:
<tagname attribute1="value1" attribute2="value2">Content</tagname>
In this example, tagname is the name of the HTML element (e.g., <p>, <strong>, <h3>), attribute1 and
attribute2 are the names of the attributes, and "value1" and "value2" are the values assigned to those
attributes.
Links
In HTML, a link (or hyperlink) is an element that connects one web page to another.
You can create links to other web pages, files, locations within the same page or any other URL. Links are
created using the <a> tag, which stands for anchor.
Here's the basic syntax for creating a link in HTML:
EASTER 6 | P a g e
HTML
Images
Images can make your webpage more engaging, and adding them in HTML is simple using the <img> tag.
The <img> tag is self-closing, meaning it doesn’t need an ending tag.
To display an image, you need to use the src attribute. This attribute specifies the image's location (URL or file
path). Here's an example:
<img src="[Link] />
In this example, the browser will load and display the image from the URL [Link]
Self-closing tags, like <img>, don’t need a closing tag. They end with /> and are used for elements that
don’t have content inside.
Image Attributes
Let’s explore some additional attributes to improve your images:
1. alt: Provides alternative text if the image doesn’t load .
2. width and height: Control the size of the image in pixels.
EASTER 7 | P a g e
HTML
Here’s an example:
<img src="[Link]" alt="A scenic view of mountains" width="600" height="400" />
This sets the image source, provides a description, and sizes it to 600x400 pixels. Always include alt for
accessibility and use dimensions to maintain design consistency.
Divisions
Imagine you want to break your webpage into blocks to organize your content. In HTML, you can use a div to
group elements together.
div tags are great for creating layouts and separating sections.
Here's the basic syntax:
<div>
<!-- Content goes here -->
</div>
You can add other HTML elements inside a div, such as paragraphs, headings, images, and even
other div elements.
Here's an example of how to use div tags to create a simple layout with a header, main content area, and
footer:
<div>
<h1>Header</h1>
</div>
<div>
<p>Main content goes here.</p>
</div>
<div>
<p>Footer</p>
</div>
Inline Spans
What if we have a sentence and need to highlight just one word or a small part of it? We can use
the <span> tag! It helps us apply styles or make changes to only a specific part of the text without affecting the
rest.
Here's the basic syntax for using a span in HTML:
<span>This is some text.</span>
Here's an example of how to use span tags to highlight a portion of text within a paragraph:
EASTER 8 | P a g e
HTML
Semantic Tags
Semantic tags in HTML help define the meaning of content, making the code clearer for both developers and
browsers. Unlike <div> and <span>, they give context to the enclosed content.
Common Semantic Tags:
<header> – Introductory content, usually at the top.
<nav> – Contains navigation links.
<main> – Main content of the page.
<article> – A self-contained piece like a blog post.
<section> – Groups related content, often with a heading.
<footer> – Bottom section with info like copyright or contact details.
<header>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</header>
<main>
<article>
<h2>Article Title</h2>
<p>Article content goes here.</p>
</article>
</main>
<footer>
<p>Copyright 2023</p>
</footer>
This structure provides a clear and meaningful layout for the content.
EASTER 9 | P a g e
HTML
Recap - Layout
Let's recap what we've learned about page layout in HTML:
Divisions: Use <div> tags to create containers that group other elements together. They are block-level
elements, taking up the full width available.
Inline Spans: Use <span> tags to create inline containers for text or inline elements. They only take up
as much width as necessary.
Semantic Tags: Use tags like <header>, <nav>, <main>, <article>, <section>, and <footer> to structure
your content meaningfully.
Challenge
Easy
EASTER 10 | P a g e
HTML
Create an HTML document that includes all the layout elements we've learned so far:
1. A <header> with a main heading (<h1>) that says "My Website" and a navigation (<nav>) with links to
"Home", "About", and “Contact”. (in an unordered list)
2. A <main> section with a <div> that contains a paragraph (<p>) with the text "This is the main content
area.". Inside the paragraph, use a <span> tag to wrap the word "main".
3. Inside the main section, a <section> with a heading (<h2>) that says "About Us" and an <article> with a
heading (<h3>) that says "Our Mission" and a paragraph (<p>) with some dummy text.
4. A <footer> with a paragraph (<p>) that says "Copyright 2024 My Website".
Project Overview
In this project, you will create a basic personal profile page using HTML. The page will include a header with
your name and tagline, a profile picture, an about me section, and links to your social media profiles. Using
<div>, <img>, and <a> tags, you will structure the page to showcase your creativity while reinforcing your
understanding of HTML layout and elements
Challenge
Easy
Create an empty HTML document from zero, don't forget the html and body tags.
Header Section
Challenge
Easy
Create a header for your profile page using a <div> that includes your name inside an <h1> tag and a tagline
inside a <p> tag.
For example:
John Doe
Web Developer | Creative Thinker
Profile Picture
EASTER 11 | P a g e
HTML
Challenge
Easy
Alright, it’s time to add the profile picture! You can use any image you like. Feel free to use the link from the
example below.
1. Below the header, create a <div>. Inside it, add an <img> tag.
2. Set the src to link to your image, and use the width and height attributes to control its size.
For example:
src - [Link]
width - 200
height - 200"
About Me Section
Challenge
Easy
This is your profile—let people know who you are!
1. After adding your profile picture, create a <div>.
2. Inside it, add a heading with <h2> that says 'About Me'. Add short paragraph <p> to share a little about
yourself.
For example:
Hello! I'm a passionate web developer learning HTML basics. I enjoy coding and building creative
projects.
Social Links
Challenge
Easy
Let’s share your social media—people will want to connect!
1. After the 'About Me' section, add another <div>.
2. Inside it, create a heading with an <h2> tag that says 'Connect with Me'.
3. Add clickable links to your social media profiles using <a> tags. Remember to make the links open in a
new tab by adding target="_blank"
EASTER 12 | P a g e
HTML
For example:
LinkedIn | Twitter | Instagram | Facebook
Form Basics
In HTML, forms are used to collect user input. A form is a section of a document that contains controls such as
text fields, buttons, checkboxes, and more. Users can interact with these controls to provide data, which can
then be sent to a server for processing. Forms are essential for creating interactive web pages that allow users
to submit information, such as login credentials, search queries, or feedback.
Here's the basic structure of an HTML form:
<form>
<!-- Form elements go here -->
</form>
Text Inputs
In HTML, text inputs are used to create form fields where users can enter text. There are various types of text
inputs, each designed for different kinds of text-based data. The most common type is the single-line text
input, created using the <input> tag with the type attribute set to "text".
Here's the basic syntax for creating a text input in HTML:
<input type="text" name="fieldname">
<input>: The tag that defines the input field.
type="text": An attribute that specifies the input type as text.
name: An attribute that gives the input field a name, which is used to identify the data when the form
is submitted.
Note: input is a special tag, it does not require a closing tag!
Input Attributes
Here are some other useful attributes for text inputs:
placeholder: Provides a short hint that describes the expected value of the input field (e.g., "Enter your
name").
value: Sets the initial value of the input field.
maxlength: Specifies the maximum number of characters allowed in the input field.
EASTER 13 | P a g e
HTML
Password Field
In HTML, a password field is a type of input field used to collect passwords from users. It is similar to a regular
text input field, but the characters typed into a password field are masked, usually displayed as asterisks or
dots. This is to prevent others from seeing the password as it is being typed. To create a password field, you
use the <input> tag with the type attribute set to "password".
Here's the basic syntax for creating a password field in HTML:
<input type="password" name="passwordfield">
EASTER 14 | P a g e
HTML
Text Inputs: Use <input type="text"> to create single-line text input fields. Use attributes like placeholder,
name , value and maxlength to customize the input field.
Password Fields: Use <input type="password"> to create password fields where the characters are masked.
Labels: Use <label> tags to add descriptions to form fields. Use the for attribute to associate the label with a
specific form field by matching its id attribute.
Challenge
Easy
Create an HTML document as shown in the picture below:
It should include three label-input pairs:
A label with the text "Full Name:" associated with a text input field. The input field should have the name
"fullname" and a placeholder that says "Enter your full name".
A label with the text "Email:" associated with a text input field. The input field should have the name "email"
and a placeholder that says "Enter your email".
A label with the text "Password:" associated with a password input field. The input field should have the name
"userpassword" and a placeholder that says "Enter your password". Set the maximum length of this field to 20
characters.
Radio Buttons
In HTML, radio buttons are used to create a set of mutually exclusive options, where the user can select only
one option from the group. Radio buttons are created using the <input> tag with the type attribute set to
"radio".
Here's the basic syntax for creating a radio button in HTML:
<input type="radio" id="option1" name="radiogroup" value="option1">
<label for="option1">Option 1</label>
<input>: The tag that defines the input field.
type="radio": An attribute that specifies the input type as a radio button.
id: An attribute that gives the radio button a unique identifier.
name: An attribute that groups radio buttons together. All radio buttons with the same name belong
to the same group, and only one option within a group can be selected at a time.
value: An attribute that specifies the value associated with the radio button. This value is sent to the
server when the form is submitted.
EASTER 15 | P a g e
HTML
<label>: A tag that provides a clickable label for the radio button. The for attribute of the label should
match the id attribute of the radio button.
Here's an example of how to create a group of radio buttons:
<form>
<input type="radio" id="option1" name="mygroup" value="option1">
<label for="option1">Option 1</label>
<br>
In HTML, checkboxes are used to create a set of options where the user can select multiple options from the
group. Checkboxes are created using the <input> tag with the type attribute set to "checkbox".
Here's the basic syntax for creating a checkbox in HTML:
<input type="checkbox" id="option1" name="checkboxgroup" value="option1">
<label for="option1">Option 1</label>
<input>: The tag that defines the input field.
type="checkbox": An attribute that specifies the input type as a checkbox.
id: An attribute that gives the checkbox a unique identifier.
name: An attribute that groups checkboxes together. Unlike radio buttons, multiple checkboxes with
the same name can be selected at the same time.
value: An attribute that specifies the value associated with the checkbox. This value is sent to the
server when the form is submitted.
<label>: A tag that provides a clickable label for the checkbox. The for attribute of the label should
match the id attribute of the checkbox.
EASTER 16 | P a g e
HTML
Dropdowns
In HTML, a dropdown menu is a list of items that appears when a user clicks on or hovers over an element.
Dropdowns are commonly used to present a list of choices in a compact way. To create a dropdown, you use
the <select> tag along with <option> tags for the individual items.
Here's the basic syntax for creating a dropdown in HTML:
<select name="dropdown">
<option value="value1">Option 1</option>
<option value="value2">Option 2</option>
<option value="value3">Option 3</option>
</select>
<select>: The tag that defines the dropdown menu.
name: An attribute that gives the dropdown a name, which is used to identify the selected value when
the form is submitted.
<option>: A tag that defines an item in the dropdown list.
value: An attribute that specifies the value associated with the option. This value is sent to the server
when the form is submitted.
Option text: The visible text that appears in the dropdown list for each option.
Here's an example of how to create a dropdown with three options:
EASTER 17 | P a g e
HTML
<select name="colors">
<option value="red">Red</option>
<option value="green">Green</option>
<option value="blue">Blue</option>
</select>
In this example, we have a dropdown with the name "colors" and three options: Red, Green, and Blue.
Buttons
Buttons are interactive elements in HTML used to trigger actions when clicked. To create a button, you use
the <button> tag.
Here’s the basic syntax:
<button>Click Me</button>
Buttons in Forms
Buttons play a key role in forms, where they help submit data or reset fields. Let’s see how they work:
Submit Button:
<form>
<input type="text" name="username" placeholder="Enter username">
<button type="submit">Submit</button>
</form>
Reset Button:
<form>
<input type="text" name="name" value="John Doe">
<button type="reset">Reset</button>
</form>
type="reset": Clears all fields and resets them to their default values.
Table Basics
In HTML, a table is a way to organize data into rows and columns. Tables are commonly used to display
data in a structured format, such as schedules, statistics, or any other type of information that can be
presented in a grid. To create a table, you use the <table> tag along with other tags like <tr> for table
rows, <td> for table data (cells), and <th> for table headers.
EASTER 18 | P a g e
HTML
Header 1 Header 2
In this example, we have a table with two rows and two columns. The first row contains header cells,
and the subsequent rows contain regular data cells. This structure creates a simple grid layout that is
easy to read and understand.
Adding Captions
In HTML tables, a caption is a title or explanation for the table. It provides a brief description of the table's
content, making it easier for users to understand the purpose of the table. Captions are created using the
<caption> tag, which should be placed immediately after the <table> tag.
EASTER 19 | P a g e
HTML
</table>
Project Overview
In this project, you will create an event registration page using HTML. The page will include a header with the
event name, a schedule displayed in a table, a registration form with various input fields, and a footer with
social media links. This project combines all the concepts you've learned to build a complete webpage.
Challenge
Easy
Create an empty HTML document from zero, don't forget the html and body tags.
<!DOCTYPE html>
<html>
<body>
<div>
<h1>FSY CAMP 2026</h1>
<p>strenthening every youth</p>
<img src="[Link] width="200" height="100">
EASTER 21 | P a g e
HTML
</div>
<div>
<h2>Event Schedule</h2>
<table border="1">
<caption>Activity Schedule</caption>
<tr>
<th>Time</th>
<th>Activity</th>
<th>Location</th>
</tr>
<tr>
<td>6:00am-7:300am</td>
<td>Arrival</td>
<td>Main Hall</td>
</tr>
<tr>
<td>7:30am-9:00am</td>
<td>Breakfast</td>
<td>Dinning</td>
</tr>
<tr>
<td>9:00am-12:30pm</td>
<td>Getting to know your company</td>
<td>Room Appointed</td>
</tr>
<tr>
<td>12:30pm-2:00pm</td>
EASTER 22 | P a g e
HTML
<td>Lunch</td>
<td>Lunch</td>
</tr>
<tr>
<td>2:00pm-2:30pm</td>
<td>Depature</td>
<td>Depature</td>
</tr>
</table><br>
</div>
<div>
<h2>Register Now</h2>
<form>
<label for="name">Name:</label>
<input type="text" id="name" name="name" ><br><br>
<label for="email">Email</label>
<input type="email" id="email" name="email"><br><br>
<label for="session">Choose a session:</label>
<select id="session" name="session">
<option value="morning">Morning</option>
<option value="afternoon">Afternoon</option>
</select><br><br>
<input type="checkbox" id="terms" name="terms">
<label for="terms">I agree to the terms and conditions</label><br><br>
<button type="submit">Submit</button>
</form>
</div>
EASTER 23 | P a g e
HTML
<div>
<h2>Follow Us</h2>
<a href="[Link] target="_blank">Twitter</a><br>
<a href="[Link] target="_blank">Facebook</a>
</div>
</body>
</html>
EASTER 24 | P a g e