
- 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
How to set background image of a webpage?
To set the background image of a webpage, use the CSS style. Under the CSS <style> tag, add the property background-image. The property sets a graphic such as jpg, png, svg, gif, etc. HTML5 do not support the <body> background attribute, so CSS is used to change set background image.
Example
You can try the following code to set the background image of a web page in HTML
<!DOCTYPE html> <html> <head> <style> body { background-image: url("/videotutorials/images/tutor_connect_home.jpg"); } </style> </head> <body> <h1>Connect with Tutors</h1> </body> </html>
- Related Articles
- How to set a background image to a JavaFX chart?
- How to set a background Image With React Inline Styles?
- How to set background image in CSS using jQuery?
- How to set the size of the background image with JavaScript?
- How to set the starting position of a background image in JavaScript DOM?
- How to set a background image to be fixed with JavaScript DOM?
- FabricJS – How to set the background colour of selection of an Image?
- How to use an image in a webpage?
- How to set the positioning area of the background image with JavaScript?
- How to set an Android App's background image repeated?
- Set the Background Image Position with CSS
- Set background image as fixed with CSS
- Set the background image of an element with CSS
- Set a radial gradient as the background image with CSS
- Set a linear gradient as the background image with CSS

Advertisements