“Antecipação de fundo” Respostas de código

Fundo estático HTML

body {
  background-image: url("img_tree.gif");
  
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  
  background-size: cover;
}
Lazurite

Antecipação de fundo

The background-attachment property specifies how the background moves relative to the viewport.

To set this movement, we use the values scroll, fixed or local. The scroll keyword is the default where 
the image scrolls with the main browser window but is fixed with respect to the element it is the background of. 
Using fixed means the image is fixed so as you scroll the element will appear like a window to the image beyond. 
If you use local, then you can scroll the main browser viewport and within the element.

    
/* Keyword values */
background-attachment: scroll;
background-attachment: fixed;
background-attachment: local;
Fragile Flamingo

Procure respostas de código populares por idioma

Procurar outros idiomas de código