Reputation: 15
For some reason, when I attempt to display a cloud image (which I made exactly the same way as the hill image), it doesn't show up! How come? Both images are .png files. However, the tree image has a solid background (not transparent) the clouds have a transparent background. Is this what is causing the issue? If so, how do I fix it?
html
{
/* Webkit (Safari/Chrome 10) */
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #FFFFFF), color-stop(1, #00A3EF));
/* Webkit (Chrome 11+) */
background-image: -webkit-linear-gradient(bottom, #FFFFFF 0%, #00A3EF 100%);
}
.sky {
background: url(clouds2.png) repeat-x;
display: block;
width: 500px;
height: 500px;
border: 1px solid red;
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3c.org/TR/xhtml11/DTD/xhtml11-strict.dtd">
<!-- START HTML -->
<html>
<!-- START HEAD -->
<head>
<!-- Adding title, meta, link to css and scripts to javascript files -->
<title>27 Days</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="css/27.css" />
<!-- END HEAD -->
</head>
<!-- START BODY -->
<body>
<!-- Creating div to encompass our entire piano -->
<div class="sky" id="sky">
<div class="clouds1" id="clouds1"></div>
<div class="clouds2" id="clouds2"></div>
</div>
<!-- END BODY -->
</body>
<!-- END HTML -->
</html>
Upvotes: 1
Views: 300
Reputation: 63481
As far as I am aware, you must specify a colour as the first parameter to background
, and also put the image in single quotes:
background: transparent url('clouds2.png') repeat-x;
Upvotes: 1