background-image using the url function, which takes the URL of a file as its only parameter
.
<html>
<head>
<title>Set URL for Background Image </title>
<style type="text/css">
div { background:url("http://www.java2s.com/style/logo.png") no-repeat; width:250px; height:76px; }
</style>
</head>
<body>
<h1>Background Image</h1>
<div></div>
</body>
</html>
Related examples in the same category