<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>devdisko{dot}comWordPress Link Hover</title>
	<atom:link href="http://devdisko.com/tag/wordpress-link-hover/feed/" rel="self" type="application/rss+xml" />
	<link>http://devdisko.com</link>
	<description>shake your fake tan thru aerosol land</description>
	<lastBuildDate>Sun, 12 Jul 2009 23:24:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Magical CSS Background Hover Images</title>
		<link>http://devdisko.com/tutorials/design-css/magical-css-background-hover-images/</link>
		<comments>http://devdisko.com/tutorials/design-css/magical-css-background-hover-images/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 06:17:41 +0000</pubDate>
		<dc:creator>ZWJ</dc:creator>
				<category><![CDATA[Design & CSS]]></category>
		<category><![CDATA[Background CSS]]></category>
		<category><![CDATA[CSS Tricks]]></category>
		<category><![CDATA[CSS Turorials]]></category>
		<category><![CDATA[Image Hover]]></category>
		<category><![CDATA[WordPress Link Hover]]></category>

		<guid isPermaLink="false">http://devdisko.com/?p=103</guid>
		<description><![CDATA[This tutorial will detail how you too can have CSS background hover images on your website...]]></description>
			<content:encoded><![CDATA[<p>Last week I decided to revamp my political image bookmarking site &#8211; <a href="http://anonymouspond.com/" target="_blank">Anonymous Pond</a>.  The site is about 6 months old and had never really found an aesthetic voice. I tried out a half dozen themes, all heavily customized, but nothing seemed to work. The site itself is simple &#8211; Pierrette and I post images that we think will spark a debate on a number of topics such as politics, ethics, animal rights, LGBT rights, environmental issue. We try to be as non-partison as possible (we&#8217;re both very liberal) and have fun pissing off folks from the left and right.</p>
<p>After letting the Anon fall into a state of neglect for a month or so I checked the traffic stats and was pretty shocked to see that it was getting a few hundred page views a day. Ah, the magic of Google Images! That was incentive enough to give it a fresh coat of paint.</p>
<p>This tutorial will focus on one CSS feature that I attempted for the first time &#8211; hovers with a background image.</p>
<p>Let&#8217;s start with some basic CSS hover code for your nav bar&#8230;</p>
<pre>nav a {
color: #000;
}
nav a:hover {
color: #ff0000;
}</pre>
<p>The first part of the code will make each link blank while the second part will change them to red when the cursor hovers over. That pretty basic stuff and doesn&#8217;t include any dimensions or positions &#8211; a simple hover effect.</p>
<p>Let&#8217;s add an image to the hover. Create an image that is proportionate to the link you want to attach it to. By proportionate I mean that the image shouldn&#8217;t be insanely large, but it could be if you don&#8217;t mind working through the code to get it to work, and by image I mean a graphic file with whatever you like on it. Upload it to your themes images folder.</p>
<p>Replace the code above with this in your stylesheet&#8230;</p>
<pre>nav a {
color: #000;
}
nav a:hover {
display: block;
background: url(images/here.gif) no-repeat scroll center top;
}</pre>
<p>That little bit of code works well if you want the hover image to appear above the link like I have in the <a href="http://anonymouspond.com" target="_blank">nav bar on Anon</a>. If the image doesn&#8217;t show entirely you could try tweaking the padding of the link a bit.</p>
<p>The code works equally well for sidebar links. I added a hover bullet <a href="http://anonymouspond.com" target="_blank">to all of my tags</a>&#8230;</p>
<pre>.wp-tag-cloud a:hover, .wp-tag-cloud a:visited{
background: url(images/bulletback.gif) no-repeat right;
}</pre>
<p>.wp-tag-cloud a:visited leaves the image there after a person clicks on it. I also tweaked a couple of individual tags&#8230;</p>
<pre>.wp-tag-cloud a.tag-link-5 {
padding-right: 45px;
}
.wp-tag-cloud a.tag-link-5:hover, .wp-tag-cloud a.tag-link-5:visited {
background: url(images/flag.gif) no-repeat right;
}</pre>
<p>The code above placed an American flag beside the Obama tag upon scroll over while the code below added a peace sign beside peace. Both overrode the default bullet image.</p>
<pre>.wp-tag-cloud a.tag-link-38 {
padding-right: 25px;
}
.wp-tag-cloud a.tag-link-38:hover, .wp-tag-cloud a.tag-link-38:visited {
background: url(images/peace.gif) no-repeat right;
}</pre>
<p>In all cases you have to identify the unique name in the code that you need to alter. I use the webmaster plugin for Firefox to view the style information. Let me know if you have any questions or need help tweaking something. If you use the code and it works for you &#8211; why not link back to devDisko?!</p>
]]></content:encoded>
			<wfw:commentRss>http://devdisko.com/tutorials/design-css/magical-css-background-hover-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
