Background

HTML Background Image Code

Use any image as a background — paste the URL and copy the CSS.

Live Tool
bg-image.css Live

          
Preview

1How To Use

Follow these steps — no coding experience needed.

  1. Paste an image URLAny publicly hosted image works.
  2. Choose a sizing modecover fills the box (may crop), contain fits the whole image, auto uses natural size.
  3. Copy the CSSThree lines cover most use cases.

2Example Output

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

Hero section with a background photo

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.