← All subjects
NewFree preview available
Coding · Any age, any level

CSS from Beginner to Advanced: Design Web Pages

Learn CSS, the language that makes web pages look good: colour, fonts, spacing, flexbox, grid, responsive layouts and animation, all practised in your browser.

★ New0 reviews1 learners
Created by GradesPal
Modules
3
Lessons
12
Study time
6h 45m

What you’ll learn

Style text, colours and spacing with confidence
Explain and use the box model: padding, border and margin
Lay out pages with flexbox and grid
Make pages that fit phones, tablets and laptops
Add hover effects, transitions and animations that feel professional
Design a complete, responsive profile page

Workshop content

3 modules · 12 lessons · 6h 45m total

Level 1 · Beginner4 lessons
Your first styles30 min · Preview

Your first styles

CSS4 min readTry it live: Code Studio

In this lesson

  1. A rule
  2. Where does CSS go?
  3. Colours
  4. Styling the whole page
  5. Comments
  6. When nothing happens

Practise this in the Code Studio

open the exercise for this lesson. You type real code in your browser, see the result at once, and the tasks tick themselves when your code is right. Nothing to install.

HTML says what is on a page. CSS says how it looks: colours, sizes, spacing and layout. CSS stands for Cascading Style Sheets.

A rule

CSS is a list of rules. Every rule has the same shape:

CSS
h1 {
  color: blue;
}
PartExampleMeaning
Selectorh1Which elements to style
PropertycolorWhat to change
ValueblueWhat to change it to
Declarationcolor: blue;A property and its value together

A rule can hold many declarations. Each one ends with a semicolon, and they all sit between curly braces.

CSS
h1 {
  color: blue;
  background-color: lightyellow;
}

Note

CSS uses American spelling: color, not colour, and center, not centre. A misspelt property is silently ignored.

Where does CSS go?

WayHowUse it
External fileA file called style.css, linked from the head: <link rel="stylesheet" href="style.css">Almost always. One file can style a whole website
InternalInside a <style> element in the headFor a single page
InlineIn a style attribute on one elementRarely. Hard to maintain

In the Code Studio, the style.css tab is your external file. It is already linked to the page.

Colours

There are three common ways to write a colour:

WayExampleNotes
Namered, darkgreen, lightyellowAbout 140 names. Easy to start with
Hex code#1f74bfSix digits: two each for red, green and blue. What designers use
RGBrgb(31, 116, 191)The same three amounts, from 0 to 255

#000000 is black, #ffffff is white, and #1f74bf is the GradesPal blue.

Two properties you will use on every page:

  • color is the colour of the text.
  • background-color is the colour behind it.

Styling the whole page

CSS
body {
  background-color: lightyellow;
}

The body holds everything, so a background on the body covers the page.

Comments

CSS
/* This is a CSS comment */

When nothing happens

CSS does not show error messages. If a rule seems to do nothing, check:

  1. Is the property spelt correctly?
  2. Is there a colon after the property and a semicolon at the end?
  3. Are both braces there?
  4. Does the selector match the element?

Try it

  1. Make the heading blue and the paragraphs dark green.
  2. Give the page a light background.
  3. Change the heading colour to the hex code #e4572e.
  4. Remove one semicolon and see what breaks. Put it back.

Check yourself

Name the three parts of this rule: p { color: red; }

p is the selector, color is the property and red is the value.

What is the difference between color and background-color?

color sets the colour of the text. background-color sets the colour behind it.

You wrote colour: blue; and nothing happened. Why?

CSS uses the American spelling color. A property the browser does not know is ignored without any error.

Practise this lesson in the Code Studio →

Text and fonts30 min
Classes and ids30 min
The box model30 min
Level 2 · Intermediate4 lessons
Backgrounds, corners and shadows30 min
Display and position30 min
Flexbox30 min
Grid30 min
Level 3 · Advanced4 lessons
Responsive design30 min
Hover, transitions and transforms30 min
Variables and animations30 min
Project: style the profile page75 min

Requirements

  • Any device with a web browser: a computer is best
  • Basic HTML (the GradesPal HTML course, or the same knowledge)
  • Open to everyone: no age or grade requirement

Frequently asked questions

Do I need to install anything?

No. You write and run all your code in the GradesPal Code Studio, in your browser. It works on a computer, a tablet or a phone, though a keyboard makes typing code much easier.

Can I buy only one level?

Yes. The course has three levels: Beginner, Intermediate and Advanced. You can buy the whole course or one level at a time.

How long does it take?

There are 12 lessons. Working about an hour a day, most learners finish in three to four weeks, but you can go at your own speed.

Who is this course for?

Anyone. The course starts from zero, so it suits school learners, university students and adults changing careers or learning for fun. There is no grade or age requirement.

Will I get a certificate?

Yes. Finish the lessons and the project to complete the course.

No reviews yet