Bootstrap 4 Vertical Align Between 2 Divs - Flex

后端 未结 1 1067
遇见更好的自我
遇见更好的自我 2021-01-26 00:03

I\'m trying connect 2 divs in one main div with same height, first div has slider(caroseul), second div has some img and text. I want to keep second divs images same with first

相关标签:
1条回答
  • 2021-01-26 01:07

    Since flexbox items will be the same as the height of the tallest, the only way to do this with a flexbox row is to absolute position the content in the "taller" div...

    Flexbox height of shortest column

       <div class="col-md-4 col-xl-4 b overflow-auto">
                <div class="position-absolute">
                    <a href="#">
                        <div class="list-group">
                            <li class="media">
                                <img src="https://via.placeholder.com/100" class="img-fluid">
                                <div class="media-body">List-based media object</div>
                            </li>
                        </div>
                    </a>
                    <a href="#">
                        <div class="list-group">
                            <li class="media">
                                <img src="https://via.placeholder.com/100" class="img-fluid">
                                <div class="media-body">List-based media object</div>
                            </li>
                        </div>
                    </a>
                    <a href="#">
                        <div class="list-group">
                            <li class="media">
                                <img src="https://via.placeholder.com/100" class="img-fluid">
                                <div class="media-body">List-based media object</div>
                            </li>
                        </div>
                    </a>
                    <a href="#">
                        <div class="list-group">
                            <li class="media">
                                <img src="https://via.placeholder.com/100" class="img-fluid">
                                <div class="media-body">List-based media object</div>
                            </li>
                        </div>
                    </a>
                    <a href="#">
                        <div class="list-group">
                            <li class="media">
                                <img src="https://via.placeholder.com/100" class="img-fluid">
                                <div class="media-body">List-based media object</div>
                            </li>
                        </div>
                    </a>
                </div>
            </div>
    

    https://codeply.com/go/gwrLQVU4VS

    0 讨论(0)
提交回复
热议问题