Student Walkthrough: build the AMP homepage design
Build top to bottom. Your answers and checkmarks save automatically in this browser.
Saved
The Goal
You are building the design of the AMP homepage. Open the finished example in another tab and keep it there while you work.
The live example also has a “Now booking” band at the top of its footer. This sheet leaves it out so you can focus on the three rows.
Look past the photos and you will see three rows. Each row is split into columns:
Row 1
w50logo
w50 navbar panel
Row 2
w25panel photo photo1
w50panel p40 center welcome
w25panel photo photo2
Row 3
w25Explore + footernav
w50 centerlogo + tagline
w25 rightSessions
Every box is built from small classes stacked together, like w25 panel photo photo1. One class sets the width, one gives the glass panel look, one adds the photo. That is the idea behind this whole sheet.
Where everything goes
File
Holds
includes/vars.inc
Your path variables. You already have it: nothing to change.
includes/header.inc
The head, the stylesheet link, and all of Row 1. It includes topnav.inc.
includes/topnav.inc
The navigation links. header.inc includes it.
index.html
The include lines and Row 2
includes/footer.inc
Row 3 and the closing tags
includes/footernav.inc
The footer link list. footer.inc includes it.
css/style.css
Every rule in this walkthrough
Part A: The Whole Page
Start with the rules that touch every page: the font, the text color, and the photo behind everything.
Clear out your stylesheet. Open css/style.css. Save a copy of the old one if you want it, then start with an empty file.
Padding and borders fit inside a box’s width. Without it, a 25% column plus 40px of padding is wider than 25%.
background-image
Two layers, separated by a comma. The first is a see-through dark gradient. The second is the photo underneath it. The gradient darkens the photo so the text stays readable.
background-size: cover
Stretch the photo to fill the page without squishing it.
background-attachment: fixed
The photo stays still while the page scrolls over it.
font-family
Lato for body text, Cormorant Garamond for the big heading. The fonts load from Google in header.inc (Part C).
Aimee’s photos and logo: do not copy them into your site. Every student calls them from the one shared ampassets folder, so the server keeps a single copy. The path starts with /, so it works from any page or stylesheet. Pick any photo from the Project Assets page and use its path the same way.
Part B: A 4-Column System
Remember the class stacking page: one class makes a row, and width classes decide how wide each column is. Think of the page as 4 equal columns:
Class
Width
Covers
w25
25%
1 of the 4 columns
w50
50%
2 columns
w75
75%
3 columns
w100
100%
All 4
Any set of classes that adds up to 100 makes a full row: w25 w25 w25 w25, w50 w25 w25, w75 w25. To change a layout, you change a class in the HTML. The CSS stays the same.
Add the column system. Add this under your page rules in style.css.
Puts everything inside the row side by side, left to right.
gap: 20px
Space between the columns. 25% + 50% + 25% plus the gaps is a little over 100%, so flex shrinks each column a little to make it all fit. The sizes stay in proportion.
margin-bottom: 20px
Space under each row, so rows do not touch.
Try it on a practice page. Make practice.html in your amp folder (next to index.html) with this code. It is plain HTML, so open it straight from the server.
Stack and swap. In the second row, change w50 to w25 and one w25 to w50. The big box moves. You changed the layout without touching the CSS.
Write the classes for a row with one wide box on the right that covers 3 columns, and one small box on the left.
Part C: Classes to Stack
Width is one job. The AMP boxes need a few more jobs: a height, centered text, padding, and the dark glass look. Give each job its own small class, then stack the ones a box needs.
Add the stacking classes. Add this under the column system.
Row at least 20% or 60% of the screen height. vh means viewport height.
A row
middle
Centers the columns top to bottom inside a row
A row
center, right
Lines up the text
A column
p40
40px of padding all around
A column
panel
The see-through dark box with a thin gold border, round corners, and a shadow
Anything
The colors use rgba: red, green, blue, then how see-through it is. 0.84 is 84% solid, so a little of the photo shows through. That is the glass look.
On your practice page, add panel and p40 to one box. What changed, and what stayed the same?
Part D: Row 1, the Logo and Navigation
Row 1 is a 2-column row: w50 for the logo, w50 for the navigation. All of it lives in header.inc, and the links come from topnav.inc, the same way footer.inc pulls in footernav.inc.
Write topnav.inc. Make includes/topnav.inc. This is the link list for the top of the page.
Write header.inc. Replace includes/header.inc with this. It opens the page, loads the fonts and your stylesheet (with ?v=[cart] so the newest CSS always loads), then builds Row 1: the logo in the first column, and topnav.inc included in the second.
Look at the classes: row middle vh20 is a row that centers its columns and is at least 20% of the screen tall. navbar panel gets the glass look from panel and the pill shape from navbar.
Style the logo and the navigation. Add this to style.css.
The logo is a PNG with a transparent background, so the photo shows around the letters. width: 100% with max-width: 460px lets it shrink in a small column but never grow past 460px.
.navbar display: flex
Flex again, this time on the links: they sit in a line. flex-wrap: wrap lets them drop to a second line when space runs out.
border-radius: 999px
A huge radius rounds the ends into a pill. .navbar comes after.panel in the file, so its corners win over panel’s 14px.
:hover
The look when the mouse is over a link.
Part E: Row 2, the Welcome Row
Row 2 is a 3-column row on the 4-column system: w25 + w50 + w25. The two outside boxes are photos, and the middle one holds the welcome message.
Write index.html. Replace your homepage with this. The header line pulls in Row 1 at the top and the footer line pulls in Row 3 at the bottom, so only Row 2 lives in this file.
[include file=/citi/coding/2027/1/YOURINTS/amp/includes/vars.inc]
[include file=[incvar]header.inc]
<!-- ROW 2 -->
<div class="row vh60">
<div class="w25 panel photo photo1"></div>
<div class="w50 panel p40 center welcome">
<p class="eyebrow">Aimee Mohr Photography</p>
<h1>Moments worth keeping</h1>
<div class="divider"></div>
<p class="welcome-text">Weddings, engagements, seniors, families, maternity and newborns. Natural, heartfelt photographs of the people and days that matter most to you.</p>
<div>
<a class="btn btn-solid" href="[pathvar]gallery/">View the Gallery</a>
<a class="btn btn-outline" href="[pathvar]contactus/">Book a Session</a>
</div>
</div>
<div class="w25 panel photo photo2"></div>
</div>
[include file=[incvar]footer.inc]
.photo has what both photo boxes share. .photo1 and .photo2 only pick the picture. The boxes are empty: the row’s vh60 gives them their height.
.welcome
Flex inside a column. flex-direction: column stacks the pieces top to bottom, and justify-content: center moves them to the middle of the box.
.divider
An empty div 60px wide and 1px tall with a gold background: a short gold line. margin: 0 auto centers it.
max-width: 520px
Keeps the paragraph from stretching into one long line on a big screen.
.btn + .btn-solid
Stacking again. .btn is the shape both buttons share. .btn-solid fills it gold, .btn-outline leaves it see-through.
Make the welcome box w75. What else in Row 2 has to change so the row still adds up to 100?
Part F: Row 3, the Footer
Row 3 is w25 + w50 + w25 again: the same columns as Row 2, so you already know how it works. The difference is that the whole row sits inside one dark panel, with a copyright line under the columns.
Write footernav.inc. Make includes/footernav.inc. This is the link list for the footer.
The <footer> is the panel. The row inside it makes the 3 columns. The copyright line is outside the row, so it goes under all three instead of becoming a fourth column.
Comes after .panel, so its darker background wins. It keeps panel’s border, corners, and shadow.
.footer .logo
Only a logo inside the footer: smaller, and centered with margin: 0 auto. The top logo is not touched.
list-style: none
Removes the bullets. padding: 0 removes the indent.
border-top
The thin line above the copyright.
Rules to Remember
Widths in a row add up to 100. w25 + w50 + w25. The gap is handled for you.
One class, one job. Width, height, padding, and look are separate classes. Stack what a box needs.
Later rules win when two classes set the same thing. Keep .panel above .navbar and .footer.
Aimee’s photos and logo come from the shared folder. Use /citi/coding/ampassets/, never a copy in your own images folder.
Includes can hold includes. header.inc pulls in topnav.inc, and footer.inc pulls in footernav.inc. A page only needs the header and footer lines.
Keep ?v=[cart] on the stylesheet link.[cart] is a new number on every visit, so the browser always loads your newest style.css instead of an old saved copy.
Success Criteria Check-In
Exit Ticket
Why is it better to write .w25 once than to give every box its own width rule?Row 2 and Row 3 use the same column classes. Name one thing that makes them look different.