<?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>MB Blah... &#187; SEO Friendly</title>
	<atom:link href="http://www.marineboudeau.com/blog/tag/seo-friendly/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.marineboudeau.com/blog</link>
	<description></description>
	<lastBuildDate>Sun, 22 Jan 2012 17:52:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>SEO Friendly CSS Image Replacement Technique</title>
		<link>http://www.marineboudeau.com/blog/2010/03/seo-friendly-css-image-replacement-technique/</link>
		<comments>http://www.marineboudeau.com/blog/2010/03/seo-friendly-css-image-replacement-technique/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 06:22:13 +0000</pubDate>
		<dc:creator>Marine Boudeau</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Image Replacement]]></category>
		<category><![CDATA[SEO Friendly]]></category>

		<guid isPermaLink="false">http://www.marineboudeau.com/blog/?p=559</guid>
		<description><![CDATA[Learn the cleanest and most SEO friendly image replacement solution (also used by Google). ]]></description>
			<content:encoded><![CDATA[<p>There are a few techniques that are being used out there for CSS Image Replacement such as:</p>
<ol>
<li> <code>display:none;</code> hides the text from the CSS. Then what is the point?</li>
<li> <code>left:-5000px;</code> pushes the text to the extreme left, outside of the screen. While it is still on the page, it is not entirely sure that search engines won&#8217;t ignore it thinking you are hiding a bunch of text.</li>
<li> The &#8220;alt&#8221; tag within the image. Necessary but not a solution in itself.</li>
</ol>
<p>None of them are SEO friendly, clean and legit. Here is a fourth one which happens to also be used by Google. You will place your image after the text you are replacing and give the image an absolute position.</p>
<p>Here is the code that I applied to the h2 in the right rail of the <a href="http://ubenice.com">ubenice.com</a> homepage in early 2010.</p>
<p>First the html:</p>
<pre>&lt;h2 class="hdr"&gt;
   Photos
   &lt;img alt="Send Us Your Photos" src="_images/h2-photos.gif"&gt;
&lt;/h2&gt;</pre>
<p>Then the CSS:</p>
<pre>.hdr {
   height:65px;
   margin:0;
   width:250px;
   position:relative; /*this is important - there has to be a relative element somewhere above*/
}
.hdr img{
   left:0;
   position:absolute;
}</pre>
<p>Finally, if the image is not correctly positioned, you can adjust it by playing with <code>left:Xpx;</code> and/or <code>adding top:Xpx;</code>.</p>
<p>Let me know how this technique is working out for you and if you have any questions!</p>
<p><strong>UPDATE on Sept 23 2010</strong>:  James below is asking proof that Google uses this technique. Let me show you their code (I am using the code that&#8217;s around the logo on any search result page &#8211; upper left corner, next to the search box).</p>
<p>The HTML first:</p>
<pre>
      &lt;a id="logo" title="Go to Google Home" href="http://www.google.com/webhp?hl=en"&gt;
         Google
         &lt;img width="178" height="238" alt="" src="/images/nav_logo16.png"&gt;
      &lt;/a&gt;
</pre>
<p>The CSS:</p>
<pre>

#logo{
    display:block;
    height:62px;
    margin:3px 0 0 2px;
    overflow:hidden;
    position:relative;
    width:178px;
}

#logo img{
    border:0 none;
    left:0;
    position:absolute;
    top:-145px;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.marineboudeau.com/blog/2010/03/seo-friendly-css-image-replacement-technique/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

