In this lesson you will
- Organise a stylesheet with custom properties and a clear order of sections
- Combine Flexbox, Grid and media queries into one responsive page
- Make one stylesheet serve the English and the Arabic version
- Check a finished page for contrast, focus, reduced motion and a 320 pixel screen
Step 1: decide the look before writing rules
Professional designers do not pick a new colour for every rule. They choose a short list and reuse it: one brand colour, a darker version for hover, a light tint for backgrounds, a text colour and a muted colour for small print. Add two font stacks, one for English and one that starts with a good Arabic face, a spacing scale such as 0.5rem, 1rem and 2rem, and one border radius. Ten decisions like these give the whole page a consistent feel.
Check the colours before you use them. WCAG success criterion 1.4.3 asks for a contrast ratio of at least 4.5 to 1 between normal text and its background, and 3 to 1 for large text. White text on a mid green or a light gold often fails, especially in bright sunlight on a phone. Any contrast checker, including the browser’s developer tools, gives the ratio for two colours; adjust the shade until it passes.
Sign in free to read the full lesson
You are reading the free preview. Create a free account (it takes one minute, no password) to unlock the rest of this lesson and track your progress.
Unlocks after sign-in:
- 3 more sections with live code examples
- Common mistakes to avoid
- Hands-on coding exercise with automatic checks
- Practice quiz and the graded lesson test
Free forever. No card, no paywall.
Questions people ask
What is a good first CSS project for a portfolio?
A complete one-page site for a real or realistic small business is a strong choice, because it shows layout, responsive design, forms, tables and accessibility in one place. Building it in two languages, as in this project, shows something many portfolios do not.
What are CSS custom properties, and are they the same as variables?
Many people call them CSS variables. They are properties whose names start with two dashes, such as --brand, and you read them with var(). Unlike variables in tools such as Sass, they live in the browser, follow the cascade and can change inside a media query or for one part of the page.
How should I organise a CSS file?
A simple order works for most sites: custom properties first, then global rules for elements such as body, img and links, then layout pieces such as the header, main and footer, then components such as cards, tables, forms and buttons, then utilities and media queries. Add a short comment above each part.
How can I check my CSS for errors?
Paste it into the free W3C CSS Validation Service, which reports unknown properties, missing semicolons and invalid values. In the browser, developer tools show crossed-out or warning-marked declarations that the browser ignored, which is often the fastest way to find a typo.
What should I learn after HTML and CSS?
JavaScript is the next step: it makes pages respond to people, such as checking a form before it is sent or showing a live calculation. After that, most front end paths add Git, a framework such as React, and accessibility in more depth.
Sources
Facts in this lesson were checked against these official pages on 5 November 2026.
- MDN: Using CSS custom properties (variables)
- MDN: Organizing your CSS
- MDN: :focus-visible
- W3C WAI: Understanding WCAG 2.2 Contrast (Minimum) (1.4.3)
- W3C WAI: Understanding WCAG 2.2 Focus Visible (2.4.7)
- W3C CSS Validation Service
Code examples stay in English and run in a sandbox on your device. If you spot a mistake, tell us through the contact page.