← CSS Styling
Typography and visual design · 15 MIN

Colors and backgrounds

Colors and backgrounds

CSS supports named, hexadecimal, RGB, HSL and other color notations. Choose text and background combinations with sufficient contrast. Background images should not carry essential information unless equivalent text is provided.

Try it yourself

Change the example, run it, and explain the result in your own words. Then create one variation of your own.

Key idea

Use the example as a starting point, not something to memorize. Practise, inspect the result and make small improvements.

Code example

body { background: #f7f9fc; color: #172b4d; }
.button { background: hsl(220 90% 55%); color: white; }