Reputation: 91
I make a site and decided to make the background,wrote the code and viewing the page of the site realized that the image is not on the whole page
what do I need to fix to make the image stretch to the whole page?
<html>
<head>
<title>text</title>
<style>
body{
background: url(back.jpg) no-repeat;
-moz-background-size: 100%
-webkit-background-size: 100%
-o-background-size: 100%
background-size: 100%
}
</style>
</head>
<body style="background-attachment:fixed" topmargin="0">
</body>
</html>
Upvotes: 0
Views: 54
Reputation: 590
Try using background-size: cover;
instead of 100%.
It resizes the background image to cover the entire container, even if it has to stretch the image or cut a little bit off one of the edges
Upvotes: 1