<html>
<head>
<style>
#myDIV {
width: 500px;
height: 500px;
background: coral url('smiley.gif') no-repeat fixed center;
color: white
}
</style>
</head>
<body>
<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>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_style_background_div by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:03:06 GMT -->
</html>