重启后如何防止DIV改变位置?

时间:2014-01-20 08:38:53

标签: html css webforms

我有疑问。我创建了我的第一个WebForms应用程序。现在我正在创建Site.Master (工具栏)。所以我从DevExpress控件编写Menu,没有改变Site.css中的任何内容,我有一些我无法理解的东西。

当我通过Chrome运行项目时,我的工具栏看起来像:

[div class float-left] [div class float-left] [div class float-right]

但是当我重新启动PC,再次运行项目(编译)时,我的工具栏看起来像:

[div class float-left] [div class float-right]

[div class float-left]

我必须从Chrome中删除我的缓存,然后一切正常。

这是Site.Master的代码:

        <div class="float-right">
            <dx:ASPxMenu ID="ASPxLogin" runat="server" Theme="Moderno" Font-Size="Small" Cursor="pointer" ShowAsToolbar="True">
                <Paddings PaddingLeft="3px" PaddingRight="3px" />
                <Items>
                    <dx:MenuItem Text="0" Enabled="False">
                        <Image Url="~/Images/Controls/btn-profile-black.png" UrlHottracked="~/Images/Controlsbtn-profile-white.png" UrlDisabled="~/Images/Controls/btn-profile-grey.png" />
                        <ItemStyle BackColor="Aqua" Font-Size="Small"></ItemStyle>
                    </dx:MenuItem>
                    <dx:MenuItem Text="A">
                        <Image Url="~/Images/Controls/btn-off-white.png" UrlDisabled="~/Images/Controls/btn-off-grey.png">
                        </Image>
                        <ItemStyle BackColor="#E06666" ForeColor="White">
                            <HoverStyle BackColor="#970000">
                            </HoverStyle>
                        </ItemStyle>
                    </dx:MenuItem>
                </Items>
            </dx:ASPxMenu>
        </div>

    <div class="float-left">
        <dx:ASPxMenu ID="ASPxMenu" runat="server" Theme="Moderno" Font-Size="Small" Cursor="pointer" ShowAsToolbar="True">
            <Paddings PaddingLeft="3px" PaddingRight="3px" />
            <Items>
                <dx:MenuItem Text=" ">
                    <Image Url="~/Images/logo.jpg" Height="32px"></Image>
                    <ItemStyle BackColor="White">
                        <HoverStyle BackColor="White">
                        </HoverStyle>

                    </ItemStyle>
                    <SubMenuStyle BackColor="#CC0000" />
                </dx:MenuItem>
                <dx:MenuItem Text="B">
                    <Image Url="~/Images/Controls/btn-home-black.png" UrlDisabled="~/Images/Controls/btn-home-grey.png" UrlHottracked="~/Images/Controls/btn-home-white.png" />

                    <ItemStyle BackColor="Aqua">

                        <HoverStyle BackColor="Black">
                        </HoverStyle>
                    </ItemStyle>

                </dx:MenuItem>
            </Items>
        </dx:ASPxMenu>
    </div>

    <div class="float-left">
        <dx:ASPxMenu ID="ASPxMenu1" runat="server" Theme="Moderno" Font-Size="Small" Cursor="pointer" ShowAsToolbar="True">
            <Paddings PaddingLeft="3px" PaddingRight="3px" />
            <Items>
                <dx:MenuItem Text="C" BeginGroup="True">
                    <Image Url="~/Images/Controls/btn-view-black.png" UrlDisabled="~/Images/Controls/btn-view-grey.png" UrlHottracked="~/Images/Controls/btn-view-white.png">
                    </Image>
                    <ItemStyle BackColor="Aqua">

                        <HoverStyle BackColor="Black">
                        </HoverStyle>
                    </ItemStyle>
                </dx:MenuItem>
                <dx:MenuItem Text="F">
                    <Image Url="~/Images/Controls/btn-add-black.png" UrlDisabled="~/Images/Controls/btn-add-grey.png" UrlHottracked="~/Images/Controls/btn-add-white.png">
                    </Image>
                    <ItemStyle BackColor="#B6D7A8">
                        <HoverStyle BackColor="#009900">
                        </HoverStyle>

                    </ItemStyle>
                </dx:MenuItem>
                <dx:MenuItem Text="R">
                    <Image Url="~/Images/Controls/btn-bin-white.png" UrlDisabled="~/Images/Controls/btn-bin-grey.png">
                    </Image>
                    <ItemStyle BackColor="#E06666" ForeColor="White">
                        <HoverStyle BackColor="#970000">
                        </HoverStyle>

                    </ItemStyle>
                </dx:MenuItem>
            </Items>
        </dx:ASPxMenu>
    </div>

这是Site.css的代码:

header, footer, hgroup,
nav, section {
    display: block;
}

mark {
    background-color: #a6dbed;
    padding-left: 5px;
    padding-right: 5px;
}

.float-left {
    float: left;
}

.float-right {
    float: right;
}

0 个答案:

没有答案