EXERCISE 1
EXERCISE 1
1. Introduction to HTML
• Topics: Basic structure of an HTML document, doctype, tags, elements, and attributes.
• Exercise:
• Topics: Heading tags (<h1> to <h6>), paragraphs (<p>), line breaks (<br>).
• Exercise:
Create a webpage with a title and multiple paragraphs formatted using headings.
Create:
3. Text Formatting
• Topics: Bold (<b>), italic (<i>), underline (<u>), superscript (<sup>), subscript (<sub>).
• Exercise:
1. Format a block of text using different formatting tags (bold, italic, underline).
2. Write a sentence that includes both bold and italic text using the <b> and <i> tags.
3. Underline the word "important" in the following sentence using the <u> tag:
6. Combine bold, italic, and underline tags to format the following sentence:
4. Lists
• Topics: Ordered lists (<ol>), unordered lists (<ul>), list items (<li>), and nested lists.
• Exercise:
1. Create an ordered and unordered list of your favorite hobbies.Create a numeric , alphabate .
2.Create an ordered list (<ol>) with three items: "Apples," "Bananas," and "Cherries."
• Dog
• Cat
• Rabbit
4. Write an ordered list (<ol>) of three items where each item contains a sub-item as an
unordered list (<ul>):
5. Nest the following lists inside each other to create a multi-level list:
6. Modify the following unordered list to create a nested ordered list within it:
<ul>
<li>Continents</li>
<li>Countries</li>
</ul>
9.Create:
• Topics: Links (<a>), absolute vs relative links, opening links in new tabs.
• Exercise:
1.Create a webpage with several links, including internal and external links.
2.Write an HTML link (<a>) that takes the user to https://www.example.com. Use
"Click Here" as the link text.
3.What is the difference between an absolute link and a relative link? Provide an
example of each.
4.Create a link (<a>) that points to a file called about.html located in the same folder as
your current HTML file. Use "About Us" as the link text.
6.Create a link that points to an image file named image.jpg in a folder called images.
The link text should be "View Image."
7.What attribute would you use to open a link in a new browser window or tab? Write
an example link to open https://www.google.com in a new tab.
6. Images
• Topics: Adding images (<img>), image attributes (src, alt, width, height).
Attribute Description
src
Specifies the path to the image.
alt Provides alternate text for the image, useful for informing users
about the image and displaying in case of network issues.
height
Specifies the height of the image.
width
Specifies the width of the image.
ismap
Specifies an image as a server-side image map.
usemap
Specifies an image as a client-side image map.
• Exercise:
1.Create a photo gallery using images with alt text and dimensions.
2.Write an HTML image tag (<img>) to display an image called photo.jpg that is
located in the same directory as your HTML file.
3.Add an alt attribute to the following image tag to describe the image as "A beautiful
sunset":
<img src="sunset.jpg">
4. Display an image called logo.png with a width of 200 pixels and a height of 100 pixels.
5. Correct the following image tag by adding the missing src attribute and use alt="Sample
image":
6.Create an image tag that displays mountain.jpg, but if the image fails to load, the text
"Mountain landscape" should be shown in its place.
7. Modify the following image tag to make the image responsive by only setting the width to
100% (and removing the height):