Content
Difficulty: Easy Concept: CSS syntax, selectors, typography, colors, spacing, external stylesheets
Take the personal portfolio page you built in Week 1 and bring it to life with CSS.
Requirements:
styles.css file in the same folder and link it from your HTML with <link rel="stylesheet" href="styles.css">*, *::before, *::after {
box-sizing: border-box;
}
font-family on the body, use rem units for font sizes, and give headings a different size and weight than body textpadding and margin to give your sections breathing room — nothing should feel cramped against the edge of the screenlist-style: none) and add some visual treatment of your choiceHints:
<head> before closing it: <link rel="stylesheet" href="styles.css">body styles (font, color, background) before moving to specific elementsDifficulty: Easy Concept: Flexbox alignment, Grid placement
Before building layouts from scratch, spend 15 minutes getting the alignment properties into muscle memory through two games.
Requirements:
After finishing both, write down your answers to these three questions in a comment block at the top of your styles.css from Exercise 1:
Difficulty: Easy/Medium Concept: Focus states, color contrast, keyboard navigation, accessible styling
Go back to your portfolio from Exercise 1 and audit it for accessibility. Most issues take one or two lines of CSS to fix.
Requirements:
Open your portfolio and press Tab repeatedly: does a visible focus ring appear on your navigation links? If not, add one.
Show code hint (only open if you are stuck)
Open DevTools, click any text color value in the Styles panel, and check the contrast ratio that appears. Fix any that fall below 4.5:1 for body text or 3:1 for large text
Add a skip link so keyboard users can jump past the navigation:
Show code hint (only open if you are stuck)
Add prefers-reduced-motion handling if you added any transitions or hover animations in Exercise 1:
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
transition-duration: 0.01ms;
}
}
Install the axe DevTools extension (free) and run it on your portfolio. Fix any issues it flags
Hints:
prefers-reduced-motion in DevTools without changing your system settings: three-dot menu → More tools → Rendering → "Emulate CSS media feature prefers-reduced-motion"id="main-content" to your <main> element so the skip link has somewhere to jump toThe HackYourFuture curriculum is licensed under CC BY-NC-SA 4.0

Found a mistake or have a suggestion? Let us know in the feedback form.