Welcome to this lesson on interactive web design! In this 150-minute session, you will learn the basics of creating a simple webpage from scratch. We will start with understanding how websites work, then move on to building the structure with HTML, adding styles with CSS, and finally making it interactive with JavaScript. By the end, you will build a small webpage with a heading, text, an image, a styled button, a form, and a fun interactive feature. This is beginner-friendly, so no prior knowledge is needed. Let's get started!
Websites are everywhere β from social media to online shops. Learning to build them helps you create your own digital projects and understand the web better. It's creative and useful for school or hobbies.
For this lesson, we will use a free online tool called JSFiddle. Go to JSFiddle and create a new fiddle. It has sections for HTML, CSS, and JavaScript. You can type code there and see the result instantly.
Websites are like digital books that you read on a browser, such as Chrome or Firefox. They are made up of three main parts: HTML for the structure (like the skeleton), CSS for the style (like the clothes), and JavaScript for interactivity (like making things move or respond).
When you visit a website, your browser downloads these files from a server and displays them. Today, we will build everything in one place using JSFiddle.
Let's start building! In JSFiddle's HTML section, type this basic structure:
<!DOCTYPE html>
<html>
<head>
<title>My First Webpage</title>
</head>
<body>
<!-- Your content goes here -->
</body>
</html>
This is the skeleton. The <head> has the title, and <body> is where your page content goes. Click 'Run' to see it (it will be blank for now).
Inside the <body> tag, add a heading and some text:
<h1>Welcome to My Webpage!</h1>
<p>This is some sample text. I can write about my favourite hobby here.</p>
<h1> is a big heading, and <p> is a paragraph. Run the code to see it appear.
To add an image, use the <img> tag. Find a free image URL online (e.g., from Unsplash). Add this after your paragraph:
<img src="https://example.com/image.jpg" alt="Description of image" width="300">
Replace the src with your image URL. The alt is for accessibility.