/    Sign up×
Community /Pin to ProfileBookmark

Dear Users,

I have got a problem with background (full screen background) below is the code which is doing full size rezisable backgroung but is cutting the image. How do I make it so the width is 100% max but the height is deppend on the length of the background the image and I am able to scroll down.

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”
http://www.w3.org/TR/html4/loose.dtd“>
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
<title>Untitled Document</title>
</head>
<style type=”text/css”>
html, body {
height: 100%;
margin: 0;
padding: 0;
}
img#bg {
position:fixed;
top:0;
left:0;
width:100%;
}
#content {
position: absolute;
z-index:1;
}
</style>
<!–[if IE 6]>
<style type=”text/css”>
html { overflow-y: auto; }
body { overflow-y: auto; }
#bg { position:absolute; z-index:-1; }
#content { position:static; }
</style>
<![endif]–>

<body>
<img src=”curtain/new-7.jpg” alt=”background image” id=”bg” />
<div id=”content”>All your content here – including headers, paragraphs, etc.</div>

</body>
</html>

to post a comment
CSS

1 Comments(s)

×

Success!

Help @spacemoc spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...