HTML CSS examples for CSS Layout:Flex Container
mark up a layout blocks with the CSS property "display:flex;"
<html> <head> <title>Flex</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .container {<!-- www . j a v a 2 s. co m--> width:1100px; height:400px; -webkit-columns: 2; } figure { position:relative; width:300px; height:180px; } figure:first-child { width:600px; height:370px; } figure:first-child figcaption { width:590px; } figure figcaption { position:absolute; z-index:10; bottom:0; left:0; padding:5px; width:290px; background-color:rgba(0,0,0,.3); } </style> </head> <body> <div class="container"> <figure> <img src="https://www.java2s.com/style/demo/Opera.png" alt=""> <figcaption> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </figcaption> </figure> <figure> <img src="https://www.java2s.com/style/demo/Google-Chrome.png" alt=""> <figcaption> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </figcaption> </figure> <figure> <img src="https://www.java2s.com/style/demo/Opera.png" alt=""> <figcaption> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </figcaption> </figure> </div> </body> </html>