Web development is like building a house:
Today, we're going to learn about each one and how they work together to create the dynamic web pages you see and interact with every day!
What is HTML?
Basic HTML structure:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
Key points:
What is CSS?
Basic CSS syntax:
selector {
property: value;
}
CSS Example:
To change the background color and font color of a paragraph:
p {
background-color: yellow;
color: red;
}
Ways to add CSS to HTML:
<p style="color:blue;">This is a blue paragraph.</p>
<head>
<style>
p { color: blue; }
</style>
</head>
<head>
<link rel="stylesheet" href="styles.css">
</head>
What is JavaScript?
Basic JavaScript:
<button onclick="displayAlert()">Click Me!</button>
<script>
function displayAlert() {
alert('Button was clicked!');
}
</script>
Common uses of JavaScript:
Imagine you're creating a web-based quiz: