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, gif, etc. HTML5 does not support the <body> background attribute, so CSS is used to set background image.