Solved

iFrame CSS height as percent parameters in IE

Posted on 2010-11-20
2
666 Views
Last Modified: 2012-06-21

Hello Experts,

I'm working with I frames for the first time.  Is there a way to make the css style height:100% work with IE?  It works fine with Chrome and I assume with Firefox.  In IE the height parameter is ignored and the content displays short with scroll bars.

Any ideas on how to get around this without having to use a height in pixels.  The content in the ifraBody will change whenever a navbutton is pressed.

Thanks
<style type="text/css">



.container {

	background-color:#D9CB78;

	border:none;	

	padding:0px, 0px, 0px, 0px;

	margin:0px,0px,0px,0px;

}



.header {

	background-color:#D9CB78;

	border:none;	

	padding:0px, 0px, 0px, 0px;

	margin:0px,0px,0px,0px;

}



.sidebar1 {

	background-color:#D9CB78;

	border:none;	

	padding:0px, 0px, 0px, 0px;

	margin:0px,0px,0px,0px;

}



.content {

	background-color:#D9CB78;

	border:none;	

	padding:0px, 0px, 0px, 0px;

	margin:0px,0px,0px,0px;



}



.footer {

	background-color:#D9CB78;

	border:none;	

	padding:0px, 0px, 0px, 0px;

	margin:0px,0px,0px,0px;

}



#ifraHeader {

	height: 205px;

	width: 920px;

	padding:0px, 0px, 0px, 0px;

	margin:0px,0px,0px,0px;

	background-color:#D9CB78;

	border:none;



}

#ifraNav {



	float:left;

	/* height:1000px; */

	height:100%;

	width: 220px;

	padding:0px, 0px, 0px, 0px;

	margin:0px,0px,0px,3px;

	overflow:auto;

	background-color:#D9CB78;

	border:none;



	}

#ifraBody {

	float:right;

	width:700px;

	/* height:1000px; */ 

	height:100%; 

	padding:0px, 0px, 0px, 0px;

	margin:0px,0px,0px,0px;

	overflow:auto;

	color:#673723;

	background-color:#D9CB78;

	border:none;



}

</style>





</head>



<body bgcolor="#D9CB78">



<div class="container">

  <div class="header">

  <iframe id="ifraHeader" frameborder="0" name="ifraHeader" src="mainHeader.htm"></iframe>

  <hr />

  </div>

    

  <div class="sidebar1">

    <iframe id="ifraNav" frameborder="0" name="ifraNav" src="mainNavbar.htm"></iframe>

    <!-- end .sidebar1 -->

<br />

  </div>

    

  <div class="content">

  

      <iframe id="ifraBody" frameborder="0" name="ifraBody" src="welcome.htm"></iframe>



  <!-- end .content --></div>

    

  <div class="footer">

    <p>&nbsp;</p>

    <!-- end .footer --></div>

  <!-- end .container --></div>

</body>

</html>

Open in new window

0
Comment
Question by:Waterstone
2 Comments
 
LVL 7

Accepted Solution

by:
armchang earned 500 total points
ID: 34180576
Hi,

There's a few reasons leading to this situation. First, you might need to put <iframe> out of <div> tags at it would limit it's height also. Second, you might need to use position:absolute; if you want to use <div> as height:100%; will work correctly in it and you also have to remove the float in it and replace with the top and left to reposition it correctly like this:

<style type="text/css">
#ifraNav {
position:absolute;
height:100%;
width: 220px;
padding:0px, 0px, 0px, 0px;
margin:0px,0px,0px,3px;
overflow:auto;
background-color:#D9CB78;
border:none;

}
#ifraBody {
position:absolute;
left:250px;
width:600px;
height:100%; 
padding:0px, 0px, 0px, 0px;
margin:0px,0px,0px,0px;
overflow:auto;
color:#673723;
background-color:#D9CB78;
border:none;
}
</style>

Open in new window


How'd it went?
0
 

Author Closing Comment

by:Waterstone
ID: 34181491
Thank you. Works well.  Now on to the next inter-browser issue :-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Send Mail Via SMTP Replacement/Rework 11 61
Add css and js to MVC Project not in project 9 27
CSS z-index issue 3 22
hosting images 4 6
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now