How a web page is put together
Every web page is a text file with tags in it, plus CSS rules that decide how it looks. Web Basics is a short course for adults starting from zero: what a tag does, why one CSS rule beats another, and why a box turns out wider than the width you gave it.
The course has three lessons. The first is about HTML: the opening tag, content and closing tag of an element, nesting one element inside another without overlapping tags, writing an attribute with a quoted value, using heading levels in order and writing a link that jumps to a heading on another page. The second covers CSS rules: the selector, property and value, type, class and ID selectors, and what happens when two rules set the same property. You count specificity in three columns, IDs, classes and elements, and predict which rule wins. The third is the box model: content, padding, border and margin, the visible width in the standard box model, what box-sizing: border-box changes and how margins add to the space a box takes up.
Each lesson opens with a short explanation, then six steps. You type a tag, a selector or a link address, order pieces of code, pick an option, work out a width in pixels or explain a choice in a sentence or two. When your answer is off, the AI tutor first asks a question about it, then gives a hint, then a partial step. Show solution is always available, and a four-question quiz before and after each lesson shows what changed.
This is one of the editorial courses in Ai Teacher. The problems and worked solutions were written in advance, and facts were checked against the public sources listed below: MDN Web Docs and Wikipedia.
What you'll learn
- Write HTML elements with attributes, headings and links
- Predict which CSS rule wins from the cascade and specificity
- Work out how wide a box is from its padding, border and margin
Lessons
HTML elements, attributes and links
CSS rules, selectors and specificity
The box model and an element's width
Counting specificity in lesson 2

Tutor: Count the specificity of the selector #footer ul .link a. Write it as IDs-classes-elements, the way p is written as 0-0-1.
You: 0-0-4

Tutor: Which pieces start with # or a dot? Do they go in the same column as ul?
You: #footer is an ID and .link is a class, so only ul and a are elements. It's 1-1-2.

Tutor: Right, 1-1-2: one ID, one class and two elements. The spaces between the pieces count for nothing.
Who this course is for
- You want to make or edit a simple web page and need to know what the tags mean.
- You changed a CSS rule, nothing happened, and you want to know which rule is winning.
- You plan to learn JavaScript and want the HTML and CSS it works with first.
- You would rather answer short questions with feedback than watch long tutorials.
Questions about Web Basics
Do I need to know any programming?
No. The course starts from what a tag is. The only math is adding and subtracting widths in pixels in lesson 3.
Do I build a web page in the app?
No. You read short pieces of HTML and CSS and answer questions about them: type a tag, a selector or a link address, put pieces of a line in order, pick an option or work out a width. To try the code yourself, a plain text editor and a browser are enough.
Does the course cover JavaScript or page layout?
No. The three lessons cover HTML elements and links, CSS selectors and specificity, and the box model. There is no JavaScript, flexbox or grid. For JavaScript, see JavaScript basics practice.
Is the course free?
One lesson in Ai Teacher is free. After that, a subscription opens all lessons. You can pay monthly or yearly in Google Play, and usage limits apply.
Sources
Facts and definitions were checked against these public sources. Lesson text and examples were written independently; no text was adapted.
- Basic HTML syntax (MDN Web Docs, Learn web development)
- Headings and paragraphs (MDN Web Docs, Learn web development)
- Creating links (MDN Web Docs, Learn web development)
- HTML
- HTML element
- CSS
- Basic CSS selectors (MDN Web Docs, Learn web development)
- Handling conflicts (MDN Web Docs, Learn web development)
- Specificity (MDN Web Docs, CSS guide)
- The box model (MDN Web Docs, Learn web development)
- box-sizing (MDN Web Docs, CSS reference)
- CSS box model
Related courses
- Programming Open textbook
JavaScript
Built automatically from early chapters of the open textbook "JavaScript" on Wikibooks: JavaScript in HTML, syntax, lexical structure, dates and arrays. Not reviewed by a person.
From Wikibooks, 3 lessons - Programming
Python from Zero
For adults who have never programmed: read short Python programs, work out what they print and choose fixes for common mistakes with variables, if / elif / else and loops. You type or pick each answer; the app does not run code.
3 lessons, 18 steps - Computers Open textbook
Introduction to Computers
Built automatically from early chapters of the open textbook "Introduction to Computers" on Wikiversity: computer types, hardware and software, the processor and future peripherals. Not reviewed by a person.
From Wikiversity, 3 lessons
