Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

single div position using flexbox

I’m trying to make the image div is centered, and bot section stick to bottom.
enter image description here
I also used justify-content: flex-end, but image div does not want to change its position at all

What i try

.box
{
  width: 100px;
  height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
 
}

  .image 
  {
    align-self: center;
    width: 100%;
    height: 40%;
  }

  .bot-section
  {
    width: 100%;
    align-self: flex-end; 
  }
<div class="box">
 <div class="image"></div>
 <div class="bot-section">
    <div class="text"></p></div>
    <div class="progress"></div>
 </div>
</div>

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Just edit your css as follows:

.box
{
  width: 100px;
  height: 100px;
  background-color: rgb(44, 44, 44);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
 
}

  .bot-section {
    width: 100%;
    align-self: flex-end;
    position: absolute;
    bottom:0;
    
  }
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading