Skip to main content

Saizul Amin

How to Create a Website Using HTML and CSS: A Comprehensive Step-by-Step Guide

📅 30 Mar 2025 🔄 Updated 9 Oct 2026 ⏱ 3 min read
How to Create a Website Using HTML and CSS: A Comprehensive Step-by-Step Guide
In this article

     

    Introduction

    Creating a website from scratch is a valuable skill that can open doors to various opportunities, whether for personal projects, professional portfolios, business websites, or even blogging. Knowing how to create a website using HTML and CSS provides you with full control over design, layout, and functionality.

    But how exactly do you build a website using HTML and CSS? What tools and techniques are required? And how can you ensure your website is well-structured, responsive, and visually appealing? In this comprehensive guide, we’ll explore all the steps, from setting up your environment to building and styling your website.


    What Are HTML and CSS?

    HTML (Hypertext Markup Language)

    HTML is the standard language for creating webpages. It provides the structural foundation of a website, including text, images, links, forms, and other content.

    CSS (Cascading Style Sheets)

    CSS is a style sheet language used to describe the presentation of an HTML document. It allows you to control layout, colors, fonts, margins, and responsiveness.

    Why Use HTML and CSS Together?

    • Complete Control: Define the structure with HTML and style it beautifully with CSS.
    • SEO Optimization: Clean and semantic code helps search engines index your content effectively.
    • Responsive Design: CSS allows you to create websites that look great on all devices.
    • Cross-Browser Compatibility: HTML and CSS work well on all major browsers.

    Tools You Will Need

    Before diving into creating your website, make sure you have the following tools ready:

    1. Text Editor

    • Visual Studio Code (Recommended)
    • Sublime Text
    • Notepad++
    • Atom

    2. Web Browser

    • Google Chrome
    • Mozilla Firefox
    • Safari
    • Microsoft Edge

    3. Hosting Platform (For Live Sites)

    • GitHub Pages (Free)
    • Netlify (Free/Paid)
    • Hostinger, Bluehost (Paid)

    How to Create a Website Using HTML and CSS (Step-by-Step)

    1: Setting Up Your Project Folder

    • Create a new folder on your computer called “MyWebsite”.
    • This folder will contain all your files, including HTML, CSS, images, and scripts.

    2: Creating Your HTML File

    1. Open your preferred text editor.
    2. Create a new file and save it as “index.html”
    <!DOCTYPE html>
    <html>
    <head>
        <title>My First Website</title>
        <link rel="stylesheet" href="style.css">
    </head>
    <body>
        <header>
            <h1>Welcome to My Website</h1>
            <nav>
                <a href="#home">Home</a> |
                <a href="#about">About</a> |
                <a href="#contact">Contact</a>
            </nav>
        </header>
        <section id="home">
            <h2>Home</h2>
            <p>This is a simple website created using HTML and CSS.</p>
        </section>
        <section id="about">
            <h2>About</h2>
            <p>This section provides information about the purpose of the website.</p>
        </section>
        <section id="contact">
            <h2>Contact</h2>
            <p>Email: example@example.com</p>
        </section>
    </body>
    </html>
    

    3: Creating Your CSS File

    1. In the same folder, create a new file called “style.css”.
    body {
        font-family: Arial, sans-serif;
        margin: 0;
        padding: 0;
        background-color: #f0f0f0;
    }
    
    header {
        background-color: #333;
        color: white;
        padding: 10px;
        text-align: center;
    }
    
    nav a {
        color: white;
        text-decoration: none;
        margin: 0 10px;
    }
    
    section {
        margin: 20px;
        padding: 20px;
        background-color: white;
        border-radius: 5px;
    }
    
    h1, h2 {
        color: navy;
    }
    

    4: Viewing Your Website

    1. Open the index.html file in your web browser.
    2. You should see a well-styled webpage with a header, navigation links, and different sections.

    5: Adding More Pages

    Create additional HTML files (e.g., about.html, contact.html) and link them using <a> tags.


    6: Making Your Website Responsive

    Add the following to your style.css file:

    @media (max-width: 768px) {
        body {
            padding: 10px;
        }
        header {
            padding: 5px;
        }
        section {
            padding: 10px;
        }
    }
    

    Best Practices for Creating a Website Using HTML and CSS

    • Use Semantic HTML Tags: <header>, <section>, <article>, etc.
    • Organise Your Code: Maintain a clean and structured folder system.
    • Add Comments: Use comments to explain your code for future reference.
    • Implement Responsive Design: Use media queries for mobile compatibility.
    • Test Across Browsers: Ensure compatibility on Chrome, Firefox, Safari, and Edge.

    Conclusion

    Learning how to create a website using HTML and CSS is the perfect foundation for building beautiful, responsive, and functional websites. Whether you’re a beginner or an experienced developer, the combination of HTML for structure and CSS for styling offers limitless possibilities.

    Start coding today and take your web development skills to the next level!

    Share this article
    Md Saizul Amin
    Written by

    Digital Systems Strategist · AI Agent Developer · 9+ years in digital & IT

    Md Saizul Amin is a digital systems strategist and AI automation engineer from Dhaka, Bangladesh. With 9+ years across IT, web development and digital marketing, he writes practical guides on technology, business, education and online growth — and builds the same kinds of systems (AI agents, websites, SEO and ad campaigns) for clients in Bangladesh, the UK and the USA.

    9+Years in digital & IT
    50+Websites developed
    7Live AI agent systems
    $150K+Ad spend managed

    Specialist in

    AI agents & n8n automationLLM integration (Gemini, GPT-4o, Claude)Custom software & web appsWordPress developmentSEO · AEO · GEOMeta & Google AdsEmail deliverabilityCRM & funnelsIT infrastructure & cybersecurity

    Credentials & experience

    • 🎓
      B.Sc. in Computer Science & EngineeringBangladesh University of Business & Technology (BUBT), 2017–2021
    • 🤖
      AI Automation Engineer · Web Developer · SEO SpecialistUnique Mark Limited, Birmingham UK — 2024 to present
    • 🌱
      IT SpecialistGreen Fund Initiative Inc., USA — 2024 to present
    • 🏥
      Junior IT Consultant — Ministry of Health (DGHS)Built the first national Shareable Health Record website; supported 6,000+ facilities
    • 🧭
      Head of ITWEDO Bangladesh — led IT for 50+ staff, 2021–2023

    ✔ Researched and written by the author, informed by hands-on work on real projects. Articles are updated when facts, tools or guidelines change.

    Want results like this for your business?

    AI agents, custom software, websites and growth systems — let’s talk about yours.