HTML CSS examples for CSS Property:background
Use background-size: cover
<html> <head> <style> .intro {<!-- w w w.ja va2s. c o m--> background: url('https://www.java2s.com/style/demo/Safari.png') no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; -ms-ie-background-size: cover; background-size: cover; top: 0px; right: 0px; left: 0px; } </style> </head> <body> <div class="intro"> test </div> </body> </html>