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.


You can try the following code to set the background image of a web page in HTML

Live Demo

<!DOCTYPE html>
         body {
            background-image: url("/videotutorials/images/tutor_connect_home.jpg");

      <h1>Connect with Tutors</h1>