代码如下:
1 <body scroll="no" onresize="compute();"> 2 <form id="form1" runat="server"> 3 <div> 4 <table cellpadding="0" cellspacing="0" id="MainTable"> 5 <tr style="height: 162px"> 6 <td> 7 <table cellpadding="0" cellspacing="0" style="width: 100%; height: 100%"> 8 <tr> 9 <td style="background-image: url(images/tdbj.gif); background-repeat: repeat; 10 background-position-x: right;" id="lefttop"> 11 12 </td> 13 <td id="banner" style="width: 990px; height:162px; background-image: url(../../images/mhr/banner.png); background-repeat: no-repeat"> 14 </td> 15 <td style="background-image: url(images/tdbj.gif); background-repeat: repeat; 16 background-position-x: left;" id="righttop"> 17 </td> 18 </tr> 19 </table> 20 </td> 21 </tr> 22 <tr> 23 <td> 24 <table cellpadding="0" cellspacing="0" style="width: 100%; height: 100%"> 25 <tr> 26 <td style="background-image: url(images/tdbj.gif); background-repeat: repeat; 27 background-position-x: right;border-right: #ffdaaf 1px solid;" id="ledttd"> 28 29 </td> 30 31 <td id="MianTD" style="text-align: center"> 32 <div style="width: 100%; height: 100%; overflow:hidden; text-align :center" id="mainDIV"> 33 <iframe id ="reportIframe" style ="width :80%; height :100%" frameborder ="0"></iframe> 34 </div> 35 </td> 36 <td style="background-image: url(images/tdbj.gif); background-repeat: repeat; 37 background-position-x: left; border-left: #ffdaaf 1px solid;" id="righttd"> 38 39 </td> 40 </tr> 41 </table> 42 </td> 43 </tr> 44 <tr style="height: 49px"> 45 <td> 46 <table cellpadding="0" cellspacing="0" style="width: 100%; height: 49px; background-image: url(images/alert18.gif); 47 background-repeat: repeat-x;"> 48 <tr> 49 <td style="border-right-color: #ffdaaf; border-right-width: 1px; border-right-style: solid;background-image: url(images/tdbj.gif); background-repeat: repeat; 50 background-position-x: right;" id="leftbottom"> 51 52 </td> 53 <td id="bottomcenter" style="border-right-color: #ffdaaf; border-right-width: 1px; border-right-style: solid;background-image: url(../../images/bottom.jpg); background-repeat: no-repeat; 54 background-position-x: center"> 55 </td> 56 <td style="background-image: url(images/tdbj.gif); background-repeat: repeat; 57 background-position-x: right;" id="rightbottom"> 58 </td> 59 </tr> 60 </table> 61 </td> 62 </tr> 63 </table> 64 </div> 65 </form> 66 </body>
其中ID为reportIframe的iframe的内容比较多,但是body的高度缺不会因此而变高,导致iframe处的td出现滚动条,请问怎么解决,我想让最外层出现滚动条,table适应iframe的高度。谢谢。
我觉得级别低的不可以决定比它高的元素吧,如果你不想出现滚动条的话你可以让内容的overflow属性显示为hidden,而添加>>more这样的方式。研究web前端没多久希望帮到你。
已经解决了,iframe的高度能决定他的父窗体中td的高度。就你自己回答,豆豆给你了。