🚀 HTML Tutorial: Getting Started
Welcome to your first HTML lesson! Below are examples of how to write basic HTML, style it with CSS, and interact using JavaScript. Try copying and using them in your editor.
1️⃣ Basic HTML Structure
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My First Page</title>
</head>
<body>
<h1>Hello, world!</h1>
</body>
</html>
2️⃣ CSS Styling
body {
background-color: #f5f5f5;
font-family: Arial, sans-serif;
color: #333;
}
h1 {
color: darkblue;
}
3️⃣ JavaScript Interaction
function greetUser(name) {
alert("Hello, " + name + "!");
}
greetUser("Alice");