KinaQuest
Programming

Build Your First Web Page in 30 Minutes

HTML and CSS from zero — no tools to install.

Making a web page is easier than it looks. In about half an hour you can have a real page open in your browser, with nothing to install. You will need a plain text editor (Notepad on Windows or TextEdit in plain text mode on Mac, or a free editor such as Visual Studio Code) and any web browser.

Step 1: create the file

Create a new folder called my-page. Inside it, create a file named index.html and paste in this starter:

<!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>
  <link rel="stylesheet" href="../style.css">
</head>
<body>
  <h1>Hello, world</h1>
  <p>This is my first web page.</p>
</body>
</html>

Double-click the file to open it in your browser. You have a web page.

Step 2: add content

Add a few more elements inside the body:

<h2>About me</h2>
<p>I am learning to build websites.</p>
<ul>
  <li>HTML for structure</li>
  <li>CSS for style</li>
</ul>
<a href="https://developer.mozilla.org/">Visit MDN Web Docs</a>

Step 3: add style

Create a second file in the same folder called style.css:

body {
  font-family: system-ui, sans-serif;
  max-width: 40rem;
  margin: 2rem auto;
  padding: 0 1rem;
  line-height: 1.6;
  color: #222;
}

h1 {
  color: #4a2cf2;
}

a {
  color: #4a2cf2;
}

Save both files and refresh the browser. The page should now look cleaner.

Step 4: experiment

  • Change the colours and fonts.
  • Add an image with <img src="../photo.jpg" alt="Describe the image">.
  • Add a second page and link to it.

Always write helpful alt text for images. It helps people using screen readers and also helps search engines.

Step 5: share it

Free hosting such as GitHub Pages lets you put your page online. Upload your files to a repository and turn on Pages in the settings.

Next steps

Once you are comfortable here, try adding a little interactivity with JavaScript, or automate other tasks with Python.

Keep reading

Related articles