Part 4 · HTML and CSS · Learn to program

Knowledge Videos

Short animated explainers, organised by subject.

Learn to program

8 videos

A step-by-step path for complete beginners: how computers and the web work, then HTML, CSS, JavaScript, Go and a full-stack app of your own.

Part 4 · HTML and CSS

1:21

16What is HTML?

HTML describes the content of a web page with elements: an opening tag, content and a closing tag. The page skeleton, head and body, and nesting.

HTMLtagelementheadbodybeginner
1:35

17Links, images and lists

Attributes add information to a tag: href for links, src and alt for images. How a relative path finds a file, and how ul, ol and li make lists.

attributehrefsrcpathHTMLbeginner
1:22

18What is CSS?

CSS styles a web page. A rule is a selector, a property and a value, and a link tag joins the style.css file to the HTML page.

CSSselectorpropertyvaluerulebeginner
1:13

19The box model

Every element is a box with four layers: content, padding, border and margin. How each one is set with CSS, and what changes when you change a number.

box modelpaddingbordermarginCSSbeginner
1:22

20DevTools: inspect and fix

Right click and Inspect: the Elements tab, the Styles panel, live edits that vanish on refresh, and the Console for finding errors.

DevToolsinspectconsoledebuggingbeginner
1:16

21Classes and ids

A class is a name many elements can share, an id belongs to one element. The dot and hash selectors, and div and span as plain containers.

classidselectordivspanCSSbeginner
1:16

22Flexbox

Line up elements with display: flex. Flex container and flex items, justify-content, align-items, gap, flex-wrap and flex-direction.

flexboxflex containerjustify-contentalign-itemsCSSbeginner
1:18

23Responsive design

Make a page fit any screen: the viewport meta tag, flexible sizes with percentages and max-width, and a media query that stacks the cards on narrow screens.

responsivemedia queryviewportCSSbeginner