ciao a tutti,
ho trovato questo codice in internet per far in modo che l' immagine di sfondo si adatti a qualsiasi dimensione dello schermo, dopo averlo applicato ( e ne ho provati diversi) cosa accade, che mi compare una riga bianca in fondo alla pagina che rimane fissa sullo schermo sullo sfondo del sito ma sopra l' immagine, come la tolgo?, vi posto qui i codici:
codice HTML:
* { margin: 0; padding: 0; }  
       html {
background: url(nome_immagine.jpg) no-repeat center center fixed;  
      -webkit-background-size: cover;      
  -moz-background-size: cover;    
    -o-background-size: cover;      
  background-size: cover;    }
body{ 
font: normal 85% Arial, Helvetica, sans-serif;  
color: #FFF;
height:100%;
background-color: transparent;
}
p{ padding: 0 0 10px 0;  line-height: 1.7em;  font-size: 100% }


#header_container{ 
height: 350px;  
padding-top: 20px; }  
  #header{ 
width: 960px;
  height: 350px; 
  background :url(../images/IMG_1311.JPG) no-repeat;  }
#menubar_container{ height: 100px;  } 
  #menubar{ width: 900px;  height: 100px;}  
 #welcome{ width: 300px; 
 height: 60px;  
margin:0 20 0 0; 
 float: left;  
text-align: right;  
margin: 0 auto;}     
#menu_items{ 
float: right; 
 height: 75px;
  margin:0 20 0 0 ; 
 padding-top: 25px; 
 width: 580px;}
  #slogan_container{ height: 80px; } 
#slogan{ width: 960px;  height: 80px;}   
#site_content{ width: 940px; 
 overflow: hidden;  
margin: 0 auto; 
 padding: 0 0 20px 20px; 
 background: transparent url(../images/transparent_light.png) repeat;} 
.sidebar_container{ 
float: right;  
margin:20px 20px 0 20px;  
width: 220px;  
padding-left: 15px;  
background: #3D291E;}
.sidebar{ 
float: left; 
 width: 220px; 
 padding: 0; 
 margin-top: 10px; 
 margin-bottom: 10px;}

#content{ 
width: 665px;  
margin-bottom: 20px; 
 float: left;  
color:#000000;  }

  #footer{ 
width: 960px; 
 height: 20px; 
 padding-top: 20px; 
 text-align: center;   
 color: #FFF;}
codice HTML:
  // Insert the following into the html to load the script        //  //   <script src="fixedbackground.js"></script>                 //  //                                                              //  // 1) How to Use in body-tag (preferred):                       //  //  <body onload="fixedBackground('background.jpg');">          //  //                                                              //  // 2) How to Use in link:                                       //  //  <a href="javascript:fixedBackground('background.jpg');">    //  //    Try this background...                                    //  //  </a>                                                        //  //                                                              //  // 3) How to use in script:                                     //  //  <script>                                                    //  //    fixedBackground('background.jpg');                        //  //  </script>                                                   //  //--------------------------------------------------------------//
  function fixedBackground(url)  {    if(!backgroundset)    {      document.body.style.overflow = 'hidden';      document.body.style.padding  = '0px';      document.body.style.margin   = '0px';
      var overlay = document.createElement('DIV');      overlay.style.position    = 'absolute';      overlay.style.top         = '0px';      overlay.style.left        = '0px';      overlay.style.height      = '100%';      overlay.style.width       = '100%';      overlay.style.overflow    = 'auto';
      overlay.innerHTML         = document.body.innerHTML;      document.body.innerHTML   = '<img id="background" height="100%"  width="100%" src="' + url + '" style="left: 0; bottom: 0; right: 0; top: 0; z-index: 0" />';
      document.body.appendChild(overlay);
      backgroundset=true;    }    else      background.src=url;  }