How to change the <p> position inside the <div>?

I got a tag

inside:

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

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

and looks like this:

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

but I want to put <p>below <div>, for example:

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

How?

+5
source share
1 answer

add this

div.box {
    width: 50px;
    height: 30px;
    position:relative;
}
div.box p{
  margin:0;
  padding:0;
  position:absolute;
  bottom:0;
}
+8
source

All Articles