简体   繁体   English

IE 6-8 float:left似乎不起作用

[英]IE 6-8 float:left does not seem to work

My site (in dutch) displays correctly on firefox and safari (mac + pc), chrome (mac, pc not tested) but not on IE 6-8 (unavaible for mac). 我的网站 (在荷兰)在Firefox和苹果浏览器(mac + pc),chrome(mac,pc未测试)上正确显示,但在IE 6-8(不适用于mac)上正确显示。 I think I there is something wrong with my div's or css layout but I can't get my finger behind it, And I'm not really an html / css expert. 我认为我的div或CSS布局有问题,但是我无法理解,而且我并不是html / css专家。 I do not have IE currently to test with. 我目前没有要测试的IE。 IE somehow ignores the float:left and moves the second and third column completely to the bottom of the screen, only the upper border is visible. IE以某种方式忽略了float:left并将第二和第三列完全移至屏幕底部,只有上方的边框可见。 What is wrong? 怎么了?

Cheers, Jeroen. 干杯,耶隆。

I think you have to specify a "doctype" for internet explorer to "behave" normally : Something like that should do the trick : 我认为您必须为Internet Explorer指定“文档类型”才能正常“表现”:类似的方法应该可以解决问题:

<!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" xml:lang="en" lang="en">
<head>

Also you might want to consider using a css reset (so that css behave coherently across all browsers ..). 另外,您可能需要考虑使用CSS重置(以便CSS在所有浏览器中的表现都一致。)。 I'm using the one from meyerweb but they are many others. 我正在使用来自meyerweb的产品,但还有很多其他产品。

Also it seems your using a combination of tables AND floating divs. 另外,似乎您使用表和浮动div的组合。 I'm not sure if you really need a float for your design anyway .. you could consider absolute positioning as your layout seems fixed .. 我不知道您是否真的需要浮点数来设计..您可以考虑绝对定位,因为布局看起来是固定的..

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM