I have a problem similar to that described here (without permission):
IE7 float and clear the same element
The following HTML is displayed in Firefox, but not in IE7 and IE8:
<html>
<head>
<style>
ul {
list-style-type: none;
}
li {
clear: both;
padding: 5px;
}
.left {
clear: left;
float: left;
}
.middle {
clear: none;
float: left;
}
.right {
clear: right;
float: left;
}
</style>
</head>
<body>
<ul>
<li>1</li>
<li class="left">2</li>
<li class="right">3</li>
<li class="left">4</li>
<li class="middle">5</li>
<li class="right">6</li>
<li>7</li>
</ul>
</body>
</html>
This is the layout of the form, and in Firefox the results are as follows:
1
2 3
4 5 6
7
What I'm going to. However, in IE7 and IE8 the results are:
1
2 3 5 6
4
7
[Note. I don’t want to float anything to the right, because I want the fields in my form to align correctly to the left, without the gigantic space between the floating fields to account for the width of the parent container.]
Apparently, I need to completely clear and possibly add to the list an empty element of the list of elements for forced cleaning, but this seems like a dumb solution and a kind of purpose.
? .