CodeNewbie Community 🌱

Cover image for How I Built My First Website Using HTML, CSS, and JavaScript
Joseph Jossy
Joseph Jossy

Posted on

How I Built My First Website Using HTML, CSS, and JavaScript

When I first decided to learn web development, I had no idea where to start.
All I knew was that I wanted to build something, something I could actually open in my browser and say, “I made that.”

If you're a beginner, stick to the end, I have something amazing for you.

This is the story of how I built my very first website using HTML, CSS, and JavaScript from confusion, frustration, and late-night Googling to the moment it finally worked.

Step 1: Starting With the Basics (HTML)

I started with HTML, the foundation of every website.
At first, it felt strange typing out tags like <div>, <p>, and <h1> but once I understood that HTML was basically the skeleton of a webpage, it all started to make sense.

Here’s what my first HTML file looked like:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>My First Website</title>
  </head>
  <body>
    <h1>Welcome to My Website!</h1>
    <p>This is my first real web page built from scratch.</p>
    <button>Click Me</button>
  </body>
</html>

Enter fullscreen mode Exit fullscreen mode

It wasn’t much, but when I opened it in my browser and saw those words appear, I felt like a hacker 😅

Step 2: Making It Look Good With CSS

Next, I moved on to CSS the part that makes everything beautiful (or at least that’s what I hoped).

At first, CSS was tricky. I’d write some styles, refresh the page, and… nothing would change.
Then I learned the golden rule: link your CSS file properly!

<link rel="stylesheet" href="style.css" />
Enter fullscreen mode Exit fullscreen mode

Once that was fixed, I started experimenting:

body {
  background-color: #f9f9f9;
  font-family: "Poppins", sans-serif;
  text-align: center;
  margin-top: 100px;
}

h1 {
  color: #e63946;
}

button {
  background-color: #457b9d;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

button:hover {
  background-color: #1d3557;
}
Enter fullscreen mode Exit fullscreen mode

Suddenly my plain text turned into something presentable.
The page had color, spacing, and even a button that changed color when I hovered over it.
I must have refreshed that page 20 times just to admire it.

Step 3: Adding Life With JavaScript

Now came the fun part making it interactive.
I created a new file called script.js and connected it to my HTML:

<script src="script.js"></script>

Enter fullscreen mode Exit fullscreen mode

Then I wrote my very first JavaScript function:

const button = document.querySelector("button");

button.addEventListener("click", function () {
  alert("You clicked the button! 🎉");
});

Enter fullscreen mode Exit fullscreen mode

When I clicked that button and saw the alert pop up on the screen…
It felt magical.
That was the exact moment I realized: this is what I want to do.

Step 4: Putting Everything Together

After a few days of tweaking, here’s what my little website became:

  • A simple homepage with a title, paragraph, and button

  • Some color and clean design using CSS

  • A small interactive feature using JavaScript

It wasn’t fancy. It didn’t have animations or APIs.
But it was mine. It worked.

And that gave me more motivation than any tutorial could.

Step 5: Lessons I Learned

Building my first website taught me a few key things:

  • Start small. Don’t try to build a full app when you’re still learning what means.

  • Practice daily. Even 30 minutes a day adds up.

  • Don’t be afraid to break things. You’ll learn faster by fixing your own mistakes.

  • Use Google like a pro. Every developer does even experienced ones.

Most importantly, I learned that progress > perfection.

What I Did Next

After that first project, I started experimenting more:

  • Adding navigation links and multiple pages

  • Learning how to use Flexbox and Grid

  • Trying out simple JavaScript projects like a calculator or to-do list

Every small project built my confidence and helped me move closer to becoming a real front-end developer.

Conclusion

If you’re just starting out and feeling lost, remember this: every great developer started with a blank page.
Your first website doesn’t have to be perfect it just has to exist.

Open your editor, write your first line of HTML, and watch it come alive.
That’s how it starts. That’s how it started for me.

If you're a beginner, I will advice you to join learnwithjossy code academy. they will teach you all you need to become a pro web developer. You can also get this amazing e-book that helped me alot when learning html, Click here to get it

Top comments (0)