<?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>Mitch Canter is [studionashvegas] &#187; Image Replacement</title>
	<atom:link href="http://www.studionashvegas.com/tag/image-replacement/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.studionashvegas.com</link>
	<description>Nashville, TN&#039;s Best WordPress Designer/Developer</description>
	<lastBuildDate>Thu, 09 Feb 2012 16:28:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Image Replacement Using CSS</title>
		<link>http://www.studionashvegas.com/tutorial/image-replacement-using-css/</link>
		<comments>http://www.studionashvegas.com/tutorial/image-replacement-using-css/#comments</comments>
		<pubDate>Sun, 03 May 2009 17:08:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Image Replacement]]></category>
		<category><![CDATA[Revised Phark Method]]></category>

		<guid isPermaLink="false">http://www.studionashvegas.com/?p=493</guid>
		<description><![CDATA[<p>Posted in <a href="http://www.studionashvegas.com/category/tutorial/" title="Tutorial">Tutorial</a></p>Using images on a design is pretty well necessary in today’s visually stunning web.  However, while images look great,]]></description>
			<content:encoded><![CDATA[<p>Posted in <a href="http://www.studionashvegas.com/category/tutorial/" title="Tutorial">Tutorial</a></p><p>Using images on a design is pretty well necessary in today’s visually stunning web.  However, while images look great, there’s no substitute for text when it comes to Search Engine Optimization.  But is there a way to get the visual effect of an image while still having the SEO benefits of text?</p>
<p>With CSS, there absolutely is.</p>
<p><span id="more-493"></span></p>
<p style="background-image: url(http://www.studionashvegas.com/wp-content/themes/juicy/images/socialmedia.png); text-indent: -9999px; width: 277px; display: block; height: 101px;">Social Media</p>
<p>See this image above me?  Look like a standard image, with a standard &lt;img&gt; tag doesn’t it?  Well, if you were disable the stylesheets, all you’d see is this:</p>
<blockquote><p>Social Media</p></blockquote>
<p>Just text.</p>
<p>So, how can we achieve this?  By using a technique called the Revised Phark Method, with a bit of a twist to make sure that things work no matter where they are.</p>
<p>First, the code (simplified from above because the styles are inline for less “stylesheet bloat”)</p>
<pre class="code">&lt;p class="socialmedia"&gt;Social Media&lt;/p&gt;</pre>
<p class="code">Next, the CSS.  First we give it a definitive height and width:</p>
<pre class="code">.socialmedia{
height: 277px;
width: 101px;
}</pre>
<p class="code">Next, we need to set the display to “block” in order to give it the properties of other “block” elements (like H1, H2, and other similar tags):</p>
<pre> .socialmedia{
height: 277px;
width: 101px;
display:block;
}</pre>
<p>After that, we need to set the background image:</p>
<pre> .socialmedia{
height: 277px;
width: 101px;
display:block;
background-image: url(http://www.studionashvegas.com/wp-content/themes/juicy/images/socialmedia.png);
}</pre>
<p style="background-image: url(http://www.studionashvegas.com/wp-content/themes/juicy/images/socialmedia.png); width: 277px; display: block; height: 101px;">Social Media</p>
<p>That’s starting to look right, but the text is still overlaid on the image.  To get rid of it, we simply indent the text –9999 pixels to the left, removing it from view:</p>
<pre>.socialmedia{
height: 277px;
width: 101px;
display:block;
text-indent:-9999px;
background-image: url(http://www.studionashvegas.com/wp-content/themes/juicy/images/socialmedia.png);
}</pre>
<p>So, what is the benefit of doing this?  Number one, browsers that don’t support images will show text, so you don’t lose the effect just because the image can’t be shown.  Also, the SEO benefits of using an H1 tag with text far outweigh those of using an H1 tag with an image and alt text.  Finally, it allows you to write your markup first without having to worry about jamming items into the design; write the markup, then style the elements in order from top to bottom, which saves time in the long run.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.studionashvegas.com/tutorial/image-replacement-using-css/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: basic
Database Caching 3/17 queries in 0.017 seconds using disk: basic
Object Caching 413/437 objects using disk: basic
Content Delivery Network via cdn.studionashvegas.com

Served from: www.studionashvegas.com @ 2012-02-10 02:49:30 -->
