I’m working on a web page, and I have the following CSS:
body {
background: url('../images/numbers.png');
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
width: 1024px;
height: 900px;
}
And the following HTML:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Index</title>
<link rel="stylesheet" href="css/common.css">
</head>
<body>
</body>
</html>
I’ve set up a size for body (1024×900), but I see that page on browser I see numbers.png everywhere (my monitor resolution is bigger than that).
How can I set background image only inside body (defined as 1024×900)?
How can centre body in the middle of web browser?
By the way, image numbers.png is smaller that 1024×900.
the body is everything you see in the page “including white spaces on the left and right”
you need to have a container div like this