cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

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

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <!-- Beginning of Slider -->
<div id="slider">

  <!-- Sildes -->
	<img id="one" src="https://cssdeck.com/uploads/media/items/3/3yiC6Yq.jpg" />
	<img id="two" src="https://cssdeck.com/uploads/media/items/4/40Ly3VB.jpg" />
	<img id="three" src="https://cssdeck.com/uploads/media/items/0/00kih8g.jpg" />
	<img id="four" src="https://cssdeck.com/uploads/media/items/2/2rT2vdx.jpg" />
	<img id="five" src="https://cssdeck.com/uploads/media/items/8/8k3N3EL.jpg" />
	
	<!-- Navigation for the slides -->
	<ul>
		<li>
			<a href="#one">1</a>
		</li>
		<li>
			<a href="#two">2</a>
		</li>
		<li>
			<a href="#three">3</a>
		</li>
		<li>
			<a href="#four">4</a>
		</li>
		<li>
			<a href="#five">5</a>
		</li>
	</ul>

</div>
<!-- End of Slider -->

            
          
!
            
              html{
    background-color: #eee;
}

#slider {
    max-width: 640px;
    height: 320px;
    margin: 20px auto 50px;
    position: relative;
}

#slider img {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
  
    border: 8px solid #fff;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    -ms-border-radius: 3px;
    -o-border-radius: 3px;
    border-radius: 3px;
}

#slider img:target {
    opacity: 1;
    -webkit-transition: all .5s ease-in-out;
    -moz-transition: all .5s ease-in-out;
    -ms-transition: all .5s ease-in-out;
    -o-transition: all .5s ease-in-out;
    transition: all .5s ease-in-out;
}

#slider img#five {
    opacity: 1;
 }

#slider img:not(:target), #slider img:target ~ img#five  {
  opacity: 0;
}


/* Navigation */

#slider ul{
  position: absolute;
  width: 100%;
  text-align:center;
  bottom: -65px;
  padding:0;
}

#slider ul li {
  display: inline-block;
  margin: 0 .5em;
}

#slider ul li a{
  margin: 0;
  text-indent: 100%;
  white-space: nowrap;
  overflow: hidden;
  display: block;
  height: 15px;
  width: 15px;
  -moz-border-radius: 50%;
  -webkit-border-radius: 50%;
  -ms-border-radius: 50%;
  -o-border-radius: 50%;
  border-radius: 50%;  
  background: #ccc;

}

#slider ul li a[href="#five"] {
  /* by default set five to be selected */
  background: #777;
}

#one:target ~ ul li a[href="#one"],
#two:target ~ ul li a[href="#two"],
#three:target ~ ul li a[href="#three"],
#four:target ~ ul li a[href="#four"],
#five:target ~ ul li a[href="#five"] {
  /*when #id is the target set the link to change to selected color*/
  background: #777;
}

#one:target ~ ul li a[href="#five"],
#two:target ~ ul li a[href="#five"],
#three:target ~ ul li a[href="#five"],
#four:target ~ ul li a[href="#five"]{
  /*set default selected color of five to change to unselected when any other slide is the target  */
   background: #ccc;
}
            
          
!
999px
Loading ..................

Console