Menu
×
   ❮   
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP C C++ C# AWS W3.CSS HOW TO BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR ANGULARJS GIT POSTGRESQL MONGODB ASP AI R GO KOTLIN SWIFT SASS VUE GEN AI SCIPY CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING HTML & CSS BASH RUST TOOLS MATH

Projects

Projects Home Personal Page Profile Card Collection JavaScript Toolkit Portfolio Recipe Page CSS Landing Page JavaScript Data Toolkit Interactive Todo List Mobile Calculator Weather Dashboard Browser Puzzle Game E-commerce Frontend Analytics Dashboard

Share

HTML Project: Gradient, Grid and Phones

Complete each step in the editor and watch the result as your page takes shape.

Build Gradient, Grid and Phones, step-by-step

The finale: a gradient over the photo, a bento grid, soft shadows, and a phone layout.

Medium · +140 XP · HTML CSS

What you will use in this project

  • Gradients
  • CSS grid
  • Shadows and transitions
  • Media queries

How it works

  1. 1 Follow the steps on the left. Each dot in the stepper bar is one focused chunk of work. Read the instructions, the “What to do” checklist, and any hints.
  2. 2 Write your code on the right. The editor is yours. Files auto-save as you type. Use the Preview tab to see your work in action.
  3. 3 Click Check code when you’re ready. We grade your work against the step’s rubric and tell you exactly what passed and what still needs work.
  4. 4 Pass a step to move on. Build the project cumulatively. Pass every step to complete it and earn the full XP.

How it’s graded

This project is broken into 4 steps. Each one has its own pass criterion. Click Check code on every step to verify your progress and earn the full +140 XP.

# Step & pass criterion Weight
1 Add a gradient over the photo
  • In the #hero { rule, change background-image to a linear-gradient(), a comma, then your photo url(), copied exactly.
  • Make the gradient go to top, from rgba(15, 23, 42, 0.75) to rgba(15, 23, 42, 0) 65%.
  • In the same rule, change padding: 56px 48px 120px to padding: 240px 48px 48px.
27 pts
2 Build a bento grid
  • Give main display: grid, grid-template-columns: repeat(3, 1fr), grid-auto-flow: dense, gap: 16px, padding: 0 16px. Set margin: 0 in .section and .card. Delete the .card width.
  • At the end, give .cards the same display, columns, gap; #story, #itinerary grid-column: span 2; #places, #subscribe grid-column: 1 / -1; #packing order: 1.
  • Give #quote padding-top: 112px, #quote::before font-size: 160px, top: -16px, right: 24px.
25 pts
3 Add soft shadows and motion
  • In the .card { rule, delete the border line. Add box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 16px 32px -16px rgba(15, 23, 42, 0.25) and transition: transform 0.3s.
  • After the } of that rule, write .card:hover with transform: translateY(-6px).
  • In the .navbar { rule, add box-shadow: 0 8px 24px -12px rgba(15, 23, 42, 0.3).
24 pts
4 Make it work on phones
  • At the end of style.css, write @media (max-width: 600px) {. The next rules go inside it.
  • Give main, .cards grid-template-columns: 1fr, and #story, #itinerary, #places, #subscribe grid-column: auto, and #packing order: 0.
  • Give #hero padding: 160px 24px 32px, #hero h1 font-size: 44px and .section padding: 28px 20px.
24 pts
index.html
Gradient, Grid and Phones preview
← Browse all projects


Free account

Track your progress

XP earned 0 Day streak 0 Spaces 0 League —

New

Learn in Adventure Mode W3Schools Adventure App

Coding fundamentals as bite-sized lessons and challenges.

×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookies and privacy policy.

Copyright 1999-2026 by W3Schools. All Rights Reserved. W3Schools is Powered by W3.CSS.