Color Tutorials
Nine short tutorials, each with a live demo and copyable code: HTML text, link, and background color; CSS color basics, text, link, background, and placeholder color; and SCSS color variables.
Step-by-step color guides with live demos — pick a color, see the code update, and copy it into your own page. No sign-up, no setup: every demo runs in your browser.
Color basics in HTML
The quickest way to set a color: the style attribute on an
element. Three short tutorials, one per property.
- HTML Text Color — color text in hex, named color, RGB/rgba, and HSL/hsla, with a live paragraph and a contrast checker.
- HTML Link Color — one color per link state with :link, :visited, :hover, and :active, in the correct LVHA order, contrast-checked per state.
- HTML Background Color — background-color in hex, RGB, and HSL, with alpha explained in depth and an opacity slider.
Getting started with CSS
The same ideas as stylesheet rules — how real pages do it. One rule colors every matching element, and you change it in one place.
- CSS Color Basics — how named, hex, RGB, and HSL values work, with a live switcher showing one color in all four formats.
- CSS Text Color — the color property, with a live text/background pair and a contrast ratio that updates as you pick.
- CSS Link Color — link states as stylesheet rules, with a live demo and copyable CSS.
- CSS Background Color — background-color on a live demo card, with a legibility check for black or white text.
- CSS Placeholder Color — style input placeholder text with the modern ::placeholder pseudo-element, with a real working input and a :focus fade.
Advanced SCSS techniques
For larger projects, where one color lives in fifty rules and a rebrand should mean editing one line.
- SCSS Color Variables — store a color once with $variables and reuse it everywhere, with a live mini editor, compiled CSS output, and a CSS custom-properties toggle.
Frequently asked questions
Where should I start with color in HTML and CSS?
Start with the HTML basics: HTML Text Color, then HTML Link Color and HTML Background Color. Then move to the CSS guides — CSS Color Basics, CSS Text Color, CSS Link Color, and CSS Background Color — and finish with the SCSS variables tutorial when you want a maintainable palette.
What is the difference between the HTML and CSS tutorials?
The HTML tutorials show the quickest way to set a color — the style attribute on an element. The CSS tutorials show the same ideas as stylesheet rules, which is how real pages do it: one rule colors every matching element, and you change it in one place.
Do I need to install anything to follow these tutorials?
No. Every tutorial has a live demo that runs in your browser — pick colors, see the code update, and copy it into your own page. Only the SCSS tutorial needs a tool (the Sass compiler) if you want to compile .scss files yourself.
Related tools
Color Picker · CSS Color Basics · What Is a Hex Code? · How to Pick Colors for a Website · Contrast Checker