日期:2014-05-17  浏览次数:20798 次

为什么一加a标签,布局就错位
HTML code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
<head>
<title>测试a标签</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<style type="text/css">
* {
    margin:0;
    padding:0;
    border:0;
}
#container {
    width:990px;
    height:370px;
    margin:auto;
}
#hot {
    width:990px;
    height:370px;
    background:blue;
}
#ad {
    float:left;
    width:330px;
    height:370px;
}
#exceting {
    float:left;
    width:391px;
    height:370px;
}
#right-bar {
    float:right;
    width:250px;
    width:370px;
}
</style>
</head>
    <body>
        <div id="container">
            <div id="hot">
                    <div id="ad">
                        <a id="ad-a" href="#"><a>
                    </div>
                    <div id="exceting">
                        <div id="cell1"><a href="#">ww</a></div>
                        <div id="cell2">ss</div>
                    </div>
                    <div id="right-bar">
                        <div id="right-top">
                            
                        </div>
                        <div id="right-bottom"></div>
                    </div>
            </div>
        </div>
    </body>
</html>


只要加上<a href="#">ww</a>,布局立马就错位,找了好久了,望高手解惑!!!
ps:主要是在ie上错位,火狐的、chrome,safari都很正常

------解决方案--------------------
<a id="ad-a" href="#"></a>
这个a结束标签没加/