S
S
SideWest2019-12-15 22:44:14
css
SideWest, 2019-12-15 22:44:14

How to stick a child element to the bottom of the parent?

Please tell me how to press this white thing to the bottom

.main {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 566px;
  height: 456px;
  background-color: #E9B9FF;
  border: 2px solid black;
  transform: translate(-50%,-50%);
  &_contacts {
    background-color: #FFFF;
    opacity: .80;
    width: 566px;
    height: 38px;

  }
}

5df68cffc1d93461379535.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roma Zvarich, 2019-12-15
@SideWest

How to stick a child element to the bottom of the parent?

.main_contacts {
  ...
  position: absolute;
  left: 0;
  bottom: 0;
  ...
}

Working code example on Codepen
.
.
.main {
  ...
  display: flex;
  flex-direction: column;
  ...
}
.main_contacts {
  ...
  margin-top: auto;
  ...
}

Working code example on Codepen

D
Dymok, 2019-12-15
@UnluckySerivelha

to kid

position: absolute;
bottom: 0;
left: 0;
width: 100%;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question