Free course · 12 written lessons · live editor

HTML and CSS, hands-on

Every lesson has a live editor: change the code and watch the page change. From your first tag to flexbox, grid and responsive design, each with an exercise and the interview questions on it. No video: read, edit, try.

Your progress0 of 12 done · saved on this device
  1. 1How a web page is builtEvery page you've ever seen is built from two languages: HTML says what things are, and CSS says how they look. The browser reads both and paints the page.
  2. 2Text, links and imagesMost of the web is text, links and pictures. Use the element that says what the thing is, and the browser, search engines and screen readers all understand your page.
  3. 3Tables and formsTables show data in rows and columns; forms collect input. Both are easy to get working and easy to get subtly wrong.
  4. 4Semantic HTML and accessibility"Semantic" means using the element that says what something is. It costs nothing, and it makes your page work for screen readers, search engines and keyboard users.
  5. 5Selectors, specificity and the cascadeWhen two CSS rules disagree, which one wins? The answer is the cascade: importance, then specificity, then order. Know it and CSS stops feeling random.
  6. 6The box modelEvery element is a box: the content, then padding, then a border, then margin outside it. Most "why is this the wrong size?" bugs are box-model bugs.
  7. 7Display and positioningdisplay decides how a box sits among others; position lets you move it out of that flow. Together they explain every "why won't this go there?".
  8. 8FlexboxFlexbox lays things out in one direction, a row or a column, and handles the spacing and alignment that used to need hacks.
  9. 9CSS GridGrid lays things out in two directions at once: rows and columns. Use it for page layouts and card galleries; use flexbox for a single row or column.
  10. 10Responsive designMost of your users are on phones. Responsive design means one page that works at every width: start with the phone, then add rules as the screen grows.
  11. 11Colours, fonts, variables and transitionsThe details that make a page feel finished: a consistent palette, readable type, and small, smooth changes when you hover or click.
  12. 12Project: a responsive profile cardTime to put it together: a profile card you could put on a portfolio, built from semantic HTML and the CSS from every lesson. Then change it to make it yours.

Next, make it move: Inside JavaScript, the free course on how JavaScript really runs your code.