javascript - css problem, how to align the container in the div bottom
大家讲道理
大家讲道理 2017-05-19 10:27:21
0
6
778

As shown in the picture, 3 p, how to set 2, 3 is aligned to the bottom in 1; when 3 is hidden, 2 will fall to align to the bottom

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(6)
给我你的怀抱

2 and 3 then wrap a 4. How can this 4 be absolutely positioned at bottom 0? Inside this 4, 2 and 3 are in a document stream that is wrapped by itself. If 3 is not there, then 2 can support this 4. Is this consistent?

给我你的怀抱

Write logical judgment in js. When 3 is hidden, the positioning top of 2 becomes the positioning top of 3. Ordinary document flow cannot realize automatic drop because the document flow is from left to right and top to bottom. The premise of this situation is that when the height of box 1 is fixed

过去多啦不再A梦

If your 1 is a parent box, then the two 3's inside are subset boxes. You only need to give the height of 2 and 3 or the content inside to support them, and then they can be hidden as 3. When the time comes, you can naturally move it down

仅有的幸福

Use flex

PHPzhong

Try flex layout?
http://www.ruanyifeng.com/blo...

洪涛

flex layout

{
flex-direction:  column-reverse;
justify-content: flex-start;
align-items: center;
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template