How to set a background image on a web page

How do I make a picture as a background in web pages?

Here’s a simple example:

<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">

body {background: url(bgimage.png) no-repeat 50% 0;}



For more details on how to deal with your situation, post a link or some sample code.