Pen Settings

HTML

CSS

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.

+ add another resource

JavaScript

Babel includes JSX processing.

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.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" >
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700&display=swap" rel="stylesheet">


<div id="content-slider">
  <div class="slider-wrap"> 

    <h1 class="slider-main-title">automatic slider css only</h1>

    <!-- ===== Thumbnail ControlNav ======= -->         
    <input type="radio" id="input-1" name="i" >         
    <input type="radio" id="input-2" name="i" >         
    <input type="radio" id="input-3" name="i" >
    <input type="radio" id="input-4" name="i" >

    <nav class="slider-dot-control">
      <label for="input-1" class="slider-dot"></label>
      <label for="input-2" class="slider-dot"></label>
      <label for="input-3" class="slider-dot"></label>
      <label for="input-4" class="slider-dot"></label>
    </nav>

    <!-- =================================== -->    
    <nav class="slider-arrow-control">
      <label for="input-1"></label>
      <label for="input-2"></label>
      <label for="input-3"></label>
      <label for="input-4"></label>
    </nav>
    <!-- =================================== -->

    <!--    IMAGE NAVIGATION pic -->
    <label id="thumb-1" for="input-1" class="slider-thumb">
      <img src="https://images.unsplash.com/photo-1563782414411-b05969e9ebd4?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=751&q=80" alt="" id="p-1">
      <div class="slider-head">
        <h2>Stearman PT-17</h2>
        <p>Lorem ipsum dolor.</p>
        <a href="#">read more...</a>
      </div>
    </label>

    <label id="thumb-2" for="input-2" class="slider-thumb">
      <img src="https://images.unsplash.com/photo-1585011070837-1bf8e294a858?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=750&q=80" alt="" id="p-2">
      <div class="slider-head">
        <h2>Sunset airport</h2>
        <p>Lorem ipsum.</p>
        <a href="#">read more...</a>
      </div>
    </label>         

    <label id="thumb-3" for="input-3" class="slider-thumb">
      <img src="https://images.unsplash.com/photo-1551520133-9e6d5eacaedb?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=752&q=80" alt="" id="p-3">
      <div class="slider-head">
        <h2>Hawker Sea Fury</h2> 
        <p>Lorem ipsum dolor sit.</p> 
        <a href="#">read more...</a>
      </div>
    </label>

    <label id="thumb-4" for="input-4" class="slider-thumb" tabindex="13">
      <img src="https://images.unsplash.com/photo-1516998471356-b72810b28b9d?ixlib=rb-1.2.1&ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&auto=format&fit=crop&w=752&q=80" alt="" id="p-4">
      <div class="slider-head">
        <h2>Panavia Tornado</h2>
        <p>Lorem ipsum dolor.</p>
        <a href="#">read more...</a>
      </div>
    </label>

    <!-- ===== IMages ======= -->                           

    <div class="slider">
      <div class="slider-inner">

        <figure>
          <figcaption class="slider-head">
            <h2>Stearman PT-17</h2>
            <p>Lorem ipsum dolor.</p>
            <a href="#">read more...</a>
          </figcaption>
          <img src="https://images.unsplash.com/photo-1563782414411-b05969e9ebd4?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=751&q=80" alt="" id="i-1" class="slider-img">
        </figure>

        <figure>
          <figcaption class="slider-head">
            <h2>Sunset airport</h2>
            <p>Lorem ipsum.</p>
            <a href="">read more...</a>
          </figcaption>
          <img src="https://images.unsplash.com/photo-1585011070837-1bf8e294a858?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=750&q=80" alt="" id="i-2" class="slider-img">
        </figure>

        <figure>
          <figcaption class="slider-head">
            <h2>Hawker Sea Fury</h2> 
            <p>Lorem ipsum dolor sit.</p>
            <a href="#">read more...</a>
          </figcaption>
          <img src="https://images.unsplash.com/photo-1551520133-9e6d5eacaedb?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=752&q=80" alt="" id="i-3" class="slider-img">
        </figure>

        <figure>
          <figcaption class="slider-head">
            <h2>Panavia Tornado</h2>
            <p>Lorem ipsum dolor.</p>
            <a href="#">FIND OUT MORE</a>
          </figcaption>
          <img src="https://images.unsplash.com/photo-1516998471356-b72810b28b9d?ixlib=rb-1.2.1&ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&auto=format&fit=crop&w=752&q=80" alt="" id="i-4" class="slider-img">
        </figure>


        <figure>
          <figcaption class="slider-head">
            <h2>Stearman PT-17</h2>
            <p>Lorem ipsum dolor.</p>
            <a href="#">read more...</a>
          </figcaption>
          <img src="https://images.unsplash.com/photo-1563782414411-b05969e9ebd4?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=751&q=80" alt="" id="i-5" class="slider-img">
        </figure>               
      </div>
    </div>                  

  </div>        
