我在考虑静态div标签的动态div标签方面遇到了很多问题。这是我目前使用的2种样式:

动态Div标签:

div.Display {
width: 95%;
color: #333333;
margin-left: 360px;
background-color: #333333;
height: 100%;
margin-right: 0px;
float: left;
}


静态Div标签:

div.LoginBox {
box-shadow: 0px 0px 3px 0px #000000;
width: 350px;
height: 350px;
background-color: #F0F0F0;
border: 1px solid #DADADA;
clear: none;
float: left;
color: #000000;
margin-left: 0px;
}


我遇到的问题是动态div标签的尺寸不正确。它考虑了左边距(360像素),但也默认设置为LoginBox div标签的底部(因此,它的顶部距为350像素)。这是Div标签的实际应用:http://ordwurkz.com/

和HTML:

<body onload="FP_preloadImgs(/*url*/'images/hover/minimize.png',/*url*/'images/click/minimize.png')">

<div class="Page" id="Page">

<div class="LoginContainer" id="LoginContainer">
<div id="divLoginTitleBar" class="TitleBar">
    Login
    <div id="divTitleButtonBox" class="TitleButtonBox">

        <img id="LoginMinimize" alt="Button Text" onmousedown="FP_swapImg(1,0,/*id*/'LoginMinimize',/*url*/'images/click/minimize.png')" onmouseout="FP_swapImg(0,0,/*id*/'LoginMinimize',/*url*/'images/minimize.png')" onmouseover="FP_swapImg(1,0,/*id*/'LoginMinimize',/*url*/'images/hover/minimize.png')" onmouseup="FP_swapImg(0,0,/*id*/'LoginMinimize',/*url*/'images/hover/minimize.png')" src="images\minimize.png"/><img id="LoginClose" alt="Button Text" onmousedown="FP_swapImg(1,0,/*id*/'LoginClose',/*url*/'images/click/close.png')" onmouseout="FP_swapImg(0,0,/*id*/'LoginClose',/*url*/'images/close.png')" onmouseover="FP_swapImg(1,0,/*id*/'LoginClose',/*url*/'images/hover/close.png')" onmouseup="FP_swapImg(0,0,/*id*/'LoginClose',/*url*/'images/hover/close.png')" src="images\close.png"/></div>
</div>

<div id="divLoginBox" class="LoginBox">
<div id="divLoginContent" class="LoginContent">

<img alt="System Image" src="images/loginsplash.png" />

<form method="post" action="processor\login_processor.do" id="frmLogin">

    <table id="tblLoginContent" class="LoginContent">
        <tr>
            <td>Username:</td>
            <td>
            <input maxlength="50" name="txtUsrName" size="20" type="text" /></td>
        </tr>
        <tr>
            <td>Password:</td>
            <td>
            <input maxlength="24" name="txtPassword" size="20" type="password" /></td>
        </tr>
        <tr>
            <td><input name="btnLogin" type="submit" value="Login" /></td>
            <td><input name="btnReset" type="reset" value="Reset" /></td>
        </tr>
    </table>
    </form>
</div>
<div class="PlatformVersion">V1.0.0.0</div>
</div>
</div>

<div class="Display"></div>

</div>
<div class="Footer">Contact Us | Terms of Service</div>
</body>

最佳答案

有没有机会将.LoginBox放在.Display内,然后删除.Display上的左边距,以便.LoginBox浮动到.Display内容的左侧?很难说不看您的HTML。

关于css - CSS动态Div标签调整为静态Div标签的问题,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/12964361/

10-10 10:31