Preventing repeating background - HTML CSS CSS Property

HTML CSS examples for CSS Property:background

Description

Preventing repeating background

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">

body {<!--   w  ww  . j  a va 2s .com-->
   background: url('https://www.java2s.com/style/demo/Google-Chrome.png');
}
div#header {
   margin: 0px auto;
   width: 1020px;
   text-align: center;
   height: 100px;
}
div#wrapper {
   background: url('https://www.java2s.com/style/demo/Firefox.png');
   height: 500px;
   margin: 0px auto;
   width: 1020px;
}
div#photo-frame {
   margin: 12px;
   padding: 15px;
   box-shadow: rgba(0,0,0,0.2) 0px 0px 15px;
   background: white;
}


      </style> 
 </head> 
 <body> 
  <div id="header"> 
   <h1>This should be visible above the background.</h1> 
  </div> 
  <div id="wrapper"> 
   <div id="photo-frame"> 
    <img src="https://www.java2s.com/style/demo/Safari.png"> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials