rendered paste body<!DOCTYPE html><html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Beach Café</title> <style type="text/css"> html, body { margin: 0; padding: 0; width: 100%; } body { background-position: 50% 0; } </style> <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script> <script type="text/javascript"> $(function(){ $img = 'http://www.xtidesign.com/client/beachcafe/beachcafe.png'; $temp_img = $('<img />', { 'src': $img, 'id': 'temp_img' }); $('body').append($temp_img) $('#temp_img').load(function(){ $height = $('#temp_img').height(); $('#temp_img').hide(); $('body').css({ 'background-image': 'url(' + $img + ')', 'height': $height }); }) }) </script> </head> <body> </body> </html>