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

              
                <header>
	<h1>Button Hover animation</h1>
</header>

<main class='container'>
	<button class='myButt one'>
		<div class='insider'></div>
		Hover over me
	</button>
</main>
<main class='container'>
	<button class='myButt two'>
		Hover over me
	</button>
</main>
<main class='container'>
	<button class='myButt three'>
		Hover over me
	</button>
</main>
<main class='container'>
	<button class='myButt four'>
	<div class='icon'>&#x2605;</div>
		<span>Hover over me</span>
	</button>
</main>

<main class='container'>
	<button class='myButt five'>
	<div class='layer'>YEAH</div>
		Hover over me
	</button>
</main>
              
            
!

CSS

              
                $red:#F44336;
@mixin transition($in) {
	transition:$in;
	-webkit-transition:$in;
	-moz-transition:$in;
	-o-transition:$in;
	-ms-transition:$in;
}
@mixin transform($in) {
	transform:$in;
	-webkit-transform:$in;
	-moz-transform:$in;
	-o-transform:$in;
	-ms-transform:$in;
}
@mixin animation($in) {
	animation:$in;
	-webkit-animation:$in;
	-moz-animation:$in;
	-o-animation:$in;
	-ms-animation:$in;
}

body {
	margin:0;
	padding:0;
	background-color:#222;
}
* {
	font-family:Helvetica,sans-serif;
	color:$red;
}

header {
	text-align:center;

	h1 {
		text-transform:uppercase;
	}
}

.myButt {
	outline:none;
	border:none;
	padding:20px;
	display:block;
	margin:50px auto;
	cursor:pointer;
	font-size:20px;
	background-color:transparent;
	position:relative;
	border:2px solid #fff;

	@include transition(all 0.5s ease);
}


// ################ ONE

.one {
	border-color:#fff;
	overflow:hidden;
	color:#fff;

	.insider {
		background-color:#fff;
		width:100%;
		height:20px;
		position:absolute;
		left:-135px;

		@include transform(rotateZ(45deg));
	}

	&:hover {
		background-color:$red;
		border-color:#fff;
		color:#fff;

		.insider {
			@include transition(all 0.3s ease);
			left:135px;
		}
	}
}

// ################ TWO

.two {
	color:#fff;

	&:hover {
		border-color:$red;
		color:$red;

		@include animation(shakeThatBooty 0.3s linear 1);		
	}
}

@keyframes shakeThatBooty {
	33% {
		@include transform(rotateZ(10deg));
	}
	67% {
		@include transform(rotateZ(-10deg));
	}
	100% {
		@include transform(rotateZ(10deg));
	}
}


// ################ THREE

.three {
	color:#fff;
	border-color:transparent;

	&:before {
		width:0;
		height:3px;
		content:" ";
		background-color:$red;
		position:absolute;
		top:0;
		left:50%;

		@include transition(all 0.3s ease);
	}

	&:after {
		@extend .three:before;
		top:100%;
	}

	&:hover {
		letter-spacing:8px;
		color:$red;

		&:before {
			width:100%;
			left:0;
		}
		&:after {
			width:100%;
			left:0;
		}
	}
}

// ################ FOUR

.four {
	overflow:hidden;
	
	span {
		color:#fff;
		display:inline-block;
		
		@include transition(all 0.3s ease);

	}

	.icon {
		position:absolute;
		left:-60px;
		top:0;
		color:#fff;
		padding:20px;
		background-color:$red;
		@include transition(all 0.3s ease);
	}

	&:hover {
		.icon {
			left:0px;
		}
		span {
			color:$red;
			margin-left:50px;
		}
	}
}

// ################ FIVE

.five {
	overflow:hidden;
	color:#fff;

	.layer {
		color:#fff;
		position:absolute;
		top:-70px;
		width:100%;
		left:0;
		padding:20px 0;
		background-color:$red;
		@include transition(all 0.3s ease);
	}

	&:hover {
		.layer {
			top:0;
		}
	}
}
              
            
!

JS

              
                /*
Pure CSS
*/
              
            
!
999px

Console