you only have to put a URL in quotes if the URL contains whitespace. : url « Style Basics « HTML / CSS






you only have to put a URL in quotes if the URL contains whitespace.

 

<html>
<head>
<title>Set URL for Background Image </title>
    <style type="text/css">
        div { background:url("your file name.png") no-repeat; width:250px; height:76px; } 
    </style>
</head>
<body>
<h1>Background Image</h1> 
<div></div> 
</body>
</html>

 








Related examples in the same category

1.list-style-image: url('collapsed_folder.gif');
2.background-image using the url function, which takes the URL of a file as its only parameter