CSS高手看一下这个问题,IE6里显示的不正常现象!

来源:百度知道 编辑:UC知道 时间:2024/06/22 20:31:16
代码如下:

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
body{ font-size:12px; line-height:25px; text-align:center;}
.cont{padding:30px; border:1px solid #ccc; width:300px;}
.over{ background:#f0f8ff;}
</style>
</head>

<body>

<div class="cont">
<div style="height:1px;background: url(

<div class="cont">
<div style="height:1px;background: url(
http://hanjiyun.cn/hr.gif) repeat-x; line-height:0; font-size:0;"></div>
<div onMouseOver="this.className='over';" onMouseOut="this.className='';">为什么在IE6里这上边有空白?</div>
</div>
加font-size:0;line-height修改为0