请教CSS布局在IE中出现的问题

html-css06

请教CSS布局在IE中出现的问题,第1张

我没去看你的效果是怎么样的

你加2个样式

body{

margin:0

padding:0

}

.clear{

clear:both

height:1px

margin-top:-1px

overflow:hidden

}

在最后一个</div>前面加上一个 清除浮动的div

代码为 <div class="clear"></div>

记得 一旦有浮动都要清除!!!

还有问题的话 去搜索“IE 3pxBUG”看看

不同的浏览器,比如IE 6,IE7,Mozilla Firefox等,对CSS的解析认识不一样,因此会导致生成的页面效果不一样,得不到我们所需要的页面效果。

至于你说的360浏览器,是基于IE内核的,也就是说在IE基础上加了一些功能,本质上来说还是IE,所以不同机器虽然360浏览器版本相同,其实还是因为IE版本不同引起的。

这个时候我们就需要针对不同的浏览器去写不同的CSS,让它能够同时兼容不同的浏览器,能在不同的浏览器中也能得到我们想要的页面效果。

参看css hack

http://baike.baidu.com/view/1119452.htm?fromenter=csshack

css是没办法了。不过html可以做到

一下是ktml的代码

<!--[if lt IE 7 ]><link href="你的css" rel="stylesheet" type="text/css" /><![endif]--><!--ie7以下有效,也就是ie6-->

<!--[if IE 7 ]><link href="你的css" rel="stylesheet" type="text/css" /><![endif]--><!--仅ie7有效-->

<!--[if IE 8 ]><link href="你的css" rel="stylesheet" type="text/css" /><![endif]--><!--仅ie8有效-->

<!--[if IE 9 ]><link href="你的css" rel="stylesheet" type="text/css" /><![endif]--><!--仅ie9有效-->

<!--[if (gt IE 9)|!(IE)]><!--><link href="你的css" rel="stylesheet" type="text/css" /><!--<![endif]--><!--非ie浏览器-->