<?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>stormdamage.org &#187; CSS</title>
	<atom:link href="http://stormdamage.org/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://stormdamage.org</link>
	<description>Art, Webdesign and CSS.</description>
	<lastBuildDate>Mon, 10 Nov 2008 16:31:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Getting CSS to behave like tables</title>
		<link>http://stormdamage.org/getting-css-to-behave-like-tables/</link>
		<comments>http://stormdamage.org/getting-css-to-behave-like-tables/#comments</comments>
		<pubDate>Tue, 30 Sep 2008 11:05:05 +0000</pubDate>
		<dc:creator>Leonie</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[tables]]></category>

		<guid isPermaLink="false">http://stormdamage.org/?p=44</guid>
		<description><![CDATA[As much as I adore CSS, it seemed to me that it had one main limitation &#8211; it&#8217;s impossible to make it behave like tables. For example, it you have three columns of data beside each other, if one pushes down further than the others, the adjacent two won&#8217;t push down to match. Something like [...]]]></description>
			<content:encoded><![CDATA[<p>As much as I adore CSS, it seemed to me that it had one main limitation &#8211; it&#8217;s impossible to make it behave like tables. For example, it you have three columns of data beside each other, if one pushes down further than the others, the adjacent two won&#8217;t push down to match. Something like this happens instead:</p>
<p><img src="http://stormdamage.org/wp-content/uploads/2008/09/demo1.gif" alt="" title="demo1" width="555" height="118" class="aligncenter" alt="" /></p>
<p>The temptation is of course, to just use a sneaky table. But after some research I found this <a href="http://www.pixy.cz/blogg/clanky/css-3col-layout/">elegant solution by Pixy</a>. The main beauty of this technique is that it works even in IE6, and doesn&#8217;t require any hacks. However, it is a little hard to get your head around if you&#8217;re new to CSS, so here&#8217;s my simplified breakdown of Pixy&#8217;s technique.</p><span id="more-44"></span>
<p>As you might expect, you begin by creating three columns &#8211; the left one floating left, the right one floating right, and the middle one unpositioned. I have given a width of 150px to the two side columns, and created another div underneath with the ID &#8216;clear&#8217;. This div ensures the floats above are properly closed, so you could put another div below these columns without it scrunching up unexpectedly.</p>
<p>So here&#8217;s what we&#8217;ve got so far:</p>
<blockquote>
#left { float:left; width:150px; }<br />
#right { float:right; width:150px;  }<br />
#clear { clear:both; }<br />
<br />
&lt;div id=&#8221;left&#8221;&gt;This is the text for the left hand side.&lt;/div&gt;<br />
&lt;div id=&#8221;right&#8221;&gt;This is the text for the right hand side.&lt;/div&gt;<br />
&lt;div id=&#8221;middle&#8221;&gt;This is the text for the left middle section.&lt;/div&gt;<br />
&lt;div id=&#8221;clear&#8221;&gt;&lt;/div&gt;<br />
</blockquote>
<p>This will produce a page which looks very much like the image above. So to make it push down evenly like a table, we can use Pixy&#8217;s technique. This involves creating two more divs around the 4 we already have. These divs are to hold the background images &#8211; one for the left, and one for the right:</p>
<blockquote>
#main1 { background:url(purple.gif) top left repeat-y #fefcb9; }<br />
#main2 { background:url(blue.gif) top right repeat-y; }<br />
<br />
&lt;div id=&#8221;main1&#8243;&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;div id=&#8221;main2&#8243;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div id=&#8221;left&#8221;&gt;This is the text for the left hand side.&lt;/div&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div id=&#8221;right&#8221;&gt;This is the text for the right hand side.&lt;/div&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div id=&#8221;middle&#8221;&gt;This is the text for the left middle section.&lt;/div&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div id=&#8221;clear&#8221;&gt;&lt;/div&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;/div&gt;<br />
&lt;/div&gt;<br />
</blockquote>
<p>The main1 div gives the background colour for the middle column, and the background image for the left column. By mixing an image and a colour into one background tag, we only need one div to set the colour on two columns (left and middle). The main2 div sets the background image for the right column.</p>
<p>By doing this, we now have something that looks like this:</p>
<p><img src="http://stormdamage.org/wp-content/uploads/2008/09/demo2.gif" alt="" title="demo2" alt="" width="555" height="118" class="aligncenter" /></p>
<p>Of course, there are some limitations. If you wanted to put borders around each column, it might be a little tricky. This is because it&#8217;s only the background rather than the div itself which pushes down to the bottom. So you might be able to create the effect by creating background images with borders on them, but CSS borders may cause some problems.</p>]]></content:encoded>
			<wfw:commentRss>http://stormdamage.org/getting-css-to-behave-like-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Uses for CSS Tooltips &amp; Images</title>
		<link>http://stormdamage.org/uses-for-css-tooltips-images/</link>
		<comments>http://stormdamage.org/uses-for-css-tooltips-images/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 10:50:36 +0000</pubDate>
		<dc:creator>Leonie</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[tooltips]]></category>

		<guid isPermaLink="false">http://stormdamage.org/?p=20</guid>
		<description><![CDATA[You may remember a previous post of mine, where I explained a method of using only CSS to create tooltips. Well here are two creative uses for that technique. Firstly &#8211; this map of the capital cities in the UK and Ireland. The locations are revealed when you hover your mouse over them:DublinEdinburgh  London [...]]]></description>
			<content:encoded><![CDATA[<p style="padding-bottom:0;">You may remember a previous post of mine, where I explained <a href="/tooltips-using-css-only-no-javascript/">a method of using only CSS to create tooltips</a>. Well here are two creative uses for that technique. Firstly &#8211; this map of the capital cities in the UK and Ireland. The locations are revealed when you hover your mouse over them:</p><div class="iecenter"><div id="map"><a href="javascript:void;" class="tooltip"><div class="dublin"><div class="dot"><span>Dublin</span></div></div></a><a href="javascript:void;" class="tooltip"><div class="edinburgh"><div class="dot"><span>Edinburgh </span></div></div></a><a href="javascript:void;" class="tooltip"><div class="london"><div class="dot"><span> London </span></div></div></a><a href="javascript:void;" class="tooltip"><div class="cardiff"><div class="dot"><span> Cardiff </span></div></div></a><a href="javascript:void;" class="tooltip"><div class="belfast"><div class="dot"><span>Belfast </span></div></div></a></div></div><p>This is done by creating a &lt;div&gt; which has the map image as the background. Links are placed inside this &lt;div&gt; for each location, and are positioned absolutely over the map. Inside each link is the tooltip text &lt;span&gt;, and a &lt;div&gt; with the class &#8216;dot&#8217; to define the hotspot area. On the map shown, I have outlined these divs with a square, white border so you can see where they are. But of course you could make them entirely invisible if you wanted to.<span id="more-20"></span></p>
<p>Here&#8217;s the HTML structure:</p>
<blockquote><p>&lt;div id=&#8221;map&#8221;&gt;<br />
&nbsp;&nbsp;&lt;a href=&#8221;javascript:void;&#8221; class=&#8221;tooltip&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;div class=&#8221;dublin&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div class=&#8221;dot&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;span&gt; Dublin &lt;/span&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;<br />
&nbsp;&nbsp;&lt;/a&gt;<br />
&nbsp;&nbsp;&lt;a href=&#8221;javascript:void;&#8221; class=&#8221;tooltip&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;div class=&#8221;edinburgh&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div class=&#8221;dot&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;span&gt; Edinburgh &lt;/span&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;<br />
&nbsp;&nbsp;&lt;/a&gt;<br />
&nbsp;&nbsp;&lt;a href=&#8221;javascript:void;&#8221; class=&#8221;tooltip&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;div class=&#8221;london&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div class=&#8221;dot&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;span&gt; London &lt;/span&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;<br />
&nbsp;&nbsp;&lt;/a&gt;<br />
&nbsp;&nbsp;&lt;a href=&#8221;javascript:void;&#8221; class=&#8221;tooltip&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;div class=&#8221;cardiff&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div class=&#8221;dot&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;span&gt; Cardiff &lt;/span&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;<br />
&nbsp;&nbsp;&lt;/a&gt;<br />
&nbsp;&nbsp;&lt;a href=&#8221;javascript:void;&#8221; class=&#8221;tooltip&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;div class=&#8221;belfast&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div class=&#8221;dot&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;span&gt; Belfast &lt;/span&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;<br />
&nbsp;&nbsp;&lt;/a&gt;<br />
&lt;/div&gt;</p></blockquote>
<p>So to recap &#8211; the tooltip text and &#8216;dot&#8217; hotspot are contained within a &lt;div&gt; named the class of the city it points to. This div is positioned absolutely over the map image. To create the tooltip, reuse the CSS from <a href="/tooltips-using-css-only-no-javascript/">my previous tutorial</a> (only with slightly different sizes and colours this time):</p>
<blockquote><p>a.tooltip:hover { font-size:100%; } /* IE6 fix */
a.tooltip span {display:none; }
a.tooltip:hover span { display:inline; position:absolute; padding:3px; background-color:#eee; border:1px solid #000; text-decoration:none; color:#7A2141; font-weight:bold; }</p></blockquote>
<p>Then create the CSS for the map image, and the locations:</p>
<blockquote><p>#map { position:relative; background:url(ukmap.png) no-repeat; width:244px; height:253px; border:1px solid #000; }
<br /><br />
a.tooltip div.belfast { position:absolute; top:116px; left:90px; }<br />
a.tooltip div.dublin { position:absolute; top:147px; left:80px; }<br />
a.tooltip div.edinburgh { position:absolute; top:92px; left:142px; }<br />
a.tooltip div.london { position:absolute; top:204px; left:179px; }<br />
a.tooltip div.cardiff { position:absolute; top:196px; left:130px; }</p></blockquote>
<p>Finally, create the CSS for the dot hotspots. This just decides how big each hotspot should be, and adds an optional border:</p>
<blockquote><p>a.tooltip div.dot { width:10px; height:10px; border:#fff 1px solid; }</p></blockquote>
<p>This will give you some working map tooltips! Of course, you may wish to position them a little better, as they overlap the dots a little. So you can either simply push them down a little like this:</p>
<blockquote><p>a.tooltip div span { top:14px; }</p></blockquote>
<p>or you can try and centre them:</p>
<blockquote><p>a.tooltip div span { top:14px; margin-left:-250%; font-size:100%; }</p></blockquote>
<p>Unfortunately this method is not terribly reliable, a better solution would be to make all the tooltip text &lt;span&gt; tags the same width, then negatively offset them by half their width:</p>
<blockquote><p>a.tooltip div span { text-align:center; top:14px; width:60px; margin-left:-30px; font-size:100%; }</p></blockquote>
<p>The second use for this CSS technique would be a Facebook style method of highlighting photographs. A list of items is shown under an image. When the mouse is hovered over one of the items, a box appears on the image. Like so:</p>
<div class="iecenter"><div class=housemates style="text-align:left;"><ul><li><a href=# class=person>Jon <span class=jon></span></a></li><li><a href=# class=person>Leonie <span class=leonie></span></a></li><li><a href=# class=person>Andy<span class=andy></span></a></li></ul></div></div>
<p>To do this, you need to create a &lt;div&gt; which will hold the image and the list. Each list item will have a &lt;span&gt; inside it, which will be hidden initially, but show up over the image when the item is hovered over. Here&#8217;s the HTML:</p>
<blockquote><p>&lt;div class=&#8221;housemates&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;ul&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&#8221;#&#8221; class=&#8221;person&#8221;&gt;Jon &lt;span class=&#8221;jon&#8221;&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&#8221;#&#8221; class=&#8221;person&#8221;&gt;Leonie &lt;span class=&#8221;leonie&#8221;&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&#8221;#&#8221; class=&#8221;person&#8221;&gt;Andy &lt;span class=&#8221;andy&#8221;&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;/ul&gt;<br />
&lt;/div&gt;</p></blockquote>
<p>The &#8216;housemates&#8217; div should have the photo as a background, and have the photograph&#8217;s width plus some top padding to push the list down underneath:</p>
<blockquote><p>.housemates { position:relative; background:url(housemates.jpg) no-repeat; width:419px; padding-top:343px; }</p></blockquote>
<p>Then the size of the spans which appear when hovering should be set, using the CSS trick previously outlined:</p>
<blockquote><p>a.person:hover { font-size:100%; } /* IE6 fix */<br />
a.person:hover span { position:absolute; width:80px; height:100px; background:transparent; border:2px solid #fff; text-decoration:none; }</p></blockquote>
<p>Finally each individual &lt;span&gt; is given a position over the image:</p>
<blockquote><p>a.person span.jon { top:35px; left:72px; }<br />
a.person span.leonie { top:39px; left:157px; }<br />
a.person span.andy { top:30px; left:240px; }</p></blockquote>
<p>And there it is, a simple way of using CSS to annotate your photos, Facebook style.</p>
]]></content:encoded>
			<wfw:commentRss>http://stormdamage.org/uses-for-css-tooltips-images/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Tooltips using CSS only, no Javascript</title>
		<link>http://stormdamage.org/tooltips-using-css-only-no-javascript/</link>
		<comments>http://stormdamage.org/tooltips-using-css-only-no-javascript/#comments</comments>
		<pubDate>Tue, 01 Jul 2008 19:44:31 +0000</pubDate>
		<dc:creator>Leonie</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[tooltip]]></category>

		<guid isPermaLink="false">http://stormdamage.org/?p=10</guid>
		<description><![CDATA[Here’s a nice easy method for making link tooltips entirely in CSS, without any Javascript. For a demonstration of what I mean, hover over this link  This is a tooltip.  with your mouse.
To do this, you will need to create a class for the links which require tooltips, and a &#60;span&#62; within that [...]]]></description>
			<content:encoded><![CDATA[<p>Here’s a nice easy method for making link tooltips entirely in CSS, without any Javascript. For a demonstration of what I mean, <a class="tooltiplink" href="javascript:void;">hover over this link <span> This is a tooltip. </span></a> with your mouse.</p>
<p>To do this, you will need to create a class for the links which require tooltips, and a <strong>&lt;span&gt;</strong> within that link to include the tooltip text:</p>
<blockquote><p>&lt;a class=&#8221;tooltiplink&#8221; href=&#8221;#&#8221;&gt;this is a link&lt;span&gt; This is a tooltip&lt;/span&gt;&lt;/a&gt;</p></blockquote>
<p>I have put some spaces inside the tooltip span on both sides, so those with CSS turned off don’t view the link and tooltip text as being scrunched together.</p>
<p>Then add the following styling:<span id="more-10"></span></p>
<blockquote><p>a.tooltiplink span {display:none; }<br />
a.tooltiplink:hover span { display:inline; position:absolute; padding:5px; color:#0c0; background-color:#eee; border:1px solid #000; text-decoration:none; }</p></blockquote>
<p>The first line ensures the tooltip <strong>&lt;span&gt;</strong> is hidden, the second line reveals the <strong>&lt;span&gt;</strong> when the link is hovered over. It does this by switching the ‘display’ from ‘none’ to ‘inline’. The second line also adds some visual styling such as padding, text colour, background colour, and a border. Finally it adds ‘text-decoration:none’, so it does not inherit the underline from the link.</p>
<p>However, There is still a little tweak we need to apply to this CSS, as IE 6 has problems rendering the tooltips. This is easily fixed by adding a font-size to the hover:</p>
<blockquote><p>a.tooltiplink:hover { font-size:100%; } /* IE6 fix */</p></blockquote>
<p>I am not sure why this works, as setting the font-size shouldn’t make any difference at all. Suffice to say IE 6 is full of unique little quirks!</p>
<p>So there you have it, tooltips with no Javascript involved.</p>
<p><strong>EDIT:</strong> You can see some creative uses for trick this here &#8211; <a href="/uses-for-css-tooltips-images/">CSS tooltips and images</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://stormdamage.org/tooltips-using-css-only-no-javascript/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>Two methods of replacing text with an image in CSS</title>
		<link>http://stormdamage.org/two-methods-of-replacing-text-with-an-image-in-css/</link>
		<comments>http://stormdamage.org/two-methods-of-replacing-text-with-an-image-in-css/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 15:54:50 +0000</pubDate>
		<dc:creator>Leonie</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://stormdamage.org/?p=8</guid>
		<description><![CDATA[This is something I get asked about from time to time. The aim is to have some text which is there in the code, but is hidden when viewing the page.
You may be wondering why replacing images with text could be useful. The reasons are twofold. The first reason is to improve your site&#8217;s SEO [...]]]></description>
			<content:encoded><![CDATA[<p>This is something I get asked about from time to time. The aim is to have some text which is there in the code, but is hidden when viewing the page.</p>
<p>You may be wondering why replacing images with text could be useful. The reasons are twofold. The first reason is to improve your site&#8217;s SEO (Search Engine Optimisation). Having a <strong>&lt;h1&gt;</strong> title makes it easier for spiders to correctly categorise your page, and a relevant and well-worded tag can improve the page&#8217;s ranking. However, for reasons of aesthetics, it&#8217;s often nicer to have an image as the header, perhaps with a unique font, or your company&#8217;s logo. Rather than have this potentially comprise your page rankings, it makes sense to use CSS as an easy way of having a nice looking page and good SEO.</p>
<p>The second reason is to enable accessibility, to maximise the amount of users who are able to make full use of your site. Pages which rely entirely on images for headers and menus are hard to navigate in text-only browsers. This may mean those with  screenreaders have difficulty accessing your content.<span id="more-8"></span></p>
<p>So how do we go about it? Making the text invisible on the background image with &#8216;display:none&#8217; would be counted as a potentially devious cloaking method by Google and penalised. This is because it attempts to entirely hide page content from the user. Instead there are two ways we can achieve it:</p>
<p>1. This method is the one I&#8217;ve seen most commonly used. Rather than hide the text, it places it far off the left hand side of the screen, where it cannot be seen (except by people with really really big monitors!). The title tag is then given the same dimensions as the image which will replace it:</p>
<blockquote><p>&lt;h1 id=&#8221;replace&#8221;&gt;The Title Goes Here&lt;/h1&gt;</p>
<p>#replace { text-indent: -9000px; background:url(title.gif) no-repeat; width:200px; height:100px; }</p></blockquote>
<p>I personally am not a big fan of this method, it seems like &#8216;dirty&#8217; CSS to me, putting a large negative indent on an element. Though it does seem to work in nearly all browsers with the exception of IE 5, though I understand there are some workarounds for this.</p>
<p>2. This next one is my favoured method, and the one I most commonly use. The thinking behind this one is to cover the text with an image inside an absolutely positioned <strong>&lt;span&gt;</strong>. Both the span and the title tag are given the same dimensions at the image, so they take up the same space on the page :</p>
<blockquote><p>&lt;h1 id=&#8221;replace&#8221;&gt;The Title Goes Here&lt;span&gt;&lt;/span&gt;&lt;/h1&gt;</p>
<p>#replace { position:relative; margin:0; padding:0; width:200px; height:100px; }<br />
#replace span { position:absolute; top:0; left:0; background:url(title.gif) no-repeat; width:200px; height:100px; }<br />
#replace, #replace span { width:200px; height:100px; }</p></blockquote>
<p>Because the image gets its absolute positioning from the parent element, when aligned to the top and left, it sits nicely over the text. However, there are a few slight problems with this in older versions of Opera, which can be solved simply by  adding a z-index to the span selector above:</p>
<blockquote><p>#replace span { position:absolute; display:block; top:0; left:0;<strong> </strong>z-index:1; }</p></blockquote>
<p>Of course the problem with both of these methods is that you don&#8217;t get to use the &#8216;alt&#8217; or &#8216;title&#8217; tags on your images (which is good SEO practise), but I think this is outweighed by the benefits of having relevant <strong>&lt;h1&gt;</strong> tags, which are more significant anyway.</p>
]]></content:encoded>
			<wfw:commentRss>http://stormdamage.org/two-methods-of-replacing-text-with-an-image-in-css/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
