Your first HTML page
Create a folder anywhere on your PC, then create a file named:
index.html
Paste this:
<!doctype html><html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>My First Page</title> </head> <body> <h1>Hello, world!</h1> <p>This is my first web page.</p> </body></html>Open it
Section titled “Open it”Double-click index.html to open it in your browser.
Exercise
Section titled “Exercise”You will keep adding to this file throughout the next several lessons, so give it a real topic now.
- Change the
<h1>text fromHello, world!to a topic you actually know something about — a hobby, a place, a game, anything. - Change the
<p>text to one sentence introducing that topic. - Save the file and refresh your browser to confirm the changes appear.
Hold onto this file. The exercises in the next module all build on it.