Page 168 - CSS
P. 168

Here is a demo.


        Same height on nested containers


        This code makes sure that all nested containers are always the same height. This is done by
        assuring that all nested elements are the same height as the containing parrent div. See working
        example: https://jsfiddle.net/3wwh7ewp/

        This effect is achieved due to the property align-items being set to stretch by default.


        HTML


         <div class="container">
           <div style="background-color: red">
             Some <br />
             data <br />
             to make<br />
             a height <br />
          </div>
           <div style="background-color: blue">




        https://riptutorial.com/                                                                             146
   163   164   165   166   167   168   169   170   171   172   173