Expanding Photo Stack

Size
2,083 Kb
Views
54,648

How do I make an expanding photo stack?

Expanding photo stack made in pure CSS.. What is a expanding photo stack? How do you make a expanding photo stack? This script and codes were developed by Miro Karilahti on 07 July 2022, Thursday.

Expanding Photo Stack Previews

Expanding Photo Stack - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Expanding Photo Stack</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <h1><div>Expanding</div>Photo Stack</h1>
<div id="imgstack"> <a href="#"><img src="http://lorempixel.com/300/250/animals/1/" alt /></a> <a href="#"><img src="http://lorempixel.com/300/250/animals/2/" alt /></a> <a href="#"><img src="http://lorempixel.com/300/250/animals/3/" alt /></a>
</div> <script src="js/index.js"></script>
</body>
</html>

Expanding Photo Stack - Script Codes CSS Codes

/*Simple CSS-reset that removes margin and padding from every element*/
*{margin:0;padding:0;}
body{ background:#346; font-family:Arial,sans-serif; color:#f0f0f0;
}
h1{ margin-top:3%; font-size:320%; text-align:center;
}
h1 div{ font-size:60%; font-weight:700; text-align:center; line-height:24px; color:#c0c0c0;
}
/*The actual photo stack starts here*/
#imgstack{ width:300px; margin:0 auto; margin-top:2%;
}
#imgstack a{ width:288px; height:200px; position:absolute; display:block; border:6px solid #f0f0f0; border-radius:2px; box-shadow:0 0 10px rgba(0,0,0,.3); transition:margin .5s; -webkit-transition:margin .5s;
}
#imgstack img{ width:288px; max-height:100%;
}
#imgstack a:first-of-type{ margin-top:-5px; margin-left:-20px; z-index:2; transform:rotate(-3deg); -webkit-transform:rotate(-3deg);
}
#imgstack a:nth-of-type(2){ margin-top:-5px; margin-left:-10px; z-index:1;
}
#imgstack a:last-of-type{ transform:rotate(3deg); -webkit-transform:rotate(3deg);
}
#imgstack:hover a:first-of-type{ margin-left:-310px; margin-top:5px;
}
#imgstack:hover a:nth-of-type(2){margin-top:-5px;}
#imgstack:hover a:last-of-type{ margin-left:290px; margin-top:5px;
}
#imgstack a:first-of-type:hover,#imgstack a:last-of-type:hover{margin-top:-5px;}
#imgstack a:nth-of-type(2):hover{margin-top:-10px;}

Expanding Photo Stack - Script Codes JS Codes

/* No JavaScript! */
Expanding Photo Stack - Script Codes
Expanding Photo Stack - Script Codes
Home Page Home
Developer Miro Karilahti
Username miroot
Uploaded July 07, 2022
Rating 4.5
Size 2,083 Kb
Views 54,648
Do you need developer help for Expanding Photo Stack?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Miro Karilahti (miroot) Script Codes
Create amazing sales emails with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!