Pure CSS Image Gallery
How do I make an pure css image gallery?
Image gallery using only css. What is a pure css image gallery? How do you make a pure css image gallery? This script and codes were developed by Assaf Gelber on 03 January 2023, Tuesday.
Pure CSS Image Gallery - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Pure CSS Image Gallery</title> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ div, ul, li, img { box-sizing: border-box;
}
body { background-color: #e8e8e8; text-align: center;
}
.gallery { width: 400px; overflow: hidden; border: 1px solid #aaa; margin: 20px auto; padding: 20px; background-image: radial-gradient(#aaaaaa 0%, #666666 90%, #555555 100%);
}
.gallery-images { width: 1200px; text-align: left; position: relative; padding: 0; margin: 0; transition: left 0.5s;
}
.gallery-item { display: inline;
}
.gallery-item img { width: 300px; height: 200px; padding: 0; margin: 10px 0; border: 1px solid #aaa; cursor: pointer;
}
.gallery-item:not(:first-child) img { margin-left: 10px;
}
.gallery-item:first-child img { margin-left: 30px;
}
.gallery input { display: none;
}
.gallery input + label { background-color: #aaa; height: 6px; width: 24px; display: inline-block; border: 1px solid #444; cursor: pointer; transition: all 0.5s;
}
.gallery input + label:hover { box-shadow: 0 0 3px 0 #555;
}
.gallery input:checked + label { background-color: #f1f1f1;
}
.gallery #ind-1:checked ~ .gallery-images { left: 0;
}
.gallery #ind-2:checked ~ .gallery-images { left: -310px;
}
.gallery #ind-3:checked ~ .gallery-images { left: -620px;
}
#credit { font-family: "Calibri";
}
#credit a { color: #000;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class='gallery'> <input checked='' id='ind-1' name='gallery' type='radio'> <label for='ind-1'></label> </input> <input id='ind-2' name='gallery' type='radio'> <label for='ind-2'></label> </input> <input id='ind-3' name='gallery' type='radio'> <label for='ind-3'></label> </input> <ul class='gallery-images'> <li class='gallery-item'> <label for='ind-1'> <img src='https://25.media.tumblr.com/42398e2ce1fe4c264db448a8ce2f8caf/tumblr_mhkd1xJ6N81qkegsbo1_500.png'> </label> </li> <li class='gallery-item'> <label for='ind-2'> <img src='https://25.media.tumblr.com/2f638a7a862b55af7e9757ccb8308739/tumblr_mhkd5kf3vf1qkegsbo1_500.jpg'> </label> </li> <li class='gallery-item'> <label for='ind-3'> <img src='https://25.media.tumblr.com/22d4b1e8b40a127df8061575eec00a08/tumblr_mhi8o0CVvE1qkegsbo1_500.jpg'> </label> </li> </ul>
</div>
<div id='credit'> Images from <a href='http://www.theultralinx.com'> The Ultralinx </a>
</div> <script src="js/index.js"></script>
</body>
</html>
Pure CSS Image Gallery - Script Codes CSS Codes
div, ul, li, img { box-sizing: border-box;
}
body { background-color: #e8e8e8; text-align: center;
}
.gallery { width: 400px; overflow: hidden; border: 1px solid #aaa; margin: 20px auto; padding: 20px; background-image: radial-gradient(#aaaaaa 0%, #666666 90%, #555555 100%);
}
.gallery-images { width: 1200px; text-align: left; position: relative; padding: 0; margin: 0; transition: left 0.5s;
}
.gallery-item { display: inline;
}
.gallery-item img { width: 300px; height: 200px; padding: 0; margin: 10px 0; border: 1px solid #aaa; cursor: pointer;
}
.gallery-item:not(:first-child) img { margin-left: 10px;
}
.gallery-item:first-child img { margin-left: 30px;
}
.gallery input { display: none;
}
.gallery input + label { background-color: #aaa; height: 6px; width: 24px; display: inline-block; border: 1px solid #444; cursor: pointer; transition: all 0.5s;
}
.gallery input + label:hover { box-shadow: 0 0 3px 0 #555;
}
.gallery input:checked + label { background-color: #f1f1f1;
}
.gallery #ind-1:checked ~ .gallery-images { left: 0;
}
.gallery #ind-2:checked ~ .gallery-images { left: -310px;
}
.gallery #ind-3:checked ~ .gallery-images { left: -620px;
}
#credit { font-family: "Calibri";
}
#credit a { color: #000;
}
Pure CSS Image Gallery - Script Codes JS Codes
/* NO JS */
Developer | Assaf Gelber |
Username | agelber |
Uploaded | January 03, 2023 |
Rating | 3.5 |
Size | 3,911 Kb |
Views | 8,096 |
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!
Name | Size |
Translate Demo | 3,188 Kb |
Transition Demo | 2,780 Kb |
Form Placeholder Labels | 3,824 Kb |
Blurring Menu | 2,934 Kb |
ScaleZ Demo | 3,184 Kb |
Simple Night Sky | 3,266 Kb |
Perspective Demo | 3,143 Kb |
Text Looping Transition | 5,619 Kb |
TranslateZ Demo | 3,176 Kb |
Origin Demo | 3,523 Kb |
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!
Name | Username | Size |
Funny menu | AxeLVaisper | 4,671 Kb |
ASCII triangle image overlay | Mitchdot | 2,200 Kb |
Swiftype Lower Third | Zumwalt | 4,796 Kb |
Text Blocks Over Image, Updated | KatieK2 | 3,122 Kb |
Zeichensatz | Moklick | 2,058 Kb |
Knob rotation | Alemesre | 2,122 Kb |
Importable Clearfix | Corysimmons | 1,411 Kb |
Wikipedia viewer | Chpecson | 2,865 Kb |
Svg sky | Omodev | 7,070 Kb |
Brown by pure CSS, no image, no javascript | Aaronchuo | 2,652 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!