
Every website you visit, from a one-page portfolio to a huge online shop, is delivered to your browser as the same three ingredients: HTML for structure, CSS for appearance and JavaScript for behaviour. Building your first site from scratch means writing those files yourself instead of dragging blocks around in a site builder. It takes longer the first time, but you end up understanding what every line does, and that knowledge carries over to every tool and framework you will meet later.
The toolkit is small and free:
You do not need a server, a database or a paid account to begin. A website is just files, and your browser can open them straight from your computer.
Beginners often open the editor and start typing, then get lost. Spend ten minutes deciding what the site is for and who will read it. A personal page, a page for a club or a simple portfolio are ideal first projects because they have clear content and no complicated logic.
Sketch the layout: a header with the site name, a short introduction, two or three content sections and a footer with contact details. Write the real text you will use. Designing around actual words is much easier than designing around empty boxes, and it shows you early whether the page says something worth saying.
Create a file called index.html. The name matters: web servers show index.html automatically when someone visits a folder, so it becomes your home page. Every HTML document starts with the same skeleton: a doctype declaration, an html element, a head section with information about the page (its title, the character encoding and the viewport setting for phones) and a body section with everything visitors see.
Inside the body, use elements that describe meaning rather than looks. This is called semantic HTML:
Semantic elements are not just tidy. Screen readers use them to let blind users jump between regions, and search engines use them to understand what the page is about. Always give images an alt attribute describing what they show, for the same reason.
Save the file and open it in your browser by double-clicking it. You will see plain black text on a white background. That is normal: the structure comes first, the styling second.
Create a second file, style.css, and connect it to the page with a link element in the head. Keeping styles in a separate file means you can change the look of every page at once.
A CSS rule has a selector (which elements it targets) and declarations (what to change). Start with a few basics that make any page look better immediately:
Understanding the box model early will save you hours. Every element is a rectangle made of content, padding (space inside the border), the border itself and margin (space outside it). When something sits in the wrong place, open the browser's developer tools, hover over the element and look at its box. The cause is usually visible at a glance.
For arranging items side by side, learn Flexbox for rows and columns and CSS Grid for two-dimensional layouts. Both are supported by every modern browser and have replaced the old tricks with floats and tables.
More than half of web traffic worldwide comes from mobile devices, so your site must work on small screens. Two things matter most. First, include the viewport meta tag in the head; without it, phones pretend to be desktop screens and shrink the page. Second, use media queries, CSS rules that apply only above or below a certain screen width. A common approach is to design for the narrow screen first, with everything in one column, and then add a media query that places sections side by side on wider screens.
Test by narrowing your browser window or by switching on the device toolbar in the developer tools, which simulates many phone sizes.
Your site does not need JavaScript to be a real website, but a small script is a good way to learn how pages react to users. Create script.js and load it at the end of the body or with the defer attribute so it runs after the page is built. A classic first task is a button that toggles a dark theme or shows and hides a menu on phones. You will learn three core ideas: selecting an element, listening for an event such as a click, and changing a class or text in response.
Keep the site usable without the script. If the JavaScript fails to load, visitors should still be able to read everything.
Before publishing, run through a short checklist:
A static site made of HTML, CSS and JavaScript files can be hosted for free. GitHub Pages, Netlify, Cloudflare Pages and Vercel all let you upload your folder or connect it to a code repository and give you a public address within minutes. Each push of new code updates the live site automatically, which is a good reason to learn Git alongside HTML.
The free address will be a subdomain of the host. When you want your own name, buy a domain from a registrar, usually for a modest yearly fee, and point it to your host by changing its DNS records. All of these hosts provide HTTPS certificates automatically, so your site will show the padlock in the address bar.
Once the first site is live, improve it in small steps rather than starting over. Add a second page and a navigation menu, replace a list with a grid of cards, write a contact form and connect it to a free form service, or rebuild a section you like from another website to see how it is done. Reading the source of real pages with the developer tools is one of the fastest ways to learn. When plain HTML and CSS feel comfortable, that is the moment to look at JavaScript in depth, and later at frameworks. They will make far more sense because you will know what they generate underneath.
Grade 10 Math: Functions and Reasoning - Quiz
1170 questions