移动其他DIV标签时DIV标签移动

时间:2014-04-22 12:10:25

标签: asp.net css html

我遇到的问题是,当我移动DIV标签时,另一个DIV标签会自动移动,这也是我不想要的。

这是我现在屏幕上的图片:

enter image description here

标签,文本框位于1 DIV标记内,框图像是另一个DIV标记的背景,该按钮具有另一个DIV标记。

这是我的HTML代码:

<div id="LoginBox" style="background-image: url(Image/LoginBox_v2.png); background-repeat:no-repeat; height: 500px; width: 500px;">

        <div id="Information">
                <asp:Label ID="lbl_Username" runat="server" Text="Username:"/>
            <br />
                <asp:TextBox runat="server" ID="tb_Username"/> 
            <br />
            <br />
                <asp:Label ID="lbl_Password" runat="server" Text="Password:" />
            <br />
                <asp:TextBox runat="server" ID="tb_Password" TextMode="Password" />

     <div id="container">
        <a href="bHomePage.aspx" class="button" id="buttonlogin">
            Login
            <span class="icons button" />
        </a>
     </div>
     </div>   

我希望能够将Information DIV标记向下移动到合适的位置,但是当我尝试设置CSS时,另一个DIV标记LoginBox向下移动吗

这是我目前所有DIV标签的CSS:

#LoginBox {
margin-left: 35%;
margin-top: 0%;

}

#Information {
margin-left: 0%;
margin-top: 0%;
height: 460px;
}

#container {
margin-left: 0%;
width: 125px; 
}

一些CSS显示0%,因为当它不起作用时我回到了0%。我也尝试将所有对象分开移动,但这也不起作用?

1 个答案:

答案 0 :(得分:1)

尝试添加      溢出:自动; 进入你的父div,你的代码是LoginBox。

此处更好地提及完整代码。因为有3次潜水打开但只有2次关闭。希望你有其他人关闭一些商品。 GL!

相关问题