样式DL作为表格。哦不,IE7浮动DD

时间:2013-03-29 11:50:57

标签: css internet-explorer-7

我有一个已定义的列表。适用于IE7(不关心IE6)的所有内容,其中DD列保留在顶行。谁能告诉我为什么以及如何解决?感谢

<!DOCTYPE html>
<html>
    <head>
        <title>DL Lists</title>
        <style>
            dt,dd { float:left;}
            dt { clear:both;}
        </style>
    </head>
    <body>
        <dl>
            <dt>title for column 2</dt><dd>column 2 value</dd>
            <dt>title for column 2</dt><dd>&nbsp;</dd>
            <dt>title for column 2</dt><dd>column 2 value</dd>
            <dt>title for column 2</dt><dd>column 2 value</dd>
        </dl>
    </body>
</html>

1 个答案:

答案 0 :(得分:0)

<!DOCTYPE html>
<html>
    <head>
        <title>DL Lists</title>
        <style>
            dt { float:left; clear:left; width: 200px;}            
        </style>
    </head>
    <body>
        <dl>
            <dt>title for column 2</dt><dd>column 2 value</dd>
            <dt>title for column 2</dt><dd>&nbsp;</dd>
            <dt>longer title for column 2</dt><dd>column 2 value</dd>
            <dt>title for column 2</dt><dd>longer column 2 value</dd>
        </dl>
    </body>
</html>