Problem with background

html-css

#1

Hello everybody! I always have problems with using 'background'. There is a little code:

<!DOCTYPE html>
<html>
   <head>
      <title>Проба</title>
         <meta charset = "UTF-8">
	   <link href='K:\Notepad++\new 3.css' rel='stylesheet' type='text/css'>
   </head>
   <body></body>
</html>

I like to make a picture as a background of the body:

body {
	background: url("http://mirgif.com/priroda/priroda-3.jpg") no-repeat center;
	background-size: cover;
}

But the picture is lifted a bit so that there is a white strip below it.

The problem is solved only by adding FIXED: background: url("http://mirgif.com/priroda/priroda-3.jpg") no-repeat center FIXED; I don't like learning the CSS rules without understanding how they works! Is anybody there who could explain me why it happens with fixed? And why it doesn't work without 'fixed'? As far as I understand, 'fixed' refers to 'backgroud-attachment' and is used to not permit the background image move while scrolling. And in my case there are no scrolling bars without 'fixed'!


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.