Dynamic resize of image paradox

N

Neredbojias

I often see comments that I have interpreted to mean that what this
page demonstrates is not possible.
Where have I gone wrong?
Why is this the first time that I have seen this in effect in 10 years
of surfing?

I did that years ago and had it in a page with automatic font-size adjust.
Trouble is most images don't resize that well and the system bloats the
markup, anyway.
 
S

sunil

It is absolutely nothing.. It will resize while the div tag resizes.
All div tags are defined in % values..And it is not background image.
See the below code

<!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>background image resize - CSS only</title>
<meta name="" content="authored by http://www.nopeople.com" />
<style type="text/css">
body {
height: 100%;
width: 100%;
border: 0px;
margin: 0px;
padding: 0px;
}
html {
height: 100%;
width: 100%;
overflow: hidden;
}
#background_image {
position: absolute;
top: 0px;
left: 0px;
height: 100%;
width: 100%;
z-index: 1;
}
#page {
position: absolute;
top: 0px;
left: 2px;
z-index: 2;
height: 100%;
width: 100%;
overflow: auto;
}
#ad {
margin-top: 3%;
width: 30%;
float: right;
clear: right;
}
p {
text-align: right;
}
p.footer_link {
text-align: left;
margin: 0px;
}
#content {
width: 30%;
margin: 3%;
}
</style>
</head>

<body>
<img src="CRW_1603 Old Matanuska Bridge.jpg" alt="big pic" width="3364"
height="2548" id="background_image" />
<div id="page">
<div id="ad"><p class="footer_link">Web design by: <a
href="http://www.nopeople.com"
target="_blank">nopeople.com</a></p></div>
<div id="content"><p>Resize the window, and the background image will
scale to fit the new window size.</p></div>
</div>
</body>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top