Text Shadow Hover States

  • 8 Comments
  •       221 words

Time for a quick Friday post before we all knock off for the weekend, this afternoon I was working with text shadow and it occured to me that I’d never seen it implemented on any links, so with this in mind I set about implementing a quick piece of code to see it in action.

a, a:active {
	color:#4FCDFF;
	left:0;
	position:relative;
	top:0;
	text-decoration: none;
	text-shadow:1px 1px #004F6F, 2px 2px #004F6F, 3px 3px #004F6F;

}
a:hover, a:focus {
	color:#4FCDFF;
	left:-3px;
	text-shadow:1px 1px #004F6F, 2px 2px #004F6F, 3px 3px #004F6F, 4px 4px #004F6F, 5px 5px #004F6F, 6px 6px #004F6F;
	top:-3px;
}

After playing about with this it seems to work better when you’re putting this code on a large bold element ie, a heading. It also looks pretty good when you’ve also set the text to text-transform:uppercase;

Give it a go and watch your hrefs *pop* | Example

Update: As pointed out by Mitchell in the comments, I forgot to add an :active state, so this has now been rectified.

If you liked this article then please feel free to Tweet it
  • Who I am

    My name is Jack Osborne and I am a Glasgow–based designer and writer. You should follow me on Twitter.

8 Responses to “Text Shadow Hover States”

  1. Matt Carey says:

    If you are writing articles like this can I suggest you show an example of the technique in action? Would be very helpful…

  2. Dan M says:

    I like the idea of using text-shadow for headings or other prominent content. I think underlining is still an important standard for links in main copy, but I’m all for experimenting when it comes to titles and navigation.

  3. Lee Munroe says:

    Sweet, that’s pretty cool. Was having trouble envisioning what it would look like. Pleasantly surprised.

  4. Mitchell says:

    Adding an active state, you could make it go back in too, that would finish it off!

  5. Jack Osborne says:

    Ah yes, good idea Mitchell.

  6. Andy says:

    Nice. Looks a lot like David Desandro’s about page footer links.

  7. Jack Osborne says:

    @Andy That’s a pretty cool website, it’s full to the brim of lovely CSS3 transitions, I’ll be investigating his site more throughout the weekend.