Episode 52 of 53

CSS Website Build Part 2

Continue the website build — hero section, content cards, services section, and footer.

Continuing from Part 1, let's build the hero section, content areas, and footer.

Hero Section HTML

<section class="hero" id="home">
    <h1>Welcome to MyBrand</h1>
    <p>Building beautiful websites with pure CSS</p>
    <a href="#services" class="btn">Our Services</a>
</section>

Hero Section CSS

.hero {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    text-align: center;
    padding: 6rem 2rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    background: white;
    color: #764ba2;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

Service Cards

.services {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.services h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

Footer

footer {
    background: #1a1a2e;
    color: rgba(255,255,255,0.7);
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

footer a {
    color: #667eea;
    text-decoration: none;
}

footer a:hover { text-decoration: underline; }

We now have a fully styled website! The final part will add polish and finishing touches.