Reputation: 205
The image file (a1.jpg) exists and in the same folder. But it doesn't show up, only the font's color become white.
Anyone can explain me why and how to fix it?
<style type="text/css">
p,h1,h2,h3,h4 {
font-family: Verdana, Geneva, sans-serif;
color: white;
}
a {
text-decoration: none;
}
body {
background-image: url('a1.jpg');
}
th,td {
font-family:Arial, Helvetica, sans-serif;
color:white;
}
</style>
Upvotes: 0
Views: 41548
Reputation: 21
the value of the background-image should be like this form and should be in the same folder:
background-image:url(../img/1.jpg);
Upvotes: 2
Reputation: 14365
The image file (a1.jpg) is exist and in the same folder ...
In which folder, though? The html page's folder, or the CSS file's folder? The path will only work if the image is in the same folder as the CSS file.
Upvotes: 1
Reputation: 4723
If your title is right, you need to set a background color before the image.
It's very unclear what you are asking... Do you want to have a backrgound color and an image?
background: #ffffff;
background-image: url('a1.jpg');
Upvotes: 3