Pen Settings

↑ Insert the most common viewport meta tag

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource
via CSS Lint

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource
via JS Hint

Code Indentation


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Want a Run Button?

If active, the preview will update automatically when you change code.


We will make a slider with stylized thumbnails using CSS3
The markup is very simple:
Radio Inputs
Labels with thumbnails to detect click event
Main Image
<div class="slider">
	<input type="radio" name="slide_switch" id="id1"/>
	<label for="id1">
		<img src="" width="100"/>
	<img src=""/>
	<!--Lets show the second image by default on page load-->
	<input type="radio" name="slide_switch" id="id2" checked="checked"/>
	<label for="id2">
		<img src="" width="100"/>
	<img src=""/>
	<input type="radio" name="slide_switch" id="id3"/>
	<label for="id3">
		<img src="" width="100"/>
	<img src=""/>
	<input type="radio" name="slide_switch" id="id4"/>
	<label for="id4">
		<img src="" width="100"/>
	<img src=""/>
	<input type="radio" name="slide_switch" id="id5"/>
	<label for="id5">
		<img src="" width="100"/>
	<img src=""/>

<!-- We will use PrefixFree - a script that takes care of CSS3 vendor prefixes
You can download it from -->
<script src="" type="text/javascript"></script>



              /*Time for the CSS*/
* {margin: 0; padding: 0;}
body {background: #ccc;}

	width: 640px; /*Same as width of the large image*/
	position: relative;
	/*Instead of height we will use padding*/
	padding-top: 320px; /*That helps bring the labels down*/
	margin: 100px auto;
	/*Lets add a shadow*/
	box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.75);

/*Last thing remaining is to add transitions*/
	position: absolute;
	left: 0; top: 0;
	transition: all 0.5s;

.slider input[name='slide_switch'] {
	display: none;

.slider label {
	/*Lets add some spacing for the thumbnails*/
	margin: 18px 0 0 18px;
	border: 3px solid #999;
	float: left;
	cursor: pointer;
	transition: all 0.5s;
	/*Default style = low opacity*/
	opacity: 0.6;

.slider label img{
	display: block;

/*Time to add the click effects*/
.slider input[name='slide_switch']:checked+label {
	border-color: #666;
	opacity: 1;
/*Clicking any thumbnail now should change its opacity(style)*/
/*Time to work on the main images*/
.slider input[name='slide_switch'] ~ img {
	opacity: 0;
	transform: scale(1.1);
/*That hides all main images at a 110% size
On click the images will be displayed at normal size to complete the effect
.slider input[name='slide_switch']:checked+label+img {
	opacity: 1;
	transform: scale(1);
/*Clicking on any thumbnail now should activate the image related to it*/

/*We are done :)*/


Loading ..................