A tutorial on building a site where visitors can change the background colour, using HTML, CSS and JavaScript. It shows how to add the markup and styles, add a script, and detect dark backgrounds, using a portfolio site as the example.
What you’ll learn
✓Add HTML and CSS controls that let users change the background colour
✓Add a script that applies the chosen colour to the page
✓Detect dark backgrounds to adjust the interface for legibility