高分求解Div+CSS问题
<div class= "tb ">
<dl class= "row ">
<dt>
</dt>
</dl>
<dl>
<dl class= "row ">
<dt>
</dt>
</dl>
<dl>
<dl class= "row ">
<dt>
</dt>
</dl>
<dl>
<dl class= "row ">
<dt>
</dt>
</dl>
<dl>
</div>
我用这样的div生成了一个N行的表结构...可是我发现行宽度或者是行间距太大了,不知道有什么办法可以调整?
我试过
div.tb .row
{
height:20px;
text-align:left;
text-indent:1em;
line-height:0px;
}
可是没有效果,在FF下还是老样子,在IE下每行的字都只显示出一半来了...
希望有人给解惑~~谢谢,解决就结贴
[解决办法]
代码错了嘛,怎么连续两个 </dl> <dl> 嘛,
<div class= "tb ">
<dl class= "row ">
<dt>
</dt>
</dl>
<dl class= "row ">
<dt>
</dt>
</dl>
<dl class= "row ">
<dt>
</dt>
</dl>
<dl class= "row ">
<dt>
</dt>
</dl>
</div>
[解决办法]
div.tb .row
{
margin:0;
padding:0;
border:0;
}
[解决办法]
原因在于你line-height:0px;
<div class= "tb ">
<dl class= "row ">
<dt> test1 </dt>
</dl>
<dl class= "row ">
<dt> test2 </dt>
</dl>
<dl class= "row ">
<dt> test3 </dt>
</dl>
<dl class= "row ">
<dt> test4 </dt>
</dl>
</div>
<style type= "text/css ">
div.tb .row {
height:20px;
text-align:left;
text-indent:1em;
}
</style>
[解决办法]
首先你的代码语法有点问题,重复出现dl了,dl的间距是由于margin值的默认属性造成的,可以设置margin:0;就可以了。
<!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=utf-8 " />
<title> 无标题文档 </title>
<style type= "text/css ">
div.tb .row
{
margin:0px;
}
</style>
</head>
<body>
<div class= "tb ">
<dl class= "row ">
<dt> 1
</dt>
</dl>
<dl class= "row ">
<dt> 2
</dt>
</dl>
<dl class= "row ">
<dt> 3
</dt>
</dl>
<dl class= "row ">
<dt> 4
</dt>
</dl>
</div>
</body>
</html>