Align div in footer inside another div

Asked

Viewed 9,081 times

2

I have a DIV content that includes another called Images, I would like div images to be at the bottom of div content with a certain space that I could define, ex: 400px, but this happens:

inserir a descrição da imagem aqui

I’d like to keep it that way:

inserir a descrição da imagem aqui

Code structure:

<div id="content">

<p>TEXTO TEXTO</p>
     <div id="images"></div>

</div>

1 answer

3


It is basically necessary to define the main div with the position: relative and div daughter position: absolute, the rest is edit the way you need. Follow the example:

text

  #content {
    position: relative;
    min-height: 150px;
    width: 100px;
    background: black;
    color: white;
  }
  #images {
    position: absolute;
    background: red;
    width: 80%;
    height: 20%;
    bottom: 0;
    margin-left: 10px;
    margin-bottom: 5px;
  }
<div id="content">
  <span>texto texto texto</span>
  <div id="images"></div>
</div>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.