</div>
              
            
!

CSS

              
                * {
  box-sizing:border-box;
}

body,
html {
  padding: 0;
  margin: 0;
}

body {
  font-family: 'Montserrat', Helvetica, Arial, sans-serif;
  font-size: 1rem; 
  line-height: 1.5rem;
  font-weight: 400;
  color: #fff;
  background: #374046;
}

/* ----> wrapper */
#content-slider .slider-wrap {
  max-width: 1200px;
  width: 100%;
  margin: 0px auto;
  position: relative;
  text-align: right;
}

#content-slider .slider-wrap.full {
  width: 100%;
  max-width: 100%;
  text-align: center; 
  border: none;
}


/* --------> Link style */
#content-slider *:focus {
  outline: 0;
} 

#content-slider a:hover {
  color: #7FD4FD;
  text-decoration: underline;
}

#content-slider a:focus {
  outline: thin dotted #333;
  outline: 5px auto -webkit-focus-ring-color;
  outline-offset: -2px;
}

#content-slider a:hover,
#content-slider a:active {
  outline: 0;
}

/* -------> Responsive images (ensure images don't scale beyond their parents) */
#content-slider img {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
  object-fit: cover;
  vertical-align: middle;
  border: 0;
}

/* -------> Main */
#content-slider .slider {
  overflow: hidden;
  width: 100%;
  height: 35rem;
  margin: 0 auto;       

  position: relative;               
}

#content-slider .slider-inner {
  width: 500%;          
  line-height: 0;
  display: flex;
  height: 100%;

  animation: 30s slidy infinite;
  transition: all 2s ease-in-out; 
}

#content-slider .slider-main-title {
  text-align: center;
  font-weight: 700;
  font-size: 2rem;          
  line-height: 3rem;
  text-transform: uppercase;
  margin: 1rem 0;
}

#content-slider .slider .slider-head {
  position: absolute;
  z-index: 12;
  width: 40%;
  height: auto;
  display: inline-block;
  background: rgba(0, 0, 0, 0.5);
  padding: 1rem 1rem;
  margin: 1rem 0 0 1rem;
  overflow: hidden;

  transition: all 0.5s ease-in-out; 
}

#content-slider .slider-thumb .slider-head {
  position: absolute;
  z-index: 12;                      
  top: 0;
  right: 0;
  width: auto;
  height: auto;  
  text-align: right;
  margin: .5rem .5rem 0 0;
  opacity: 1;
  overflow: hidden;

  transition: all 0.5s ease-in-out;
}

/* -------> Article */
#content-slider .slider h2,
#content-slider .slider-thumb h2 {
  color: #fff;
  text-transform: uppercase;
  padding: 0;
  margin: 0;
  font-weight: 700;
  line-height: 1.2;
}

#content-slider .slider p,
#content-slider .slider-thumb p {
  color: #fffefe;
  padding: 0;
  margin: 0 0 1rem;
  opacity: .8;
  line-height: 1.2;
}

#content-slider .slider a,
#content-slider .slider-thumb a {
  font-weight: 700;
  color: #00ABFA;
  text-decoration: none;
  line-height: 1.2;
}

/* -------> Article IMg Slider */
#content-slider .slider h1 { font-size: 1.5rem; line-height: 1.2; }

#content-slider .slider p { font-size: 1.2rem; line-height: 1.2; }

#content-slider .slider a { font-size: 1rem; line-height: 1.2; }

/* -------> Article IMg Prev */
#content-slider .slider-thumb h2 { font-size: 1rem; line-height: 1.2; }

#content-slider .slider-thumb p { font-size: .875rem; line-height: 1.2; }

#content-slider .slider-thumb a { font-size: .75rem; line-height: 1.2; }


/* -------> Main Img */
#content-slider figure {
  margin: 0;
  padding: 0;
  width: 20%;
  cursor: pointer;

  transition: all 2s ease-in-out; 
}

