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.

            
              <!-- <a href="http://index.hu">Index</a> -->

<div class="container">
   <div class="row">
      <div class="col-xs-12">
         <div class="info">To see the effect click one of the box below, it goes to a false link. After that navigate back to this page and you will see the visited link formatting. Note: in FF and IE after you press the browser previous button you should refresh the page because it come from cache!</div>
      </div>
      <div class="col-xs-12 col-sm-6 col-md-4">
         <a href="https://google.com/1" class="list-item" data-id="1">
            <div class="image-wrapper">
               <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/24181/picture-small-03.jpg" alt="" class="img-responsive" />
            </div>
            <div class="text-wrapper">
               <h2>Lorem ipsum dolor sit amet</h2>
               <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Itaque minus sit fuga placeat nobis nostrum, tempore, illum nesciunt quas laudantium quis et asperiores! Ut nam dolore temporibus natus odio itaque.</p>
            </div>
         </a>
      </div>
      <div class="col-xs-12 col-sm-6 col-md-4">
         <a href="https://google.com/2" class="list-item" data-id="2">
            <div class="image-wrapper">
               <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/24181/picture-small-01.jpg" alt="" class="img-responsive" />
            </div>
            <div class="text-wrapper">
               <h2>Lorem ipsum dolor sit amet</h2>
               <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Itaque minus sit fuga placeat nobis nostrum, tempore, illum nesciunt quas laudantium quis et asperiores! Ut nam dolore temporibus natus odio itaque.</p>
            </div>
         </a>
      </div>
      <div class="col-xs-12 col-sm-6 col-md-4">
         <a href="https://google.com/3" class="list-item" data-id="3">
            <div class="image-wrapper">
               <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/24181/picture-small-02.jpg" alt="" class="img-responsive" />
            </div>
            <div class="text-wrapper">
               <h2>Lorem ipsum dolor sit amet</h2>
               <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Itaque minus sit fuga placeat nobis nostrum, tempore, illum nesciunt quas laudantium quis et asperiores! Ut nam dolore temporibus natus odio itaque.</p>
            </div>
         </a>
      </div>
      <div class="col-xs-12 col-sm-6 col-md-4">
         <a href="https://google.com/4" class="list-item" data-id="4">
            <div class="image-wrapper">
               <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/24181/picture-small-04.jpg" alt="" class="img-responsive" />
            </div>
            <div class="text-wrapper">
               <h2>Lorem ipsum dolor sit amet</h2>
               <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Itaque minus sit fuga placeat nobis nostrum, tempore, illum nesciunt quas laudantium quis et asperiores! Ut nam dolore temporibus natus odio itaque.</p>
            </div>
         </a>
      </div>
      <div class="col-xs-12 col-sm-6 col-md-4">
         <a href="https://google.com/5" class="list-item" data-id="5">
            <div class="image-wrapper">
               <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/24181/picture-small-02.jpg" alt="" class="img-responsive" />
            </div>
            <div class="text-wrapper">
               <h2>Lorem ipsum dolor sit amet</h2>
               <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Itaque minus sit fuga placeat nobis nostrum, tempore, illum nesciunt quas laudantium quis et asperiores! Ut nam dolore temporibus natus odio itaque.</p>
            </div>
         </a>
      </div>
      <div class="col-xs-12 col-sm-6 col-md-4">
         <a href="https://google.com/6" class="list-item" data-id="6">
            <div class="image-wrapper">
               <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/24181/picture-small-03.jpg" alt="" class="img-responsive" />
            </div>
            <div class="text-wrapper">
               <h2>Lorem ipsum dolor sit amet</h2>
               <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Itaque minus sit fuga placeat nobis nostrum, tempore, illum nesciunt quas laudantium quis et asperiores! Ut nam dolore temporibus natus odio itaque.</p>
            </div>
         </a>
      </div>
      <div class="col-xs-12 col-sm-6 col-md-4">
         <a href="https://google.com/7" class="list-item" data-id="7">
            <div class="image-wrapper">
               <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/24181/picture-small-05.jpg" alt="" class="img-responsive" />
            </div>
            <div class="text-wrapper">
               <h2>Lorem ipsum dolor sit amet</h2>
               <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Itaque minus sit fuga placeat nobis nostrum, tempore, illum nesciunt quas laudantium quis et asperiores! Ut nam dolore temporibus natus odio itaque.</p>
            </div>
         </a>
      </div>
   </div>
</div>
            
          
!
            
              @import 'bourbon';
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700,300);

body {
   background: #d7e1e8;
   // @include linear-gradient(50deg, #207cca 0%, #7db9e8 100%);
   margin-top: 40px;
   margin-bottom: 40px;
   font-family: 'Open Sans', sans-serif;
}

.info {
   background: #fff;
   margin-bottom: 30px;
   padding: 30px;
   color: #777;
   line-height: 1.6em;
   box-shadow: 0 10px 30px rgba(0,0,0,.1);
}

.list-item {
   background: #fff;
   display: block;
   position: relative;
   margin-bottom: 30px;
   color: #777;
   box-shadow: 0 10px 30px rgba(0,0,0,.1);
   
   &:hover,
   &:focus,
   &:active {
      text-decoration: none;
      color: #777;
      
      img {
         transform: scale(1.1,1.1) rotate(-3deg);
         transition: .3s;
      }
   }
   
   &.visited {
      .image-wrapper,
      .text-wrapper {
         opacity: 0.5;
      }
   }
   
   &.visited:before {
      content: 'Visited';
      position: absolute;
      top: 10px;
      left: 10px;
      background: rgba(0,0,0,.7);
      color: rgba(255,255,255,.9);
      font-size: 11px;
      text-transform: uppercase;
      display: inline-block;
      z-index: 20;
      padding: 5px 10px;
   }
   
   .image-wrapper {
      position: relative;
      overflow: hidden;
      
      img {
         transition: .3s;
      }
   }
   
   .text-wrapper {
      padding: 30px;
      
      h2 {
         font-size: 24px;
         margin: 0 0 10px 0;
         text-decoration: none;
         font-weight: 300;
         color: #444;
      }
      
      p {
         margin: 0;
         text-decoration: none;
         line-height: 1.6em;
         color: #999;
      }
   }
}
            
          
!
            
              // Add active class on document ready
document.addEventListener('DOMContentLoaded', function() {
   if(typeof(Storage) !== 'undefined') {
      if(typeof localStorage["visited-items"] !== 'undefined') {
         var items = JSON.parse(localStorage['visited-items']);

         items.forEach(function(element) {
            document.querySelector('.list-item[data-id="' + element + '"]').classList.add('visited');
         });
      }
   }
});

// Add event listeners for the links
var items = document.querySelectorAll('.list-item');

[].forEach.call(items, function(item) {
   item.addEventListener('click', function(e) {
      if(typeof localStorage['visited-items'] !== 'undefined') {
         var items = JSON.parse(localStorage['visited-items']);  
         items.push(this.dataset.id);
         localStorage['visited-items'] =  JSON.stringify(items);
      } else {
         var item = [];
         item.push(this.dataset.id);
         localStorage['visited-items'] =  JSON.stringify(item);
      }
   });
});

            
          
!
999px
Loading ..................

Console