读书人

一个CSS+DIV的有关问题

发布时间: 2012-02-14 19:19:19 作者: rapoo

一个CSS+DIV的问题
这是CSS:
<style type= "text/css ">

.logintb dt
{
float:left;
margin:5px;
}
.logintb dl
{
width: 250px;
float:left;
margin:1px;
}
.logintb .managehead
{
margin:0px;
width:250px;
background: transparent url( "../image/guide_mid.png ") repeat-x;
}
.logintb .colhead
{
width:50px;
text-align:right;
}
.logintb .input
{
margin: 0;
padding: 2px;
width:150px;
border:1px solid #369;
}
.logintb
{
border: 1px solid #369;
background: transparent url( "../image/bg_newslist.png ") repeat-y;
width:250px;
}
</style>
-----------------------------------------------------------
这是DIV
<div class= "logintb ">
<dl>
<dt class= "managehead ">
登陆 </dt>
</dl>
<dl>
<dt class= "colhead "> 用户名: </dt>
<dt>
<input class= "input " id= "account " maxlength= "20 " size= "18 " onkeydown= "defaultEnterBtn(event) "/>

</dt>
</dl>
<dl>
<dt class= "colhead "> 密码: </dt>


<dt>
<input class= "input " id= "password " type= "password " onkeydown= "defaultEnterBtn(event) " /> </dt>
</dl>
<dl>
<dt class= "colhead "> 验证码: </dt>

<dt> <input class= "input " id= "verify " type= "text " onkeydown= "defaultEnterBtn(event) " /> </dt> </dl>
<dl>
<dt> <img id= "verifyimg " src= "../Verify.aspx " alt= "验证码 " onclick= "changeimg() "/> 点击图片改变验证码

</dt>
</dl>
<dl>
<dt>
</dt>
<dt>
  <input id= "log " type= "button " value= "登陆 " onclick= "javascript:login(); " disabled= "disabled "/>
<input id= "bak " type= "button " value= "返回 " onclick= "javascript:history.back(); " /> </dt>
</dl>
</div>



但是不知道为什么,在VS的设计试图里看的是正常的,而运行了之后出来的DIV却没有边框(边框缩到顶上了...),也没有背景的(背景图片路径正确)

[解决办法]
在这个DIV外面再套一层DIV B,设置B的border
[解决办法]
.logintb加个float:left;

读书人网 >CSS

热点推荐