Background

HTML Background Colour Code

Choose a colour and copy the CSS to set it as an element's background.

Live Tool
bg-color.css Live

          
Preview

1How To Use

Follow these steps — no coding experience needed.

  1. Pick a colourUse the swatch or type a hex code.
  2. Copy the CSSOne line — works on any element.
  3. Apply itAdd it to a class, an ID, or directly as an inline style.

2Example Output

What this code looks like once it's on a real page.

A light tint background, often used for cards or callouts.

3Browser Compatibility

BrowserSupportNotes
Chrome✓ SupportedFull support
Firefox✓ SupportedFull support
Safari✓ SupportedFull support
Edge✓ SupportedFull support
Opera✓ SupportedFull support
Mobile browsers✓ SupportedFull support, iOS & Android

Supported in every current browser — Chrome, Firefox, Safari, Edge and Opera all render this identically, on both desktop and mobile.

Related Pages

More tools that pair naturally with this one.