Learn HTML
Lesson 1 - Overview Of The Web And HTML
Lesson 2 - HTML Tags And Elements
Lesson 3 - Images And Multimedia
Lesson 5 - Overview Of CSS
Lesson 6 - CSS Selectors And Properties
Lesson 7 - Applying CSS To HTML
Lesson 8 - Box Model
Lesson 9 - Positioning And Layout
Lesson 10 - Flexbox
In this lesson, we're going to create a simple webpage that incorporates everything we've learned so far.
Let's follow the example below:
<!DOCTYPE html> <html> <head> <title>List of Fruits</title> </head> <body> <h1>List of Fruits Page</h1> <p>This page contains a list of fruits.</p> <img src="https://www.fruitsmith.com/pub/media/mageplaza/blog/post/o/n/one_seed_fruits.png" alt="Fruits" width="350" height="200"> <h2>My Favorite Fruits</h2> <ul> <li>Apple</li> <li>Banana</li> <li>Cherry</li> </ul> <button>Click Me!</button> </body> </html>
In this example:
<!DOCTYPE html>
, which specifies the document type and is necessary for browsers to understand the version of HTML being used.<html>
, we have <head>
and <body>
sections. The <head>
contains metadata such as the webpage title, set by <title>List of Fruits</title>
.<body>
, we have structured our content:
<h1>
and <p>
tags provide a heading and a paragraph introducing the page.<img>
displays an image of fruits with specified dimensions (width="350"
and height="200"
), enhancing visual appeal.<h2>
and <ul>
with <li>
items create a list titled "My Favorite Fruits".<button>
element is included for interactivity.This basic structure demonstrates how to organise content within HTML tags to create a cohesive webpage. In our next lesson, we'll explore CSS to enhance the design and style of our page.