0% found this document useful (0 votes)
3 views4 pages

Responsive Image Gallery Example

Uploaded by

razonablejian
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views4 pages

Responsive Image Gallery Example

Uploaded by

razonablejian
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

<!

DOCTYPE html>

<html>

<head>

<style>

[Link] {

border: 1px solid #ccc;

[Link]:hover {

border: 1px solid #777;

[Link] img {

width: 100%;

height: auto;

[Link] {

padding: 15px;

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: 500px) {

.responsive {

width: 100%;

.clearfix:after {

content: "";

display: table;

clear: both;

</style>

</head>

<body>

<center><h2>My simple Gallery</h2></center>

<h4>Resize the browser window to see the effect.</h4>


<div class="responsive">

<div class="gallery">

<a target="_blank" href="C:\Users\Jocelyn\Desktop\jocelyn/[Link]">

<img src="C:\Users\Jocelyn\Desktop\jocelyn/[Link]" alt="DEIA" width="600" height="400">

</a>

<div class="desc">Add a description of the image here</div>

</div>

</div>

<div class="responsive">

<div class="gallery">

<a target="_blank" href="C:\Users\Jocelyn\Desktop\jocelyn/[Link]">

<img src="C:\Users\Jocelyn\Desktop\jocelyn/[Link]" alt="Forest" width="600" height="400">

</a>

<div class="desc">Add a description of the image here</div>

</div>

</div>

<div class="responsive">

<div class="gallery">

<a target="_blank" href="C:\Users\Jocelyn\Desktop\jocelyn/[Link]">

<img src="C:\Users\Jocelyn\Desktop\jocelyn/[Link]" alt="Northern Lights" width="600"


height="400">

</a>

<div class="desc">Add a description of the image here</div>

</div>

</div>
<div class="responsive">

<div class="gallery">

<a target="_blank" href="C:\Users\Jocelyn\Desktop\jocelyn/[Link]">

<img src="C:\Users\Jocelyn\Desktop\jocelyn/[Link]" alt="Mountains" width="600" height="400">

</a>

<div class="desc">Add a description of the image here</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>

</div>

</body>

</html>

You might also like