
- Javascript Basics Tutorial
- Javascript - Home
- Javascript - Overview
- Javascript - Syntax
- Javascript - Enabling
- Javascript - Placement
- Javascript - Variables
- Javascript - Operators
- Javascript - If...Else
- Javascript - Switch Case
- Javascript - While Loop
- Javascript - For Loop
- Javascript - For...in
- Javascript - Loop Control
- Javascript - Functions
- Javascript - Events
- Javascript - Cookies
- Javascript - Page Redirect
- Javascript - Dialog Boxes
- Javascript - Void Keyword
- Javascript - Page Printing
- JavaScript Objects
- Javascript - Objects
- Javascript - Number
- Javascript - Boolean
- Javascript - Strings
- Javascript - Arrays
- Javascript - Date
- Javascript - Math
- Javascript - RegExp
- Javascript - HTML DOM
- JavaScript Advanced
- Javascript - Error Handling
- Javascript - Validations
- Javascript - Animation
- Javascript - Multimedia
- Javascript - Debugging
- Javascript - Image Map
- Javascript - Browsers
- JavaScript Useful Resources
- Javascript - Questions And Answers
- Javascript - Quick Guide
- Javascript - Functions
- Javascript - Resources
Set the background image of an element with CSS
To set the background image of an element, use the background-image property.
Example
You can try to run the following code to learn how to work with the background-image property:
<html> <head> <style> body { background-image: url("/css/images/css.jpg"); } </style> <body> <h1>Hello World!</h1> </body> </head> <html>
- Related Articles
- Set the background color of an element with CSS
- Set the Background Image Position with CSS
- Which property is used to set the background image of an element using CSS?
- Set background image as fixed with CSS
- How to set background-image for the body element using CSS?
- Set the size of background image using CSS?
- Set a linear gradient as the background image with CSS
- Set a radial gradient as the background image with CSS
- Set all the background image properties in one section with CSS
- Set the height of an image with CSS
- Set the opacity of an image with CSS
- Set the width of an image with CSS
- Repeat the background image with CSS
- Specify the background image with CSS
- Set the Background Attachment with CSS

Advertisements