Skip to content

Instantly share code, notes, and snippets.

@cecilemuller
Created January 10, 2012 23:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cecilemuller/1591841 to your computer and use it in GitHub Desktop.
Save cecilemuller/1591841 to your computer and use it in GitHub Desktop.
Blurry text on mouseover using CSS3
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<style>
body {
background: #333333;
}
#menu {
font-family: sans-serif;
font-size: 3em;
}
#menu a {
display: inline-block;
color: transparent;
text-shadow: 0px 0px 5px #FFFFFF;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
-ms-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
#menu:hover a,
#menu a.active {
text-shadow: 0px 0px 5px #AAAAAA;
}
#menu a:hover,
#menu a.active {
color: #FFFFFF;
text-shadow: 0px 0px 1px #FFFFFF;
}
</style>
<!--[if IE]>
<style>
#menu a {
color: #FFFFFF;
}
#menu:hover a {
color: #AAAAAA;
}
#menu a:hover {
color: #FFFFFF;
}
</style>
<![endif]-->
</head>
<body>
<div id="menu">
<a href="#">Item 1</a>
<a href="#" class="active">Item 2</a>
<a href="#">Item 3</a>
<a href="#">Item 4</a>
<a href="#">Item 5</a>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment