Table of contents
1.
Introduction
2.
Preview Image
3.
What is a Portfolio?
4.
Why Create a Portfolio?
5.
Who is a Portfolio For?
6.
Approach to Building a Portfolio
6.1.
Step 1: Creating the HTML Structure
6.2.
Step 2: Adding CSS for Styling
6.3.
Step 3: Running the Code
7.
What are the most important sections in a portfolio  
7.1.
1. Homepage or Introduction Section  
7.2.
2. About Me Section  
7.3.
3. Projects Section  
7.4.
4. Contact Section  
8.
Frequently Asked Questions
8.1.
Do I need to know JavaScript to build a portfolio?
8.2.
How can I publish my portfolio online?
8.3.
Can I add images and animations to my portfolio?
9.
Conclusion
Last Updated: Mar 3, 2025
Medium

How to create a portfolio Using HTML and CSS

Author Rahul Singh
0 upvote
Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

A portfolio website is a great way to showcase your skills, projects, and achievements. Using  HTML and CSS, you can create a visually appealing and well-structured portfolio. HTML provides the structure, while CSS enhances the design and layout. A portfolio typically includes sections like an introduction, projects, contact details, and social links. 

In this article, you will learn how to create a portfolio using HTML and CSS step by step.

Preview Image

Before we begin, here is an example of the final portfolio design:

(Add a preview image of the portfolio website here)

This will help you visualize what we will build.

What is a Portfolio?

A portfolio is a personal website where you display your skills, projects, and work experience. It acts as an online resume that helps recruiters or clients understand your abilities.

A good portfolio includes:

  • Your introduction (name, profession, and a brief bio)
     
  • A list of projects with descriptions
     
  • Skills and technologies you are familiar with
     
  • Contact information

Why Create a Portfolio?

Creating a portfolio has many advantages:

  1. Showcases your skills: A portfolio helps employers see what you can do.
     
  2. Builds an online presence: It acts as a digital resume that can be shared easily.
     
  3. Improves chances of getting hired: Recruiters prefer candidates with a portfolio.
     
  4. Demonstrates practical knowledge: Instead of just listing skills, you can show real projects.

Who is a Portfolio For?

A portfolio is useful for:

  • Students: To display academic projects and personal work.
     
  • Job seekers: To stand out during job applications.
     
  • Freelancers: To attract potential clients.
     
  • Developers: To maintain an updated list of projects.

Approach to Building a Portfolio

We will build a simple portfolio with the following sections:

  1. Header: Contains your name and a navigation menu.
     
  2. About Me: A short bio about yourself.
     
  3. Projects: Showcases your past work with descriptions and links.
     
  4. Skills: Lists the technologies you know.
     
  5. Contact: Provides ways for people to reach you.

Step 1: Creating the HTML Structure

First, we create the basic structure using HTML.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>My Portfolio</title>
    <link rel="stylesheet" href="styles.css">
</head>
<body>
    <header>
        <h1>My Portfolio</h1>
        <nav>
            <ul>
                <li><a href="#about">About</a></li>
                <li><a href="#projects">Projects</a></li>
                <li><a href="#skills">Skills</a></li>
                <li><a href="#contact">Contact</a></li>
            </ul>
        </nav>
    </header>

    <section id="about">
        <h2>About Me</h2>
        <p>Hello! I'm a web developer passionate about building user-friendly websites.</p>
    </section>

    <section id="projects">
        <h2>Projects</h2>
        <p>Here are some of my projects:</p>
        <ul>
            <li>Project 1: Portfolio Website</li>
            <li>Project 2: To-Do List App</li>
        </ul>
    </section>

    <section id="skills">
        <h2>Skills</h2>
        <p>HTML, CSS, JavaScript, React</p>
    </section>

    <section id="contact">
        <h2>Contact</h2>
        <p>Email: example@email.com</p>
    </section>
</body>
</html>

 

Output

Output

Step 2: Adding CSS for Styling

Now, let's style our portfolio using CSS.

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    text-align: center;
}

header {
    background-color: #333;
    color: white;
    padding: 20px;
}

nav ul {
    list-style: none;
    padding: 0;
}

nav ul li {
    display: inline;
    margin: 0 15px;
}

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

section {
    margin: 50px;
}

Output

Output

Step 3: Running the Code

Save the HTML code as index.html and the CSS code as styles.css. Then open index.html in your browser to see your portfolio in action!

What are the most important sections in a portfolio  

When creating a portfolio, it’s important to include sections that highlight your skills & accomplishments effectively. These sections ensure your portfolio is both professional & engaging. Let’s discuss what this section should consists of:  

1. Homepage or Introduction Section  

This is the first thing visitors see when they land on your portfolio. It should include your name, a catchy tagline, & a brief description of who you are. For example, you can mention that you’re a coding student specializing in web development or app design.  

Let’s see how you can create this section usingHTML and CSS:  

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Portfolio</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: f4f4f4;
        }
        .intro-section {
            text-align: center;
            padding: 100px 20px;
            background-color: 007BFF;
            color: white;
        }
        .intro-section h1 {
            font-size: 36px;
            margin-bottom: 10px;
        }
        .intro-section p {
            font-size: 18px;
        }
    </style>
</head>
<body>
    <section class="intro-section">
        <h1>John Doe</h1>
        <p>Aspiring Web Developer | Coding Enthusiast</p>
    </section>
</body>
</html>

 

Explanation:  

  • The `intro-section` uses CSS to center-align the content & add a visually appealing background color.  
     
  • The `<h1>` tag displays your name, while the `<p>` tag provides a short description.  

2. About Me Section  

This section gives visitors a deeper understanding of who you are, your goals, & your journey as a coding student. You can talk about your interests, the technologies you’re learning, & why you chose this field.  

For example:  

<section class="about-section">
    <div class="container">
        <h2>About Me</h2>
        <p>I am a college student passionate about coding & web development. I enjoy building projects that solve real-world problems & constantly strive to improve my skills in HTML, CSS, JavaScript, & more.</p>
    </div>
</section>

<style>
    .about-section {
        padding: 50px 20px;
        background-color: ffffff;
        text-align: center;
    }
    .about-section h2 {
        font-size: 28px;
        margin-bottom: 20px;
    }
    .about-section p {
        font-size: 16px;
        line-height: 1.6;
    }
</style>

 

Explanation:  

  • The `about-section` includes a heading (`<h2>`) & a paragraph (`<p>`) to describe yourself.  
     
  • The CSS ensures the section looks clean with proper spacing & alignment.  

3. Projects Section  

This is where you showcase your best work. Include screenshots, descriptions, & links to your projects. Each project should have its own card or block for better organization.  

Let’s see how to create a simple project layout:  

<section class="projects-section">
    <div class="container">
        <h2>My Projects</h2>
        <div class="project-grid">
            <div class="project-card">
                <h3>Project 1</h3>
                <p>A responsive website built using HTML & CSS. It demonstrates my ability to create user-friendly interfaces.</p>
                <a href="https://example.com" target="_blank">View Project</a>
            </div>
            <div class="project-card">
                <h3>Project 2</h3>
                <p>A JavaScript-based calculator app. This project highlights my problem-solving skills.</p>
                <a href="https://example.com" target="_blank">View Project</a>
            </div>
        </div>
    </div>
</section>

<style>
    .projects-section {
        padding: 50px 20px;
        background-color: f9f9f9;
        text-align: center;
    }
    .project-grid {
        display: flex;
        justify-content: center;
        gap: 20px;
        margin-top: 20px;
    }
    .project-card {
        background-color: ffffff;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        width: 300px;
    }
    .project-card h3 {
        font-size: 22px;
        margin-bottom: 10px;
    }
    .project-card p {
        font-size: 14px;
        line-height: 1.5;
    }
    .project-card a {
        display: inline-block;
        margin-top: 10px;
        color: 007BFF;
        text-decoration: none;
    }
</style>

 

Explanation:  

  • The `project-grid` uses Flexbox to arrange project cards side by side.  
     
  • Each `project-card` contains a title, description, & a link to view the project.  

4. Contact Section  

A contact section allows visitors to reach out to you. Include your email, social media links, or a contact form.  

For example:  

<section class="contact-section">
    <div class="container">
        <h2>Contact Me</h2>
        <p>Email: johndoe@example.com</p>
        <p>LinkedIn: <a href="https://linkedin.com/in/johndoe" target="_blank">linkedin.com/in/johndoe</a></p>
    </div>
</section>

<style>
    .contact-section {
        padding: 50px 20px;
        background-color: 007BFF;
        color: white;
        text-align: center;
    }
    .contact-section h2 {
        font-size: 28px;
        margin-bottom: 20px;
    }
    .contact-section p {
        font-size: 16px;
        margin-bottom: 10px;
    }
    .contact-section a {
        color: white;
        text-decoration: underline;
    }
</style>

 

Explanation:  

  • The `contact-section` provides essential contact details with links to your social profiles.  
  • The CSS ensures the section stands out with a contrasting background color.  

Frequently Asked Questions

Do I need to know JavaScript to build a portfolio?

No, you can create a basic portfolio using just HTML and CSS. JavaScript can be added later for interactivity.

How can I publish my portfolio online?

You can use GitHub Pages, Netlify, or Vercel to host your portfolio for free.

Can I add images and animations to my portfolio?

Yes! You can use CSS animations and add images to make your portfolio more attractive.

Conclusion

In this article, we learned how to create a portfolio using HTML and CSS. We covered the structure, styling, and functionality needed to build a simple yet effective portfolio. We can also personalize it by adding more sections, animations, or JavaScript features. 

Live masterclass