<!DOCTYPE html>
<html>
<style>
#myDIV {
width: 500px;
height: 500px;
background: coral url('smiley.gif') no-repeat fixed center;
color: white
}
</style>
<body>
<h1>HTML Style Object</h1>
<h2>The background Property</h2>
<p>Click the "Try it" button to change the background property of the DIV element:</p>
<button onclick="myFunction()">Try it</button>
<div id="myDIV">
<p>My DIV element</p>
</div>
<script>
function myFunction() {
document.getElementById("myDIV").style.background = "url('smiley.gif') lightblue repeat-x center";
}
</script>
</body>
</html>