How to set iframe height 100% or scrollable at out page?
Searching "iframe height 100" in 谷歌!
1、
<
iframe
height
="100%"
>
no work
2、
<
iframe
stlye
="height: 100%;"
>
no work
3、CSS
1
/*** html file ***/
2
3 < p class ="forum2" >
4 < iframe src ="http://mydomain.com/phpbb" title ="Forum" scrolling ="auto" >
5 </ iframe >
6 </ p >
2
3 < p class ="forum2" >
4 < iframe src ="http://mydomain.com/phpbb" title ="Forum" scrolling ="auto" >
5 </ iframe >
6 </ p >
1
/*
** css file **
*/
2
3 ..forum2 {
4 height : 900px ;
5 width : 100% ;
6 }
7
8 IFRAME {
9 min-height : 900px ;
10 height : 100% ;
11 width : 100% ;
12 }
2
3 ..forum2 {
4 height : 900px ;
5 width : 100% ;
6 }
7
8 IFRAME {
9 min-height : 900px ;
10 height : 100% ;
11 width : 100% ;
12 }
4、JavaScript
1
<
script language
=
"
JavaScript
"
>
2 <!--
3 function resize_iframe()
4 {
5 // resize the iframe according to the size of the
6
7 // window (all these should be on the same line)
8
9 document.getElementById( " glu " ).height =
10 document.body.offsetHeight -
11 document.getElementById( " glu " ).offsetTop - 26 ;
12 }
13
14 // this will resize the iframe every
15 // time you change the size of the window.
16 window.onresize = resize_iframe;
17
18 // Instead of using this you can use:
19 // <BODY onresize="resize_iframe()">
20
21
22 // -->
23 </ script >
2 <!--
3 function resize_iframe()
4 {
5 // resize the iframe according to the size of the
6
7 // window (all these should be on the same line)
8
9 document.getElementById( " glu " ).height =
10 document.body.offsetHeight -
11 document.getElementById( " glu " ).offsetTop - 26 ;
12 }
13
14 // this will resize the iframe every
15 // time you change the size of the window.
16 window.onresize = resize_iframe;
17
18 // Instead of using this you can use:
19 // <BODY onresize="resize_iframe()">
20
21
22 // -->
23 </ script >
1
<
iframe id
=
'glu' width
=
100
%
onload
=
'resize_iframe()'
>
2 </ iframe >
2 </ iframe >
5、 用CSS构建iframe效果的四种方法
6、 W3C关于iframe的描述