What you need to start building a webpage
You need three things to create a webpage: a text editor to write the code, a web host to store your files online, and a domain name so people can find it. A text editor is just a program that saves plain text — Notepad on Windows or TextEdit on Mac work, though most people use something slightly better like Visual Studio Code (free) or Sublime Text. Your web host is a company that rents you space on their servers; common choices include Bluehost, GoDaddy, and Hostinger. Your domain name is the address people type in the browser, like yourname.com.
If you are just learning and do not want to pay yet, you can build and test a webpage on your computer first using only a text editor and a browser. Once you are ready to put it online where others can see it, you will need the host and domain. Many hosting companies sell domain names too, so you can handle both in one place.
Key Takeaways
- A webpage is built with HTML (the structure), CSS (the styling), and optionally JavaScript (the interactivity), all written as plain text in a text editor.
- You can write and test a webpage on your own computer using only a free text editor and your browser before paying for hosting.
- To put your webpage online, you need a web host (where your files live) and a domain name (the address people visit), which usually cost between $5 and $15 per month combined.
- The simplest first webpage uses only HTML, which is a series of tags that tell the browser what each part of the page is — a heading, a paragraph, a link, an image.
Writing your first webpage in HTML
Open your text editor and type this exactly:
<!DOCTYPE html> <html> <head> <title>My First Webpage</title> </head> <body> <h1>Welcome to my webpage</h1> <p>This is my first paragraph.</p> </body> </html>
Save this file with a name that ends in .html, like mypage.html. The <!DOCTYPE html> at the top tells the browser this is a webpage. Everything between <html> and </html> is your page. The <head> section holds information about the page (like the title that shows in the browser tab), and the <body> section holds what people actually see. The <h1> tag creates a large heading, and <p> creates a paragraph. Every opening tag like <p> needs a closing tag like </p>.
Now open your browser, go to File > Open, and select your mypage.html file. You should see your heading and paragraph displayed. That is your first webpage. Every webpage on the internet is built this same way — with HTML tags that structure the content.
Adding more content and structure to your page
Once you have the basic structure working, you can add more tags to build out your page. Use <h2>, <h3>, and so on for smaller headings. Use multiple <p> tags for multiple paragraphs. To add a link, use <a href="https://example.com">Click here</a> — the href attribute tells the browser where to go when someone clicks. To add an image, use <img src="myimage.jpg" alt="A description of the image">. The src tells the browser where the image file is, and the alt text describes it for people who cannot see the image.
You can also create lists. An unordered list (with bullet points) uses <ul> and <li> tags. An ordered list (numbered) uses <ol> instead of <ul>. Here is an example:
<ul> <li>First item</li> <li>Second item</li> </ul>
Every time you save your HTML file, you can refresh your browser to see the changes. This is how you build — write a tag, save, refresh, and see what it does.
Making your page look better with CSS
HTML structures your content, but CSS makes it look good. CSS is a separate language that controls colors, fonts, spacing, and layout. You can write CSS in the same file as your HTML by adding a <style> section in the <head>. Here is an example that makes your heading blue and your paragraphs larger:
<style> h1 { color: blue; } p { font-size: 18px; } </style>
Put this between <head> and </head>, before your </head> closing tag. The h1 selector targets all <h1> tags, and the p selector targets all <p> tags. Inside the curly braces, you write properties like color, font-size, background-color, and margin. Save and refresh your browser to see the changes.
As your page grows, you can move CSS into its own file to keep things organized, but for your first webpage, putting it in the <style> section works fine. CSS is what separates a plain-looking page from a professional one, so learning even a few properties will make a big difference.
Testing your webpage on your computer before going online
Before you pay for hosting, test everything on your computer. Open your HTML file in multiple browsers — Chrome, Firefox, Safari, Edge — to make sure it looks right in each one. Check that all your links work by clicking them. Make sure images display. Test on your phone too if you can, because many people browse on mobile devices.
A common mistake is forgetting to save your HTML file after making changes, then wondering why the browser still shows the old version. Always save first, then refresh the browser. Another mistake is breaking the tag structure — every opening tag needs a closing tag, and they need to be in the right order. If you see your page display strangely, check that all your tags are closed properly.
Once you are happy with how it looks, you are ready to move it online. This is when you sign up for hosting and a domain name.
Uploading your webpage to a web host
When you sign up with a web host, they give you a control panel (usually cPanel or something similar) where you can manage your files. Most hosts include a file manager tool that lets you upload files directly through your browser. You will also get FTP access, which is a way to transfer files from your computer to the host's server using an FTP client like FileZilla (free).
The most important file is usually called index.html — the host looks for this file first when someone visits your domain. So rename your mypage.html to index.html before uploading, or create a new index.html that links to your other pages. Upload your HTML file and any images or CSS files it uses to the public_html folder (or www folder, depending on your host). Once the files are uploaded, visit your domain name in a browser and your webpage should appear.
If your page does not show up, check that the file is named index.html and is in the right folder. If images do not display, make sure the image files are uploaded too and the src path in your HTML is correct. Most hosts have support documentation or a help chat if you get stuck.
Learning what comes next
Once you have a basic webpage working, you have choices about what to learn next. If you want to add more interactivity — like buttons that do things, forms that collect information, or animations — you will learn JavaScript. If you want to build pages faster and avoid repeating code, you might learn a framework like React or Vue. If you want to build a site with many pages and a database, you might learn a backend language like PHP or Python.
But none of that is necessary to start. A simple HTML and CSS webpage is a real webpage, and it teaches you the fundamentals that everything else builds on. Many people start exactly where you are now and gradually add skills as they need them.
Frequently Asked Questions
Can I create a webpage without knowing how to code?
Yes, there are website builders like Wix, Squarespace, and WordPress.com that let you drag and drop elements without writing code. They are easier to start with but less flexible once you want to customize things. Learning HTML and CSS gives you more control and costs less in the long run.
Do I have to use a text editor, or can I use Word?
Word will not work because it saves formatting information that breaks HTML. You need a plain-text editor. Notepad works, but Visual Studio Code (free) is better because it highlights your code and catches some mistakes for you.
What is the difference between a domain name and web hosting?
A domain name is the address (yourname.com), and hosting is the server where your files actually live. You need both. The domain points people to your host, and the host stores your files. Many companies sell both, so you can buy them together.
How much does it cost to put a webpage online?
A domain name usually costs $10 to $15 per year, and hosting usually costs $5 to $15 per month, though prices vary by provider and plan. Some hosts offer discounts for the first year. You can find cheaper options, but very cheap hosting often has slow performance or poor support.
What if I want to build a webpage for a business or sell things online?
A simple HTML webpage works for displaying information, but selling things requires a shopping cart, payment processing, and a database to track orders. WordPress with WooCommerce, Shopify, or a custom-built site using a backend language are better choices for that. Start with the basics first, then move to a platform designed for e-commerce when you are ready.