,html布局的问题。_html/css_WEB-ITnose

WBOY
Freigeben: 2016-06-24 11:42:38
Original
1787 Leute haben es durchsucht

如何让中间的表格(id=“aaaatttt”),在各种浏览器中,都能自适合高度。

<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta name="GENERATOR" content="Microsoft FrontPage 6.0"><meta name="ProgId" content="FrontPage.Editor.Document"><title>title</title><style>html,body{	margin:0px;	height:100%;}</style></head><body style="overflow:hidden;background:#D6DFFF;"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table1" style="border-collapse: collapse" bordercolor="#C0C0C0" height="100%">	<tr>		<td height="91" >head</td>	</tr>	<tr>		<td height="15" bgcolor="#013961" style="border-top:0px #ffffff solid;border-bottom:0px #4D7373 solid;height:15px;">   			<table border="0" width="100%" cellspacing="0" cellpadding="0">				<tr>					<td style="color:yellow;padding-left:10px;">中华人民共和国</td>					<td style="text-align:right;padding-right:10px;">退出</td>				</tr>			</table>				</td>	</tr>	<tr>		<td style="padding:3px;border:1px #ff0000 solid;" valign="top">			<table id='aaaatttt' border="1" width="100%" height="100%" cellpadding="0" cellspacing="0" style="border-collapse: collapse;height:100%;">				<tr>					<td  bgcolor="#E7EBFF" valign="top" id="leftFrame" style="width:230px;">					left					</td>					<td width="1" style="width:1px;font-size:1px;"> </td>					<td valign="top" >right</td>				</tr>			</table>			</div>		</td>	</tr></table>    </body></html>
Nach dem Login kopieren


回复讨论(解决方案)

宽度和高度的百分比是继承父容器的宽和高,在父容器的宽高没有具体数值的情况下就会显示异常。
我一般都在body里面添加个背景图片,将body撑满整个窗口,这样子元素就可以使用百分比设置了

楼主所谓自适应什么意思???效果看起来很正常。。。

不知楼主到底要的是怎样的呢。。

设置表格的大小百分比

宽度和高度的百分比是继承父容器的宽和高,在父容器的宽高没有具体数值的情况下就会显示异常。
我一般都在body里面添加个背景图片,将body撑满整个窗口,这样子元素就可以使用百分比设置了



我知道会继承,不过,上级无法有固定宽高的情况下,下级如何自适应?

楼主所谓自适应什么意思???效果看起来很正常。。。

不知楼主到底要的是怎样的呢。。



就是这个样子,在chrome中没问题,在IE8中,不能自适应。

就是这个样子,在chrome中没问题,在IE8中,不能自适应。


我的IE是11版的,,,一切正常。。。
那么,,,楼主不妨网上找找看css3、html5的兼容js插件。。。也许能解决你的问题。。。

IE10以下都是浮云……
最好的办法给让body有一个具体的宽高,就是我给你说的,用背景图填充body(这样body就直接得到浏览器的宽和高了),我也试过用js获取屏幕的宽和高的值来设置body大小,这样浏览器打开时不是最大化的时候又该异常了

我的IE是11版的,,,一切正常。。。
那么,,,楼主不妨网上找找看css3、html5的兼容js插件。。。也许能解决你的问题。。。



好吧,真让人崩溃,我再试试吧。



IE10以下都是浮云……
最好的办法给让body有一个具体的宽高,就是我给你说的,用背景图填充body(这样body就直接得到浏览器的宽和高了),我也试过用js获取屏幕的宽和高的值来设置body大小,这样浏览器打开时不是最大化的时候又该异常了



我也想浮云,客户那不认啊,没办法了。用js取吧,异常也没办法。

结贴了。
Verwandte Etiketten:
Quelle:php.cn
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!