HTML & CSS: The Real Foundation of the Web

If you're just getting started with coding, there's no better place to begin than HTML and CSS. They are the core building blocks of the web—every website you visit is powered by them.

In this guide, I’ll break down the basics of HTML and CSS in a way that's beginner-friendly, practical, and clear—because at Coding Book, we believe in Bytes of Code, Loads of Clarity.


🧱 What is HTML?

HTML stands for HyperText Markup Language. It's the language used to structure content on the web. Think of it as the skeleton of a webpage.

🧩 A Basic HTML Example:

<!DOCTYPE html>
<html>
  <head>
    <title>My First Page</title>
  </head>
  <body>
    <h1>Hello World!</h1>
    <p>This is my first webpage.</p>
  </body>
</html>
  • <!DOCTYPE html> tells the browser you're using HTML5.

  • <html> is the root element.

  • <head> includes the page title and metadata.

  • <body> contains all the content visible on the page.

🎨 What is CSS?

CSS stands for Cascading Style Sheets. It adds style to your HTML—it’s what makes your webpage look beautiful.

🎨 A Basic CSS Example:

<style>
  body {
    background-color: #f0f0f0;
    font-family: sans-serif;
  }

  h1 {
    color: #2c3e50;
  }

  p {
    color: #555;
  }
</style>

You can include this inside your <head> or in a separate .css file.

🛠️ Try This: Build a Simple Web Page

Here’s a mini project for you. Create a file called index.html and paste this:

<!DOCTYPE html>
<html>
  <head>
    <title>My Profile</title>
    <style>
      body {
        background: #fefefe;
        font-family: Arial;
        padding: 20px;
      }
      h1 {
        color: #0077cc;
      }
      p {
        font-size: 16px;
      }
    </style>
  </head>
  <body>
    <h1>Hi, I'm a Developer!</h1>
    <p>This is my first web page made with HTML and CSS.</p>
  </body>
</html>

Then open it in your browser—boom! You’ve just created your first web page. 🎉

💡 Final Tips for Beginners

  • Use https://codepen.io or https://jsfiddle.net to test your code online.

  • Learn the structure first—don’t rush into frameworks.

  • Practice by recreating small parts of existing websites.

  • Build a portfolio with your practice pages.

Thanks for reading! If this helped you, consider following Coding Book for more beginner-friendly tutorials.

Got questions? Drop them in the comments below—I’d love to help you out. 🚀

📬 Stay tuned for my next post:

“What Happens When You Type a URL in Your Browser?” — coming soon!

0
Subscribe to my newsletter

Read articles from Bhagirath Rajpurohit directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Bhagirath Rajpurohit
Bhagirath Rajpurohit