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.

            
              <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>
            
          
!
            
              $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;
		}
	}
}
            
          
!
999px
Loading ..................

Console