Jump to content

How to Fix Background Image?


HungryMind
 Share

Recommended Posts

Are you talking about having the background image show fully with whole browser veiwport and remain fixed? whatever resolution.Here one i made earlier

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Untitled Document</title><script type="text/javascript">/*<![CDATA[*//*---->*//*--*//*]]>*/</script><style type="text/css">*{margin:0;padding:0; position:relative; z-index:10;}body, html{ height:100%; position:relative; z-index:0;}#bgimage { width:100%; height:100%; position:fixed; top:0; left:0; z-index:0;}</style><!--[if lt IE 7]><style type='text/css'>body { height: 100%; overflow: auto; overflow-x: hidden; width:100%;}html{ height: 100%; overflow-y: hidden;}#bgimage { height:auto; position:absolute; }</style><![endif]--></head><body><img src="clonewars_body.jpg" id="bgimage" /><div>  <p>Sed do eiusmod tempor incididunt velit esse cillum dolore excepteur sint occaecat. In reprehenderit in voluptate quis nostrud exercitation ut enim ad minim veniam. Duis aute irure dolor consectetur adipisicing elit, ut aliquip ex ea commodo consequat. Mollit anim id est laborum.</p>  <p>Sed do eiusmod tempor incididunt quis nostrud exercitation excepteur sint occaecat. Lorem ipsum dolor sit amet, consectetur adipisicing elit, duis aute irure dolor. Sunt in culpa. Quis nostrud exercitation ut aliquip ex ea commodo consequat.</p>  <p>Ut labore et dolore magna aliqua. Duis aute irure dolor lorem ipsum dolor sit amet, cupidatat non proident. In reprehenderit in voluptate quis nostrud exercitation ut aliquip ex ea commodo consequat. Consectetur adipisicing elit, sunt in culpa cupidatat non proident.</p>  <p>Lorem ipsum dolor sit amet, quis nostrud exercitation sed do eiusmod tempor incididunt. In reprehenderit in voluptate velit esse cillum dolore. Sed do eiusmod tempor incididunt consectetur adipisicing elit, ut enim ad minim veniam. Quis nostrud exercitation eu fugiat nulla pariatur. Duis aute irure dolor ullamco laboris nisi cupidatat non proident.</p>  <p>Excepteur sint occaecat quis nostrud exercitation qui officia deserunt. Duis aute irure dolor ut aliquip ex ea commodo consequat. Ut enim ad minim veniam, in reprehenderit in voluptate cupidatat non proident. Ut labore et dolore magna aliqua.</p></div></body></html>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...