This is an old revision of the document!
==== Play ===== <html> <head> <style> div.img { border: 1px solid #ccc; } div.img:hover { border: 1px solid #777; } div.img img { width: 100%; height: auto; } div.desc { padding: 10px; text-align: center; } * { box-sizing: border-box; } .responsive { padding: 0 6px; float: left; width: 24.99999%; } @media only screen and (max-width: 700px){ .responsive { width: 49.99999%; margin: 6px 0; } } @media only screen and (max-width: 800px){ .responsive { width: 100%; } } .clearfix:after { content: ""; display: table; clear: both; } </style> </head> <body> <h2>Responsive Image Gallery</h2> <h4>Resize the browser window to see the effect.</h4> <div class="responsive"> <div class="img"> <a target="_blank" href="http://192.168.1.22/dokuwiki/doku.php?id=wolfcom_wiki:vision:external_devices"> <img src="http://192.168.1.22/dokuwiki/lib/exe/fetch.php?media=wolfcom_wiki:external_devices:ddstation.jpg" alt="ddstation" width="800" height="600"> </a> <div class="desc"><b>Vision Docking Station</b></div> </div> </div> <div class="responsive"> <div class="img"> <a target="_blank" href="http://192.168.1.22/dokuwiki/doku.php?id=wolfcom_wiki:vision:external_devices"> <img src="http://192.168.1.22/dokuwiki/lib/exe/fetch.php?media=wolfcom_wiki:vision:4_hour_battery_pack_thin.jpg" alt="4 hour battery pack" width="800" height="600"> </a> <div class="desc"><b> 4 Hour Battery Pack</b></div> </div> </div> <div class="responsive"> <div class="img"> <a target="_blank" href="ihttp://192.168.1.22/dokuwiki/doku.php?id=wolfcom_wiki:vision:external_devices"> <img src="http://192.168.1.22/dokuwiki/lib/exe/fetch.php?media=10440thin.jpg" alt="Northern Lights" width="600" height="400"> </a> <div class="desc"><b>10400 Battery Pack</b></div> </div> </div> <div class="responsive"> <div class="img"> <a target="_blank" href="ihttp://192.168.1.22/dokuwiki/doku.php?id=wolfcom_wiki:vision:external_devices"> <img src="http://192.168.1.22/dokuwiki/lib/exe/fetch.php?media=4combothin.jpg" alt="Mountains" width="600" height="400"> </a> <div class="desc"><b>Head/Eye Vision Series</b></div> </div> </div> <div class="clearfix"></div> <div style="padding:6px;"> <p>This example use media queries to re-arrange the images on different screen sizes: for screens larger than 700px wide, it will show four images side by side, for screens smaller than 700px, it will show two images side by side. For screens smaller than 500px, the images will stack vertically (100%).</p> <p>You will learn more about media queries and responsive web design later in our CSS Tutorial.</p> </div> </body> </html>