Forum Moderators: open
what I WANT to do is make it so the height automatically sizes and I know % height doesnt work so I didnt even bother wasting my time on that one so what I really want is something that makes the iframe AUTO adjust to the height of what I put in it.
[edited by: tedster at 6:10 am (utc) on July 12, 2007]
[edit reason] use example.com - not real domains [/edit]
I tried this and it will adjust the width, but not the height even if you set the height to %, em or auto:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
#size {
width: 50%; /* Set to fit your needs */
height: 200px; /* Set to a minimum height as per your needs */
}
</style>
</head>
<body>
<iframe id="size" src="http://www.yourdomain.com/Search/index.asp"></iframe>
</body>
</html>
Marshall
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
html, body{
height:100%;
}
#size {
width: 50%; /* Set to fit your needs */
height: 100%; /* Set to a minimum height as per your needs */
}
</style>
</head>
<body>
<iframe id="size" src="http://www.google.com"></iframe>
</body>
</html>
[edited by: Trace at 3:24 pm (utc) on July 13, 2007]
As a concept this should work, however, making it work in reality is likely to be tricky. However, with judicious use of events such as onload it is probably possible.
Server-side includes are probably the way to go.
Kaled.