#content-slider figure img {
  width: 100%;
  position: relative;
}   

/* -------> Max contrls img preview */ 
#content-slider .slider-thumb {
  width: 25%;
  margin: 35rem 0% 0 0%;
  text-align: center;
  display: block;
  z-index: 1000;
  cursor: pointer;
  position: absolute;
}

#content-slider .slider-thumb:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  opacity: .55;
  transition: all .2s ease-in-out;
}

#content-slider .slider-thumb:hover:after {
  opacity: 0;
}

#thumb-1 { left: 0; }
#thumb-2 { left: 25%; }
#thumb-3 { left: 50%; }
#thumb-4 { left: 75%; }

#content-slider input[type='radio'] {           
  width: 10px;
  height: 10px;
  position: absolute;
  display: none;
}

#content-slider .slider-arrow-control {                   
  position: absolute;
  left: 0;
  z-index: 15;          
  top: 0%;
  width: 100%;
  height: 3.125rem;
  top: 50%;
  transform: translateY(-50%);
}

#content-slider .slider-dot {
  width: 9px;
  height: 9px;
  margin: 0 2px;
  text-align: center;
  display: inline-block;
  position: relative;
  z-index: 1000;
  cursor: pointer;
  border-radius: 100%;
  border: 2px solid #00ABFA;
  background: #00ABFA;

  transition: all 0.3s ease-in-out; 
}

#content-slider .slider-dot-control {
  padding: 1rem 0;
  width: 100%;
  bottom: 0;
  z-index: 10;
  position: absolute;
  text-align: center;
  background: rgba(0, 0, 0, 0.7);
  font-size: 0;
  line-height: 0;
}   

#content-slider .slider-dot-control>label:hover { 
  width: 9px; 
  height: 9px; 
  background: #FFF; 
  border: 1px solid #00ABFA; 
}     


/* -------> Controls */ 


#input-1:checked ~ .slider .slider-inner { margin-left: 0%;   }
#input-2:checked ~ .slider .slider-inner { margin-left:-100%; }
#input-3:checked ~ .slider .slider-inner { margin-left:-200%; }
#input-4:checked ~ .slider .slider-inner { margin-left:-300%; }
#input-5:checked ~ .slider .slider-inner { margin-left:-400%; }


#input-1:checked ~ .slider-dot-control>label:nth-child(1) { opacity: 1; background: #fff; }
#input-2:checked ~ .slider-dot-control>label:nth-child(2) { opacity: 1; background: #fff; }
#input-3:checked ~ .slider-dot-control>label:nth-child(3) { opacity: 1; background: #fff; }
#input-4:checked ~ .slider-dot-control>label:nth-child(4) { opacity: 1; background: #fff; }


#input-1:checked ~ #thumb-1:after { opacity: 0; }
#input-2:checked ~ #thumb-2:after { opacity: 0; }
#input-3:checked ~ #thumb-3:after { opacity: 0; }
#input-4:checked ~ #thumb-4:after { opacity: 0; }


.slider-arrow-control>label:nth-child(2) {
  width: 3.125rem;
  height: 3.125rem;
  top: 50%;
  margin-top: -1.5625rem;
  display: inline-block;
  position: relative;           
  cursor: pointer;
}

#input-1:checked ~ .slider-arrow-control>label:nth-child(2),
#input-2:checked ~ .slider-arrow-control>label:nth-child(3),
#input-3:checked ~ .slider-arrow-control>label:nth-child(4),
#input-4:checked ~ .slider-arrow-control>label:nth-child(1),
#input-5:checked ~ .slider-arrow-control>label:nth-child(1),
#input-1:checked ~ .slider-arrow-control>label:nth-child(4),
#input-2:checked ~ .slider-arrow-control>label:nth-child(1),
#input-3:checked ~ .slider-arrow-control>label:nth-child(2),
#input-4:checked ~ .slider-arrow-control>label:nth-child(3) {
  width: 3.125rem;
  height: 3.125rem;
  top: 50%;
  margin-top: -1.5625rem;
  display: inline-block;
  position: relative;           
  cursor: pointer;
}

