rubyaim
Posts: 757 Joined: 6/22/2005 Status: offline
|
Any iFrame fluid height trickery? - 1/17/2007 18:48:44
Hi all, I've been faffing about with an iFrame on and off for a few days. I'd like to get the height fluid, rather than fixed. Have done countless searches and could not really find anything that worked - the most obvious was setting the height to 100% and the containing div to 100%. Before I give up entirely I thought I'd post here and ask It's probably not really possible. Code below (sorry the page is not live). I'd like the iFrame height to expand and contract when people increase the text size, or if the content to the left increases or decreases. Note - this code is still in 'faffing about' mode and I've removed non-relevant stuff
<!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" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=windows-1252" />
<title>test iframe</title>
<style type="text/css">
body {
font:80% Verdana,Arial,Tahoma,sans-serif;
background:#ffffec;
margin:20px;
padding:0;
}
h1,h2,h3,h4,h5 {
font-size:1.3em;
font-weight:bold;
text-align:left;
margin:0;
padding-left:10px;
}
p {
padding-left:10px;
padding-right:10px;
}
#content {
background:#ffffff;
color:#000;
width:97%;
margin:0 auto;
border: 1px dotted #006600;
padding: 10px;
overflow:hidden;
}
div.contentleft {
width:48%;
float:left;
padding-top:3px;
padding-left:2px;
padding-right:5px;
text-align:left;
margin:0 auto -1px;
}
div.contentright {
float:right;
padding-top:3px;
padding-right:10px;
padding-left:2px;
width:48%;
text-align:left;
}
iframe.randd {
float:right;
border:1px dotted #006600;
width:97%;
/*I would like to set a fluid height on this iframe*/
height:420px;
margin:0;
padding:0;
}
</style>
</head>
<body>
<div id="content">
<!-- pretty header stuff and hor nav list -->
<div class="contentleft">
<h2>Baa, baa, black sheep</h2>
<p>Have you any wool? Yes sir, yes sir, Three bags full;
One for the master, And one for the dame, And one for the little boy Who lives
down the lane. Have you any wool? Yes sir, yes sir, Three bags full; One for the
master, And one for the dame, And one for the little boy Who lives down the
lane.</p>
<h3>Hey, diddle, diddle</h3>
<p>The cat and the fiddle, The cow jumped over the moon. The little dog laughed
To see such sport, And the dish ran away with the spoon. The cat and the fiddle,
The cow jumped over the moon. The little dog laughed To see such sport, And the
dish ran away with the spoon.</p>
<h4>I had a little nut tree</h4>
<p>Nothing would it bear, But a silver nutmeg and a golden pear. The King of
Spain's daughter came to visit me, And all for the sake of my little nut tree. I
skipped over water, I danced over sea, And all the birds in the air couldn't
catch me.</p>
<h5>Cobbler, cobbler</h5>
<p>Mend my shoe. Get it done by half past two. Half past two is much too late!
Get it done by half past eight. Cobbler, cobbler, mend my shoe. Get it done by
half past two. Half past two is much too late! Get it done by half past eight.</p>
</div>
<div class="contentright">
<p>Staff Notices</p>
<iframe frameborder="0" class="randd" name="rdstaffnotes" title="Research and Development Staff Notes List" src="main-intranet">
To view the content of this iFrame go to <a href="main-intranet">Research and Development Staff Notes List</a>
</iframe>
</div>
<!-- Footer -->
</div>
</body>
</html>
_____________________________
Sally
|