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

              
                <div class="wrapper">
    <h1>Hyperlink :hover CSS Animations</h1>
    <ol>
        <li>
            <div class="effect-one"><a>Underline - Inside out</a></div>
        </li>
        <li>
            <div class="effect-two"><a>Underline - Right to Left</a></div>
        </li>
        <li>
            <div class="effect-three"><a>Underline - Right to Left</a></div>
        </li>
        <li>
            <div class="effect-four"><a>Underline - Bounce down</a></div>
        </li>
        <li>
            <div class="effect-five"><a>Background color - Right to Left</a></div>
        </li>
        <li>
            <div class="effect-six"><a>Background color - Left to Right</a></div>
        </li>
        <li>
            <div class="effect-seven"><a>Background color - Bottom to Top</a></div>
        </li>
        <li>
            <div class="effect-eight"><a>Background color - Top to Bottom</a></div>
        </li>
    </ol>
</div>
              
            
!

CSS

              
                /* Demo styles */
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700);
$mainColor: #21242C;
body {
	font-family: 'Open Sans', sans-serif;
	background: $mainColor;
	color: white;
	font-size: 20px;
	padding: 0;
}
a {
	cursor: pointer;
	text-decoration: none;
}
ol, li {
	margin: 0;
	padding: 0;
}
li {
    padding: 12px;
}
.wrapper {
	width: 100%;
	max-width: 400px;
	margin: 0 auto 0 auto;
}

/**
 * ANIMATIONS CSS ---------------------------------
 */

// Animation 1
// Underline - Inside Out
.effect-one > a {
	position: relative;
	&:before {
		content: "";
		position: absolute;
		width: 100%;
		height: 2px;
		bottom: 0;
		margin: -5px 0;
		background-color: white;
		visibility: hidden;
		transform: scaleX(0);
		transition: all 0.4s ease-in-out 0s;
	}
	&:hover:before {
		visibility: visible;
		transform: scaleX(1);
	}
}

// Animation 2
// Underline - Right to Left
.effect-two > a {
	display: inline-block;
	position: relative;
	&:after {
		content: "";
		display: block;
		position: absolute;
		width: 0;
		bottom: 0;
		height: 2px;
		margin: -5px 0;
		right: 0;
		background-color: white;
		transition: all 0.4s ease-in 0s;
	}
	&:hover:after {
		width: 100%;
	}
}

// Animation 3
// Underline - Left to Right
.effect-three > a {
	display: inline-block;
	position: relative;
	&:after {
		content: "";
		display: block;
		position: absolute;
		width: 0;
		bottom: 0;
		height: 2px;
		margin: -5px 0;
		left: 0;
		background-color: white;
		transition: all 0.4s ease-in 0s;
	}
	&:hover:after {
		width: 100%;
	}
}

// Animation 4
// Background color - Right to Left
.effect-four > a {
	padding: 0 0 4px 0;
	border-bottom: 2px solid $mainColor;
	transition: 0.3s ease;
	&:hover{
		padding: 0 0 6px 0;
		border-color: white;
	}
}

// Animation 5
// Background color - Left to Right
.effect-five > a {
	padding: 0 5px;
	box-shadow: inset 0 0 0 0 white;
	transition: all 0.4s ease-in-out 0s;
	&:hover{
		box-shadow: inset -300px 0 0 0 white;
		color: $mainColor;
	}
}

// Animation 6
// Background color - Left to Right
.effect-six > a {
	padding: 0 5px;
	box-shadow: inset 0 0 0 0 white;
	transition: all 0.4s ease-in-out 0s;
	&:hover{
		box-shadow: inset 300px 0 0 0 white;
		color: $mainColor;
	}
}

// Animation 7
// Background color - Bottom to Top
.effect-seven > a {
	padding: 0 5px;
	box-shadow: inset 0 0 0 0 white;
	transition: all 0.5s ease-in-out 0s;
	&:hover{
		box-shadow: inset 0 -300px 0 0 white;
		color: $mainColor;
	}
}

// Animation 8
// Background color - Top to Bottom
.effect-eight > a {
	padding: 0 5px;
	box-shadow: inset 0 0 0 0 white;
	transition: all 0.5s ease-in-out 0s;
	&:hover{
		box-shadow: inset 0 300px 0 0 white;
		color: $mainColor;
	}
}

              
            
!

JS

              
                
              
            
!
999px

Console