Week 1: Getting Started with HTML
Your first steps into the world of web page structure.
Explore Chapter 1Basic HTML Document Structure
Every HTML document has a basic structure. Here's the breakdown:
<!DOCTYPE html>
<html>
<head>
<title>My First Webpage</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>This is my first webpage.</p>
</body>
</html>
- <!DOCTYPE html>: The document type declaration. It tells the browser that this is an HTML5 document.
- <html>: The root element of the page.
- <head>: Contains meta-information about the HTML document (like the title, character set, links to stylesheets).
- <title>: Specifies a title for the HTML document, which is shown in the browser's title bar or tab.
- <body>: Contains the visible page content.
Your First HTML Page: Hello, World!
Let's create your first HTML page.
- Open your text editor.
- Create a new file named "index.html".
- Paste in the following code:
- Save the file.
- Open the "index.html" file in your web browser (double-click it).
- You should see "Hello, World!" in big letters, and "Welcome to HTML!" below it.
<!DOCTYPE html>
<html>
<head>
<title>My First HTML Page</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>Welcome to HTML!</p>
</body>
</html>