/ Published in: HTML
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <style type="text/css"> html, body { height: 100%; margin: 0; padding: 0; font-family: Verdana, Geneva, sans-serif; font-size: 100%; color: #000; background-color: #FFF; } img#bg { position:fixed; top:0; left:0; width:100%; height:100%; } #content { position:relative; z-index:1; Margin: 20px; } #content p { font-size:80%; font-weight: bold; } #content h1 { color:#369; font-size:90%; font-weight: bold; } </style> <!--[if IE 6]> <style type="text/css"> html { overflow-y: hidden; } body { overflow-y: auto; } #bg { position:absolute; z-index:-1; } #content { position:static; } </style> <![endif]--> </head> <body> <img src="images/stretchbg.jpg" alt="background image" id="bg" /> <div id="content"> Content goes here </div> </body> </html> <!-- Original at http://www.texaswebdevelopers.com/examples/stretch-bg.asp -->