HTML CSS examples for CSS Layout:Responsive Layout
Keep two columns equal height with jQuery on a responsive design site
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> * {<!--from w w w. j a va2 s . c o m--> margin:0; padding:0; } .container { display:table; table-layout:fixed; width:100%; height:100%; border:2px solid Chartreuse; box-sizing:border-box; } .container-ele { display:block; padding:11px; box-sizing:brder-box; vertical-align:top; } .content { background:yellow; } img { display:block; float:left; width:100%; background:red; margin:2% 0; } @media(min-width: 320px) { .container-ele { display:table-cell; } } </style> </head> <body> <div class="container"> <div class="container-ele"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque, ornare vitae tempor hendrerit, luctus at neque. Phasellus sed quam pharetra, tincidunt tortor in, pharetra nisl. Maecenas aliquam luctus mauris, vitae venenatis diam imperdiet vel. Donec tortor diam, pretium vitae nibh vitae, consectetur lacinia sem. Proin luctus facilisis volutpat. Ut se</p> <img src="https://www.java2s.com/style/demo/Safari.png" class="box-preview"> </div> <div class="container-ele"> <img src="https://www.java2s.com/style/demo/InternetExplorer.png" class="box-preview"> <img src="https://www.java2s.com/style/demo/Safari.png" class="box-preview"> </div> </div> </body> </html>