Ajwad Ibrahim Ajwad Ibrahim - 3 months ago 11
CSS Question

iframe menu using html

hi i want to make a menu on the side using iframe

below are my code, can anyone guide me, the display looks very weird.

<!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" lang="EN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My Page</title>
<style type="text/css">
html
{
overflow: auto;
}
html, body, div, iframe
{
margin: 0px;
padding: 0px;
height: 100%;
border: none;
}
iframe
{
display: block;
width: 100%;
border: none;
overflow-y: auto;
overflow-x: hidden;
}
</style>
</head>
<table>
<tr>
<td>
This is the Menu
</h2>
<br>
<!--
#######################
the links to the iframe use the iframe name as the TARGET
####################### -->
<a href="http://archive.ncsa.illinois.edu/primer.html" target="iframe1">
Page 1
</a>
<br>
<a href="http://www.w3schools.com/cssref/pr_text_color.asp" target="iframe1">
Page 2
</a>
<br>
<a href="http://www.w3schools.com/colors/colors_picker.asp" target="iframe1">
Page 3
</a>
<br>
</td>
<td width="150" valign="left">
<p align="right">
<body>

<iframe id="tree" name="iframe1" src="http://www.agoogleaday.com/#date=2012-03-27" frameborder="0" marginheight="0" marginwidth="0" width="100%" height="100%" scrolling="no" allowTransparency="true"</iframe>
</tr>
</table>
</body>
</html>


the output of this code look like this

enter image description here

the menu looks ok, but the content are very small, how do i make it fill all the window?

Answer

I am not sure what are you looking for but you can increase width and height of iframe

html 
{
 overflow: auto;
}
html, body, div, iframe 
{
 margin: 0px; 
 padding: 0px; 
 height: 100%; 
 border: none;
}
iframe 
{
 display: block; 
 width: 100%; 
 border: none; 
 overflow-y: auto; 
 overflow-x: hidden;
  height:800px;
}
table{
  width:100%;
  table-layout:fixe;
  }
<!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" lang="EN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My Page</title>

</head>
<table>
<tr>
<td style="width:20%;">
This is the Menu

<br>
<!--
#######################
the links to the iframe use the iframe name as the TARGET
####################### -->
<a href="http://archive.ncsa.illinois.edu/primer.html" target="iframe1">
Page 1
</a>
<br>
<a href="http://www.w3schools.com/cssref/pr_text_color.asp" target="iframe1">
Page 2
</a>
<br>
<a href="http://www.w3schools.com/colors/colors_picker.asp" target="iframe1">
Page 3
</a>
<br>
</td>
<td  style="width:80%;">



<iframe id="tree" name="iframe1" src="http://www.agoogleaday.com/#date=2012-03-27" scrolling="no" allowTransparency="true"</iframe>
</tr>
</table>
</body>
</html>

Comments