Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created June 6, 2017 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/1034076beeeff4821e1093bef91da51a to your computer and use it in GitHub Desktop.
Save codecademydev/1034076beeeff4821e1093bef91da51a to your computer and use it in GitHub Desktop.
Codecademy export
<!DOCTYPE html>
<html>
<head>
<title>Ghostly Divs</title>
<link rel='stylesheet' type='text/css' href='stylesheet.css'/>
<script type='text/javascript' src='script.js'></script>
</head>
<body>
<div>Home</div>
<div>About Us</div>
<div>Contact</div>
</body>
</html>
$(document).ready(function(){
$('div').hover(
function(){
$(this).addClass('active');
},
function(){
$(this).removeClass('active');
}
)
})
div {
border-radius: 5px;
background-color: #ABCDEF;
transition: background-color 0.5s ease;
display:inline;
font-size:25px;
padding:20px;
border:1px solid #ccc;
margin-top:10px;
}
.active {
background-color:#556677;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment