Planning Your First Website

A personal portfolio is a good first website: one page, four sections (introduction, about, projects and contact) and content you already know. Spend ten minutes before coding to write the actual text for each section and pick two or three colors. Writing the content first keeps the layout decisions simple, because you know how much space each part needs.

You need two files, index.html and style.css, in the same folder. Create them in the file tree of the HCODX editor to get a live preview, or in any code editor and open index.html in your browser.

Choosing Your Website Type

For your first website, start simple. Good beginner projects include:

  • Personal Portfolio - Showcase your work and skills
  • Landing Page - Single page promoting a product or service
  • Simple Blog - Share your thoughts and articles
  • Business Card Site - Digital version of your business card

Step-by-Step: Building a Portfolio Website

Step 1: Create the HTML Structure

Start with a basic layout. Every website needs these sections:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>John Doe - Web Developer</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <header>
        <nav>
            <ul>
                <li><a href="#home">Home</a></li>
                <li><a href="#about">About</a></li>
                <li><a href="#projects">Projects</a></li>
                <li><a href="#contact">Contact</a></li>
            </ul>
        </nav>
    </header>
    
    <main>
        <section id="home">
            <h1>Hi, I'm John Doe</h1>
            <p>A passionate web developer</p>
        </section>
        
        <section id="about">
            <h2>About Me</h2>
            <p>Your bio goes here...</p>
        </section>

        <section id="projects">
            <h2>Projects</h2>
            <!-- Project cards go here (see "Projects Section" below) -->
        </section>

        <section id="contact">
            <h2>Contact</h2>
            <p>Email me at <a href="mailto:[email protected]">[email protected]</a>.</p>
        </section>
    </main>
    
    <footer>
        <p>© 2026 John Doe</p>
    </footer>
</body>
</html>

Step 2: Add CSS Styling

Create a new file called "style.css" and add styling:

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
}

header {
    background: #333;
    color: white;
    padding: 1rem;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav a {
    color: white;
    text-decoration: none;
}

main {
    padding: 2rem;
}

section {
    margin-bottom: 3rem;
}

Adding Content to Your Website

Hero Section

The hero section is the first thing visitors see. Make it impactful:

<section class="hero">
    <h1>Welcome to My Portfolio</h1>
    <p>I create beautiful, functional websites</p>
    <a href="#projects" class="cta-button">View My Work</a>
</section>

About Section

Tell visitors who you are and what you do:

  • Brief introduction (2-3 sentences)
  • Your skills and expertise
  • What makes you unique
  • Call to action (contact link)

Projects Section

Showcase your work with project cards:

<section id="projects">
    <h2>My Projects</h2>
    <div class="project-grid">
        <article class="project-card">
            <img src="project1.jpg" alt="Project 1">
            <h3>E-commerce Website</h3>
            <p>Built with HTML, CSS, and JavaScript</p>
            <a href="#">View Project</a>
        </article>
    </div>
</section>

๐Ÿ’ก Design Tip

Use a consistent color scheme throughout your site. Pick 2-3 main colors and stick with them. This creates a professional, cohesive look.

Making Your Website Responsive

Ensure your site looks good on all devices:

@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
    }
    
    .project-grid {
        grid-template-columns: 1fr;
    }
}

Testing Your Website

Before publishing, test thoroughly:

  • Check on different screen sizes (desktop, tablet, mobile)
  • Test all links to ensure they work
  • Verify images load correctly
  • Check spelling and grammar
  • Test loading speed

Publishing Your Website

Before publishing, paste index.html into the HTML validator to catch unclosed tags, missing alt text and links to sections that do not exist. Then export the project (in the HCODX editor, choose Export to download a ZIP) and upload the files to a host. The export and deploy guide covers each step. Free options for a static site include:

  • GitHub Pages - Free hosting for static sites
  • Netlify - Drag your folder onto the deploy page, or connect a Git repository
  • Vercel - Fast deployment with global CDN
  • Traditional Hosting - Upload via FTP to your host

Maintaining Your Website

A website is never truly "finished". Keep it fresh by:

  • Adding new projects regularly
  • Updating your skills section
  • Refreshing your bio
  • Fixing broken links
  • Responding to feedback

SEO Considerations for Your First Website

Even your first website should follow basic SEO practices to be discoverable by search engines:

  • Page Titles - Use descriptive, unique titles for each page
  • Meta Descriptions - Write compelling 150-160 character descriptions
  • Heading Structure - Use H1 for main title, H2 for sections, H3 for subsections
  • Alt Text - Describe images for accessibility and SEO
  • Mobile-Friendly - Ensure your site works on all devices

Common First-Time Website Mistakes to Avoid

Learn from these common pitfalls that many beginners encounter:

  • Too Much Text - Break up content with headings, lists, and images
  • Poor Color Contrast - Ensure text is readable against backgrounds
  • Missing Contact Info - Make it easy for visitors to reach you
  • Slow Loading - Optimize images and minimize code
  • No Call to Action - Tell visitors what you want them to do

Start Building Your Website Today

Create index.html and style.css in the HCODX editor, paste the skeleton from this guide and fill in your own content.

Open the HCODX editor โ†’