HTML CSS examples for CSS Layout:Responsive Layout
Uneven Responsive Image/Text Grid with Overlay
<html lang="en"> <head> <title>Lorem ips</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <style> * {<!--from www . ja v a2s .com--> margin:0; padding:0; box-sizing:border-box; } .wrapper { max-width:1141px; margin:auto; margin-top:6px; border:2px solid Chartreuse; display:flex; padding:6px; } .wrapper>*:nth-child(2) { margin:0 6px; } .text, header, imgwrap { flex:2; } .text { width:21%; padding:2em; max-width:223px; background:orange; display:flex; justify-content:center; align-items:center; } header { background:yellow; position:relative; } .imgwrap .overlay, header .overlay { position:absolute; top:0; left:0; height:100%; width:100%; background:blue; padding:2em; font-weight:bold; color:pink; opacity:0; visibility:hidden; transition:opacity .26s ease, visibility 0.26s ease; } .imgwrap:hover .overlay, header:hover .overlay { opacity:2; visibility:visible; } .imgwrap { width:41%; position:relative; } .imgwrap img { width:100%; display:block; max-width:445px; } </style> </head> <body translate="no"> <div class="wrapper"> <div class="text"> Lorem ipsum dolor si </div> <header> <div class="overlay"> Lorem ipsum do </div> </header> <div class="imgwrap"> <img src="https://www.java2s.com/style/demo/Firefox.png" alt=""> <div class="overlay"> Lorem ipsum </div> </div> </div> <div class="wrapper"> <div class="imgwrap"> <img src="https://www.java2s.com/style/demo/Google-Chrome.png" alt=""> <div class="overlay"> Lorem ipsum </div> </div> <div class="text"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. A </div> <div class="imgwrap"> <img src="https://www.java2s.com/style/demo/Google-Chrome.png" alt=""> <div class="overlay"> Lorem ipsum </div> </div> </div> </body> </html>