What you need to start building a web page
You can create a working web page with nothing but a text editor and a web browser — both of which you already have on your computer. A web page is built from three languages that work together: HTML (the structure and content), CSS (the styling and layout), and JavaScript (the interactive parts). You do not need to learn all three at once. Most people start with HTML and CSS, which is enough to build a page that looks good and works on phones and computers.
The process is straightforward: you write code in a text editor, save it as a file with the right extension, and then open that file in your browser to see what it looks like. When you make changes to the code and save the file, you refresh your browser and see the changes immediately. This cycle — write, save, refresh — is how web development works.
Key Takeaways
- HTML is the foundation of every web page and uses tags like <h1>, <p>, and <img> to structure content.
- CSS controls how your page looks — colors, fonts, spacing, and layout — and lives either in a separate file or at the top of your HTML file.
- You can start with a text editor like Notepad (Windows) or TextEdit (Mac) and save your file with a .html extension to make it readable by browsers.
- Every web page starts with the same basic HTML structure: a declaration, a head section, and a body section where your visible content goes.
- You test your page by opening the HTML file directly in your browser, and you can share it by uploading it to a web host or sending the file to someone else.
Setting up your text editor and creating your first file
Open Notepad (on Windows, search for "Notepad" in the Start menu) or TextEdit (on Mac, find it in Applications > Utilities). Do not use Microsoft Word or Google Docs — these add invisible formatting that breaks web pages. If you are on Mac using TextEdit, go to Format menu and click "Make Plain Text" before you start typing.
Type or paste this code into your editor:
<!DOCTYPE html> <html> <head> <title>My First Web Page</title> </head> <body> <h1>Welcome to My Web Page</h1> <p>This is my first web page.</p> </body> </html>
Now save this file. Go to File > Save As. Name it index.html (the name matters — index.html is the default page browsers look for). Make sure you save it as a plain text file, not as .txt. On Windows, change the "Save as type" dropdown to "All Files" and then type the full name including .html. On Mac, just type the full name with .html at the end. Save it somewhere you will remember, like your Desktop or Documents folder.
Opening your page in a browser and seeing it work
Open your web browser (Chrome, Firefox, Safari, or Edge — any of them work). Go to File > Open File (or press Ctrl+O on Windows, Command+O on Mac). Navigate to the index.html file you just saved and click Open. You should see a page with "Welcome to My Web Page" as a large heading and "This is my first web page." as regular text below it.
Congratulations — you have built a web page. What you are seeing is your browser reading the HTML code and turning it into something visible. The <h1> tag told the browser to make that text large and bold. The <p> tag told it to treat the other text as a paragraph. The <title> tag is why you see "My First Web Page" in the browser tab at the top.
Understanding HTML tags and adding content
HTML works by wrapping content in tags. A tag is a word inside angle brackets, like <p> or <h1>. Most tags come in pairs: an opening tag like <p> and a closing tag like </p>. The closing tag has a forward slash. Everything between the opening and closing tag is affected by that tag.
Here are the tags you will use most often: <h1> through <h6> for headings (h1 is largest, h6 is smallest), <p> for paragraphs, <strong> for bold text, <em> for italic text, <ul> for bullet lists, <ol> for numbered lists, and <li> for items inside those lists. To add a link, use <a href="url">link text</a>. To add an image, use <img src="filename.jpg" alt="description"> (this one does not need a closing tag).
Open your index.html file in your text editor again. Add more content between the <body> and </body> tags. For example, add a list of your hobbies, a link to another website, or a paragraph about yourself. Save the file, then go back to your browser and press F5 or Ctrl+R (or Command+R on Mac) to refresh. You will see your new content appear.
Adding style with CSS to change colors and layout
CSS is the language that controls how your page looks. You can add CSS directly inside your HTML file by putting it in the <head> section between <style> and </style> tags. Open your index.html file and add this code right after the <title> line and before </head>:
<style> body { background-color: lightblue; font-family: Arial, sans-serif; } h1 { color: darkblue; } </style>
Save the file and refresh your browser. The background should now be light blue, the heading should be dark blue, and the text should be in Arial font. CSS works by selecting an HTML element (like body or h1) and then setting properties (like background-color or color). You can change fonts, sizes, spacing, borders, shadows, and much more.
Common CSS properties include: color (text color), background-color (background color), font-size (how big the text is), margin (space outside an element), padding (space inside an element), and text-align (left, center, or right). Each property has a value — for colors you can use names like "red" or "lightblue", or you can use hex codes like "#FF5733".
Organizing your files and preparing to share your page
As your page grows, you will probably want to add images or create multiple pages. Create a folder on your Desktop or Documents called "my-website" and move your index.html file into it. If you want to add images, save them in the same folder. In your HTML, reference them by filename: <img src="photo.jpg" alt="my photo">.
To link to another page you create, save a new HTML file in the same folder (for example, about.html) and link to it with <a href="about.html">About Me</a>. The browser will find it because it is in the same folder.
Right now your page only works on your computer. To put it on the internet so other people can visit it, you need to upload it to a web host — a company that runs servers that stay on all the time. Services like Netlify, GitHub Pages, or Vercel let you upload your HTML files for free. They will give you a web address (a URL) that you can share. Most of these services let you drag and drop your files or connect to a folder on your computer, and they handle the rest.
Common mistakes to avoid when building your first page
The most common mistake is forgetting to close tags. Every opening tag needs a closing tag with a forward slash. If you write <p> you must write </p> later. Your browser will sometimes guess what you meant and still display something, but it can cause unexpected problems. Get in the habit of typing the closing tag right after the opening tag, then filling in the content between them.
Another mistake is saving your file with the wrong extension. It must end in .html, not .txt or .doc. If your file is named "mypage.txt", your browser will not read it as a web page. On Windows, make sure you change the file type dropdown to "All Files" when saving so the .html extension actually sticks.
A third mistake is using the wrong path for images or links. If you reference an image with <img src="photo.jpg">, the photo.jpg file must be in the same folder as your HTML file. If it is in a subfolder, you need to write <img src="images/photo.jpg">. If the path is wrong, the browser will not find the file and the image will not appear.
Frequently Asked Questions
Do I need to know how to code to build a web page?
No. HTML and CSS are not programming languages — they are markup and styling languages. You do not need to think like a programmer. You just need to learn a few tags and properties, and you can build a working page. Most people learn by looking at examples and trying things out.
Can I build a web page on my phone or tablet?
It is possible but difficult. You need a text editor that saves plain text files, and you need a way to open HTML files in a browser. On iPad, apps like Textastic or Koduo work. On Android, try Jota+ or DroidEdit. On a computer, it is much easier.
What is the difference between a web page and a website?
A web page is a single HTML file. A website is a collection of web pages linked together. You can start with one page and add more pages later by creating new HTML files in the same folder and linking them together with <a> tags.
Can I use a website builder instead of writing code?
Yes. Services like Wix, Squarespace, or WordPress let you build pages by dragging and dropping elements instead of writing code. They are easier to start with but give you less control over how things look and work. Learning HTML and CSS gives you more power and costs nothing.
How do I make my page look good on phones as well as computers?
Add this line to the <head> section of your HTML: <meta name="viewport" content="width=device-width, initial-scale=1">. This tells the browser to scale your page to fit the screen size. Then use CSS properties like max-width to control how wide your content gets, and test your page on a phone by opening it in your browser's mobile view (press F12 in Chrome or Firefox and click the phone icon).