Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <div class="container">
  <h2>Playing with Link Hover Effects</h2>
  <nav>
    <ul class="nav">
      <li class="animated_link1"><a href="#">LINK 1 - Color Change</a></li>
      <li class="animated_link2"><a href="#">LINK 2 - Underline</a></li>
      <li class="animated_link3"><a href="#"><span data-title="LINK 3 - 3D Flip">LINK 3 - 3D Flip</span></a></li>
      <li class="animated_link4"><a href="#">LINK 4 - Adding an arrow (sort of)</a></li>
      <li><a href="#"><br />LINK 5 - Expanding Circle Border</a></li>
    </ul>
    <div class="containment">
      <div class="animated_link5"><a href="#"></a></div>
    </div>
  </nav>
</div>
              
            
!

CSS

              
                @import "compass/css3";

$grey: #333;
$white: #f2f2f2;
$blue: #00929c;

body {
  background: $blue;
}
.container {
  padding: 20px;
  font-family: Helvetica, Arial, sans-serif;
}
h2 {
  margin: 0 auto;
  width: 400px;
  text-align: center;
  color: $grey;
}
nav {
  margin: 0 auto;
  width: 400px;
  background: $grey;
  border-radius: 5px;
}
ul {
  list-style-type:none;
  text-align: center;
  padding: 30px 20px 0px 20px;
  li {
    margin: 12px 0;
    a {
      color: $white;
      text-decoration: none;
      font-weight: bold;
      font-size: 1.3em;
    }
  }
}

//color change
.animated_link1 a {
  color: $white;
  transition: ease .5s;
}
.animated_link1 a:hover {
  color: #a2a2a2;
  transition: ease .5s;
}


//From http://tobiasahlin.com/blog/css-trick-animating-link-underlines/
//underline

.animated_link2 a {
  position: relative;
  color: $white;
}
.animated_link2 a:hover {
  color: $white;
}
.animated_link2 a:before {
  content: "";
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: #333;
  visibility: hidden;
  -webkit-transform: scaleX(0);
  transform: scaleX(0);
  -webkit-transition: all 0.3s ease-in-out 0s;
  transition: all 0.3s ease-in-out 0s;
}
.animated_link2 a:hover:before {
  visibility: visible;
  background-color: #f2f2f2;
  -webkit-transform: scaleX(1);
  transform: scaleX(1);
}

//from webdesignerdepot.com
//flip

.animated_link3 {
  display: inline-block;
    overflow: hidden;

    vertical-align: top;

    -webkit-perspective: 600px;
       -moz-perspective: 600px;
       -ms-perspective: 600px;
       perspective: 600px;

    -webkit-perspective-origin: 50% 50%;
       -moz-perspective-origin: 50% 50%;
       -ms-perspective-origin: 50% 50%;
       perspective-origin: 50% 50%;
}
.animated_link3:hover {text-decoration:none;}

.animated_link3 span {
    display: block;
    position: relative;
    padding: 0 2px;
  border-radius: 5px;

    -webkit-transition: all 400ms ease;
       -moz-transition: all 400ms ease;
       -ms-transition: all 400ms ease;
       transition: all 400ms ease;
    
    -webkit-transform-origin: 50% 0%;
       -moz-transform-origin: 50% 0%;
       -ms-transform-origin: 50% 0%;
       transform-origin: 50% 0%;
    
    -webkit-transform-style: preserve-3d;
       -moz-transform-style: preserve-3d;
       -ms-transform-style: preserve-3d;
       transform-style: preserve-3d;
}
.animated_link3:hover span {
        background: #00929c;
         

        -webkit-transform: translate3d( 0px, 0px, -30px ) rotateX( 90deg );
           -moz-transform: translate3d( 0px, 0px, -30px ) rotateX( 90deg );
           -ms-transform: translate3d( 0px, 0px, -30px ) rotateX( 90deg );
           transform: translate3d( 0px, 0px, -30px ) rotateX( 90deg );
}

.animated_link3 span:after {
    content: attr(data-title);

    display: block;
    position: absolute;
    left: 0;
    top: 0;
    padding: 0 2px;
  border-radius: 5px;

    color: #333;
    background: #00929c;

    -webkit-transform-origin: 50% 0%;
       -moz-transform-origin: 50% 0%;
       -ms-transform-origin: 50% 0%;
       transform-origin: 50% 0%;

    -webkit-transform: translate3d( 0px, 105%, 0px ) rotateX( -90deg );
       -moz-transform: translate3d( 0px, 105%, 0px ) rotateX( -90deg );
       -ms-transform: translate3d( 0px, 105%, 0px ) rotateX( -90deg );
       transform: translate3d( 0px, 105%, 0px ) rotateX( -90deg );
}

//adding an arrow

.animated_link4 a:before {
  position: relative;
  content:"";
  transition: ease .5s;
  color: $grey;
  font-size: 0em;
}
.animated_link4 a:hover:before {
  content:"\f061";
  font-family: "FontAwesome";
  font-size: 1em;
  font-style: normal;
  font-weight: normal;
  text-decoration: inherit;
  color: $white;
  transition: ease .5s;
}

//animated ring around an icon
.containment {
  width: 4.5em;
  height: 4.5em;
  margin: 0 auto;
}
.animated_link5 {
  width: 2em;
  height: 2em;
  border-radius: 50%;
  border: 1px solid transparent;
  transition: ease .2s;
  position: relative;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  margin: 0 auto;
  a {
    display: block;
    width: 2em;
    height: 2em;
    border-radius: 50%;
    background: $blue;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
    margin: 0 auto;
  }
}
.animated_link5:hover {
  width: 3em;
  height: 3em;
  border: 2px solid $white;
  transition: ease .2s;
}
              
            
!

JS

              
                
              
            
!
999px

Console