Saturday, 7 September 2013

Why doesn't my background image show up in the html tag?

Why doesn't my background image show up in the html tag?

I'm having problems adding a background image to my background website in
the html tag. The problem is here:
html{
background:url('assets/img/jp-logo.png'); /*background image*/
background-image:url('assets/img/jp-logo.png'); /*background image*/
-webkit-background-size: cover;
-moz-background-size: cover;
}
I put in both background and background image because i testing whether
either one would work along with the background size: cover but none of
them did. I also checked my file directory paths, those are good too. I
was wondering why as that's not supposed to happen. i tested it on a
seaprate html and css test sheet and it worked, but why not here is
suspicious to me. The full code here:
http://jsfiddle.net/TheAmazingKnight/kjLg8/
This short sample I made worked:
<!doctype html>
<html lang="en">
<head>
<title>Test Page</title>
<link rel="stylesheet" href="test.css" type="text/css" media="screen"
/> <!--CSS for desktop screens-->
</head>
<body>
<p>hello</p>
<img src="jp-logo.png" alt="jp-logo.png" />
</body>
</html>
html{
background-image:url('assets/img/jp-logo.png');
}

No comments:

Post a Comment