What is HTML?
HTML (HyperText Markup Language) is the standard language used to create web pages. It provides structure for your content and works alongside CSS (for styling) and JavaScript (for interactivity).
Basic HTML Document Structure
Every HTML page follows a basic structure:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My First Page</title>
</head>
<body>
<h1>Hello World!</h1>
<p>This is my first web page.</p>
</body>
</html>
- <!DOCTYPE html> tells the browser this is an HTML5 document.
- <html> wraps all the content on the page.
- <head> contains information about the page (metadata).
- <body> contains the visible content.
Exercise
Create a page with your name as the title and a welcome message in the body.
- Open your code editor.
- Create a new file called
lesson1.html
. - Type the HTML structure shown above.
- Replace
<title>My First Page</title>
with your name. - In the
<body>
, write a welcome message. - Save and open the file in your browser.