问题
I have a defined list. Works great with everything but IE7 (don't care about IE6) in which the DD column remains on the top line. Can anyone tell me why and how to fix? Thanks
<!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> </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:
<!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> </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>
来源:https://stackoverflow.com/questions/15702638/style-dl-as-a-table-oh-no-ie7-floats-dd