#input-1:checked ~ .slider-arrow-control>label:nth-child(2):after,
#input-2:checked ~ .slider-arrow-control>label:nth-child(3):after,
#input-3:checked ~ .slider-arrow-control>label:nth-child(4):after,
#input-4:checked ~ .slider-arrow-control>label:nth-child(1):after,
#input-5:checked ~ .slider-arrow-control>label:nth-child(1):after,
#input-1:checked ~ .slider-arrow-control>label:nth-child(4):after,
#input-2:checked ~ .slider-arrow-control>label:nth-child(1):after,
#input-3:checked ~ .slider-arrow-control>label:nth-child(2):after,
#input-4:checked ~ .slider-arrow-control>label:nth-child(3):after {
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  font-size: 2.125rem;
  line-height: 3.125rem;
  color: #00ABFA;
  position: absolute;
  top: 0;
  left: 0;
  text-align: center;
  width: 3.125rem;
  background: rgba(0,0,0,.5);
}

#input-1:checked ~ .slider-arrow-control>label:nth-child(2),  
#input-2:checked ~ .slider-arrow-control>label:nth-child(3), 
#input-3:checked ~ .slider-arrow-control>label:nth-child(4), 
#input-4:checked ~ .slider-arrow-control>label:nth-child(1) {       
  float: right;
  right: 0;                      
}

#input-1:checked ~ .slider-arrow-control>label:nth-child(2):after,  
#input-2:checked ~ .slider-arrow-control>label:nth-child(3):after, 
#input-3:checked ~ .slider-arrow-control>label:nth-child(4):after, 
#input-4:checked ~ .slider-arrow-control>label:nth-child(1):after {
  content: "\f054";                     
}

#input-1:checked ~ .slider-arrow-control>label:nth-child(4),
#input-2:checked ~ .slider-arrow-control>label:nth-child(1),
#input-3:checked ~ .slider-arrow-control>label:nth-child(2),
#input-4:checked ~ .slider-arrow-control>label:nth-child(3) {   
  float: left;
  left: 0;           
}

#input-1:checked ~ .slider-arrow-control>label:nth-child(4):after,
#input-2:checked ~ .slider-arrow-control>label:nth-child(1):after,
#input-3:checked ~ .slider-arrow-control>label:nth-child(2):after,
#input-4:checked ~ .slider-arrow-control>label:nth-child(3):after {
  content: "\f053";
}

/*#thumb-1:focus ~ .slider-inner { margin-left: 0%;   }
#thumb-2:focus ~ .slider-inner { margin-left:-100%; }
#thumb-3:focus ~ .slider-inner { margin-left:-200%; }
#thumb-4:focus ~ .slider-inner { margin-left:-300%; }
#thumb-5:focus ~ .slider-inner { margin-left:-400%; }*/

#content-slider input:checked ~ .slider-inner {
  animation: none;         
}
#content-slider input:hover ~ .slider-inner, 
#content-slider label:hover ~ .slider-inner {
  animation-play-state: paused;
}
#content-slider input:hover ~ .slider-inner, 
#content-slider label:hover ~ .slider-inner {
  animation-play-state: paused;
}
#content-slider span:focus ~ .slider-inner {
  animation: none;         
}
#content-slider span:hover ~ .slider-inner {
  animation-play-state: paused;
}


/* -------> Animation */
/*
@keyframes slidy {
20% { margin-left:    0%; }
25% { margin-left: -100%; }
45% { margin-left: -100%; }
50% { margin-left: -200%; }
70% { margin-left: -200%; }
75% { margin-left: -300%; }
95% { margin-left: -300%; }
100% { margin-left: -400%; }
}*/


/* -------> Responsive */
@media (max-width: 992px) {
  html {
    font-size: 12px;
  }

  #content-slider .slider-thumb .head {
    display: none;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 10px;
  }

  #content-slider .slider .head {
    display: none;
  }

  #content-slider .slider-dot { display: none; }

  #content-slider .slider-arrow-control { display: block; }


  #content-slider #thumb-2:focus { opacity: 1; } 

  #thumb-2:focus ~ #thumb-5 { display: none; }

  #content-slider #thumb-3:focus { opacity: 1; } 

  #thumb-3:focus ~ #thumb-5 { display: none; }

  #content-slider #thumb-4:focus { opacity: 1; } 

  #thumb-4:focus ~ #thumb-5 { display: none; }

}

@media (max-width: 480px) {
  #content-slider .slider-thumb img { display: none; }
}
              
            
!

JS

              
                
              
            
!
999px

Console