<?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>Random Web Development Related Blogging &#187; Tips &amp; Tricks</title>
	<atom:link href="http://cfreek.com/category/web-development/tips-tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://cfreek.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Tue, 26 Apr 2011 19:18:35 +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>Link Will Not z-index in Front of Text and Image in Internet Explorer</title>
		<link>http://cfreek.com/2009/11/link-will-not-z-index-in-front-of-text-and-image-in-internet-explorer/</link>
		<comments>http://cfreek.com/2009/11/link-will-not-z-index-in-front-of-text-and-image-in-internet-explorer/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 05:20:12 +0000</pubDate>
		<dc:creator>Alan Cook</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://cfreek.com/blog/?p=43</guid>
		<description><![CDATA[I ran across a interesting IE issue today, that I hadn&#8217;t dealt with before. I wanted to make icons with graphics, text, and a link. The link should cover the whole icon, but it&#8217;s link would be text inside of the icon. To elaborate, the final result would be: The&#8221;Text Link&#8221; shoud be positioned using absolute positing, [...]]]></description>
			<content:encoded><![CDATA[<p>I ran across a interesting IE issue today, that I hadn&#8217;t dealt with before.<br />
I wanted to make icons with graphics, text, and a link. The link should cover the whole icon, but it&#8217;s link would be text inside of the icon.</p>
<p>To elaborate, the final result would be:</p>
<p><img class="alignnone size-full wp-image-54" title="icon-example" src="http://cfreek.com/blog/wp-content/uploads/2009/11/icon-example.jpg" alt="icon-example" width="274" height="76" /></p>
<p>The&#8221;Text Link&#8221; shoud be positioned using absolute positing, height, width, and padding/margins so that it over-layed the entire icon.</p>
<p><span id="more-43"></span></p>
<p>The HTML would look like this:</p>
<p>[php]<br />
&lt;div class=&quot;services-box&quot;&gt;<br />
&lt;a class=&quot;link-mask&quot; href=&quot;/services/network-maintenance/&quot;&amp;&gt;Managed Services&lt;/a&gt;<br />
&lt;div&gt;&lt;img src=&quot;/images/pc-1.png&quot; alt=&quot;&quot; width=&quot;77&quot; height=&quot;78&quot; /&gt;&lt;/div&gt;<br />
managed services text<br />
&lt;/div&gt;[/php]</p>
<p>Initially, I set up the CSS as follows:</p>
<p>[css].services-box a.link-mask {<br />
position: absolute;<br />
width: 290px;<br />
height: 83px;<br />
text-decoration: none;<br />
font-weight: bold;<br />
color: #fff;<br />
padding: 4px 0 0 112px;<br />
z-index: 2;<br />
}[/css]</p>
<p>This worked great in every browser I tried, except for IE. It seem Internet Explorer will not let a simple link cover another element. As you can see, I attempted setting the z-index value, which did not work. Hovering over the image ([image]) or text( &#8220;Additional text&#8221;) still produced a default/text icon and was not a link.</p>
<p>I also attempted using hasLayout hacks, by adding the zoom css property to the link, and that did not work.</p>
<p>After Googling the heck out of this and not finding a solution, which is why I&#8217;m making a post out of it, I started playing.</p>
<p>The solution?<br />
If a background is applied to the link, Internet Explorer will force the link to be on top of text and on top of images. Since I did not want a background, as it would cover the other elements, I came up with a little hack.</p>
<p>I added the following css to my link&#8217;s CSS</p>
<p>[css]background-image: url(/images/services-boxes.png);<br />
background-repeat: no-repeat;<br />
background-position: 999px;[/css]</p>
<p>What this did, was make IE *think* there was a background, and position it over the text and image, while pushing the non-repeated image far away from the viewable area. I used the background image of the icon itself, which prevented the browser from having to load another image.</p>
<p>The icons now work perfect in every browser, including the pesky IE.</p>
]]></content:encoded>
			<wfw:commentRss>http://cfreek.com/2009/11/link-will-not-z-index-in-front-of-text-and-image-in-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

