浏览器中表尺寸的不同视图 [英] different view of table dimentions in browsers

查看:70
本文介绍了浏览器中表尺寸的不同视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是有关IE和google chrome浏览器中表格尺寸的差异:
我的html代码:

my question is about the difference occurs in table dimensions in IE and google chrome browsers:
my html code :

<tr>
<td colspan="21" width="950" height="284" style="background-color:Black;">
		
	<div id="features" style="overflow: hidden; width: 950px; ">
		<ul style="removed: relative; margin: 0px auto 0px 0px; removed -3px;  width: 950px; removed 0px; height: 288px;">
				<li style="removed: absolute; removed 0px; removed 0px;  display: none; z-index: 3; opacity: 0; width: 950px;">
                    <img src="images/topbanner1.jpg" alt ="" style="height: 288px; width: 950px"/></li>
				<li style="removed: absolute; removed 0px; removed 0px;  display: none; z-index: 2; opacity: 0; width: 950px;">
                    <img src="images/topbanner2.jpg" alt="" style="width: 950px; height: 288px" /></li>
				<li style="removed: absolute; removed 0px; removed 0px;  display: list-item; z-index: 1; opacity: 1; width: 950px;">
                    <img src="images/topbanner3.jpg" style="width: 950px; height: 288px;" alt=""/></li> 
                   
</ul>
</div>

</td>		
<td>
<img src="images/spacer.gif" width="1" height="288" alt=""/></td>
	</tr>



和CSS:



and the css:

#features {
			width: 950px; 
height: 286px; 

/*margin: 0 0 48px 0;
			overflow: scroll; /* Changed to hidden if javascript enabled*/
		}
		#features ul {
				width: 950px; 
				height: 286px; 
			}
			
			#features ul li {
				float:  right;
				width: 950px; 
				height: 286px; 
			}



在IE浏览器中,此td的视图确实为950px
但是当我在谷歌浏览器中查看时,宽度更改为1282px !!!!

请我需要您的帮助来解决我的问题,并知道这种差异背后的原因



the view of this td in IE browser is truly 950px
but when i view it in google chrome the width is change to 1282px!!!!

please i need your help to fix my trouble and know the reason behind this difference

推荐答案

我检查了网站^ ],发现div功能"的宽度为"940px".

因此,不管里面有什么内容以及它在该div中有什么宽度(例如,该div中的ul标签的宽度均为"2820px"),但是该宽度将从包含所有内容的外部div中获取.
因此,宽度将为940像素.

根据 @sarah mm 的评论-
I checked the website http://line25.com/wp-content/uploads/2010/snowboard-design-code/demo/index.html[^] and found that the div "features" has width "940px".

So no matter what content goes inside it and what width it has inside that div (like the ul tag inside this div has width "2820px"), but the width will be taken from outer div which contains all.
So, width will be 940 px.

And as per the comments by @sarah mm -
@sarah mm 写道:

你是对的,我解决了这个问题.宽度变为1282px,因为另一个td尺寸已通过函数调用更改
问题不在此td中.

you are right and i solve the problem. the width became 1282px because of another td dimension altered by function call
the problem not in this td.

感谢 @sarah mm 告诉我您的问题已解决.

非常感谢...

Thanks @sarah mm for updating me that your problem is solved.

Thanks a lot...


U应该使用%值代替pixel.然后它将自动运行.
U should use % value instead pixel.Then it will automatically work.


这篇关于浏览器中表尺寸的不同视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