ie7 толкает поплавки - PullRequest
       19

ie7 толкает поплавки

0 голосов
/ 21 января 2011

У меня проблема с ie7. В Firefox и IE8 все работает нормально.

В ie7 первый элемент работает нормально, но все остальные толкаются, как будто они применены для очистки.

изображение изображает это лучше всего.

alt text

Вот код.

.newLabellg 
{
    float:left; 
    width:66px; 
    margin:3px 0 0 0;
    font-weight:bold;
    color:#000;
}


<div style="float:left; width:320px;">

    <div style="margin-bottom:10px; float:left;">
        <div class="newLabellg">Cusotmer#:</div>
        <div style="float:left;">
        <asp:TextBox ID="CustomerNumber" runat="server" Width="220px"></asp:TextBox>
        </div>
    </div>

    <div style="margin-bottom:10px; float:left; clear:both;">
        <div class="newLabellg">Cusotmer:</div>
        <div style="float:left;">
        <asp:TextBox ID="CustomerName" runat="server" Width="220px"></asp:TextBox>
        </div>
    </div>

    <div style="margin-bottom:10px; float:left; clear:both;">
        <div class="newLabellg" style="float:left;">Address:</div>
        <div style="float:left;">
        <asp:TextBox ID="Address" runat="server" Width="220px"></asp:TextBox>
        </div>
    </div>

    <div style="margin-bottom:10px; float:left; clear:both;">
        <div class="newLabellg">Mailing Address:</div>
        <asp:TextBox ID="Address2" runat="server" Width="220px"></asp:TextBox>
        <div style="float:left; margin:3px 0 0 0">
        <asp:DropDownList ID="City" runat="server" Width="109px">
        </asp:DropDownList>
       <asp:DropDownList ID="Province" runat="server" Width="109px">
        </asp:DropDownList></div>

    </div>
</div>

Любая идея, почему / что ie7 делает и как я могу это исправить?

Ответы [ 2 ]

2 голосов
/ 21 января 2011

Простое удаление clear: both из каждого экземпляра:

<div style="margin-bottom:10px; float:left; clear:both;">

сделало его корректным в браузерах, с которыми я тестировал: IE7 / 8 + Firefox.

При удалении clear: both вызывает другую проблему, дайте нам знать, и мы можем найти обходной путь.

1 голос
/ 21 января 2011

Я собирался сказать, что единственный логический вывод состоит в том, что clear:both вызывает проблемы - потому что это единственный стиль, которого нет у первого элемента.

float + clear на одном элементе вызывает необычные аномалии в IE7.

http://www.brunildo.org/test/IEWfc3.html

...