如何更改<p> <div>中的<p>位置?</div>

时间:2011-12-29 13:23:52

标签: html

我在<:p>中有一个

标签

#in .css file
div.box {
    width: 50px;
    height: 30px;
}

#in .html file
<div class="box">
    <p>Here</p>
</div>

它看起来像这样:

------------
|          |
|   Here   |
|          |
------------

但我想将<p>放在<div>的底部,如下所示:

------------
|          |
|          |
|   Here   |
------------

如何?

1 个答案:

答案 0 :(得分:8)

添加此

div.box {
    width: 50px;
    height: 30px;
    position:relative;
}
div.box p{
  margin:0;
  padding:0;
  position:absolute;
  bottom:0;
}
相关问题