<?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>Designers Chair &#187; facebook</title>
	<atom:link href="http://www.designers-chair.com/tag/facebook/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.designers-chair.com</link>
	<description>photoshop tutorials, html css tutorials</description>
	<lastBuildDate>Sat, 05 Dec 2009 22:18:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Facebook picture tagging system</title>
		<link>http://www.designers-chair.com/2009/03/facebook-picture-tagging-system/</link>
		<comments>http://www.designers-chair.com/2009/03/facebook-picture-tagging-system/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 07:59:28 +0000</pubDate>
		<dc:creator>Designers Chair</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[facebook]]></category>

		<guid isPermaLink="false">http://www.designers-chair.com/?p=278</guid>
		<description><![CDATA[Create Facebook-like picture tagging system using only CSS.

Facebook might look minimalistic on the outside but it&#8217;s a beast from the inside. I don&#8217;t know how they did their &#8220;cross over a person to see his name&#8221; tagging system but i&#8217;m going to show you how to fake it. Who knows, maybe they use the same [...]]]></description>
			<content:encoded><![CDATA[<p>Create Facebook-like picture tagging system using only CSS.<span id="more-278"></span></p>
<pre><a href="http://www.designers-chair.com/download/css/CSS - facebook image tag (www.designers-chair.com).rar" target="_blank"><img class="alignleft" style="border: 0pt none;" title="Source" src="http://www.designers-chair.com/images/css/Source.jpg" alt="" width="187" height="62" /></a><a href="http://www.designers-chair.com/demo/facebook_image_tag/" target="_blank"><img class="alignright" style="border: 0pt none;" title="Demo" src="http://www.designers-chair.com/images/css/Demo.jpg" alt="" width="270" height="62" /></a></pre>
<p>Facebook might look minimalistic on the outside but it&#8217;s a beast from the inside. I don&#8217;t know how they did their &#8220;cross over a person to see his name&#8221; tagging system but i&#8217;m going to show you how to fake it. Who knows, maybe they use the same technique (yeah right).<br />
<script type="text/javascript"><!--
google_ad_client = "pub-9392223937717562";
/* Link_na_pocetku */
google_ad_slot = "0581975753";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p style="font-family:arial;color:#282828;font-size:24px"><strong>Step 1</strong></p>
<p>First let&#8217;s create <em>index.html</em> and folders <em>style</em> and <em>images</em>. Inside of <em>style</em> folder put your CSS file (name it <em>style.css</em>) and put your image inside off <em>images</em> folder. I will use this picture named <em>foto.jpg</em>.</p>
<p>Open <em>index.html</em> and write down the basic HTML code.</p>
<pre>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Facebook picture tagging system | Designers-Chair.com&lt;/title&gt;
&lt;link href="style/style.css" rel="stylesheet" type="text/css" /&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;/body&gt;
&lt;/html&gt;</pre>
<p>We are going to use HTML tags <strong>dl</strong> and <strong>dd</strong> so if you aren&#8217;t familiar with them i recommend you google it up.</p>
<p style="font-family:arial;color:#282828;font-size:24px"><strong>Step 2</strong></p>
<p>Add the following code to the <strong>body</strong> of your HTML file.</p>
<pre>...
&lt;dl id="heads"&gt;
&lt;dd id="JaneDoe"&gt;&lt;a href="link"&gt;&lt;span&gt;Jane Doe&lt;/span&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;dd id="LucyLiu"&gt;&lt;a href="link"&gt;&lt;span&gt;Lucy Liu&lt;/span&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;dd id="JackBauer"&gt;&lt;a href="link"&gt;&lt;span&gt;Jack Bauer&lt;/span&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;dd id="JohnSmith"&gt;&lt;a href="link"&gt;&lt;span&gt;John Smith&lt;/span&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
...</pre>
<p>OK, that&#8217;s it for our <em>index.html</em> file. It&#8217;s all CSS from now on. Just to explain few things first. The <strong>&lt;dl&gt; tag</strong> defines a definition list. In our case that&#8217;s <strong>heads</strong>.</p>
<pre>&lt;dl id="heads"&gt;
...
&lt;/dl&gt;</pre>
<p><strong>&lt;dd&gt; tag</strong> describes the item in the list. In our case items are people on the photo.</p>
<pre>&lt;dd id="JaneDoe"&gt;&lt;a href="link"&gt;&lt;span&gt;Jane Doe&lt;/span&gt;&lt;/a&gt;&lt;/dd&gt;</pre>
<p><strong>JaneDoe</strong> is the name of the identificator and <strong>Jane Doe</strong> is the name of the person that will be displayed. Don&#8217;t mix those two! Under <em>href=&#8221;link&#8221;</em> you can put the actual URL of that persons web page. If not put &#8220;#&#8221; instead.</p>
<p style="font-family:arial;color:#282828;font-size:24px"><strong>Step 3</strong></p>
<p>Now CSS. Open <em>style.css</em> and let&#8217;s get started. Set the font to 11px Tahoma and background color to white.</p>
<pre>body{
	font-family: Tahoma;
	font-size: 11px;
	background-color: #FFFFFF;
}</pre>
<p>Remember that <strong>heads</strong> ID in our HTML file? Let&#8217;s define it.</p>
<pre>dl#heads{
	background: url(../images/foto.jpg);
	height: 353px;
	width: 530px;
	position: relative;
}</pre>
<p>Under <em>width</em> and <em>height</em> put the dimensions of your photo. Now we need to define basic properties for our <strong>&lt;dd&gt; tag</strong>. Just some position definitions and that&#8217;s it.</p>
<pre>dd{
margin: 0;
padding: 0;
position: absolute;
}</pre>
<p>Next we &#8220;describe&#8221; the item (person) in the list. I will show you how to do this for one person (in this case the guy on the left, let&#8217;s call him &#8220;John Smith&#8221;) and then you can apply the same procedure for the others.</p>
<p>I hope you have IrfanView, if you don&#8217;t i recommend you install it. This can be done without it but it takes longer. Look at the following photo.</p>
<p><img class="aligncenter" title="X spot" src="http://www.designers-chair.com/images/css/02_facebook/X_spot.jpg" alt="" width="530" height="353" /></p>
<p>You need to find exact location of X and for that i will use IrfanView. Open the foto using IrfanView and select the head of a person like you select multiple icons on desktop. Click on the upper right side of persons head and drag down while holding down the left mouse button. When his head is selected read the following values.</p>
<p><img class="aligncenter" title="IrfanView" src="http://www.designers-chair.com/images/css/02_facebook/IrfanView.jpg" alt="" width="543" height="442" /></p>
<p>This may look confusing but it&#8217;s actually really simple. Now let&#8217;s input the location of X. IrfanView first displays &#8220;left&#8221; value and then &#8220;top&#8221; value.</p>
<pre>dd#JohnSmith{
left: 5px;
top: 5px;
}</pre>
<p>Now the size of the box :</p>
<pre>dd#JohnSmith a{
position: absolute;
width: 128px;
height: 132px;
text-decoration: none;  /*no underline*/
}</pre>
<p>If you refresh your HTML file now you will see that the name &#8220;John Smith&#8221; id displayed under John&#8217;s head. We don&#8217;t need that so let&#8217;s just hide it.</p>
<pre>dd#JohnSmith a span{
display: none;
}</pre>
<p>That&#8217;s it, the text is gone. We need it to display when we move cursor over the invisible box (persons head) so we will use hover function for that.</p>
<pre>dd#JohnSmith a:hover span{
	display: block;
	text-indent: 0;
	vertical-align: top;
	color: #FFFFFF;
	background-color: #282828;
	font-weight: bold;
	position: absolute;
	bottom: 100%;
	margin: 0;
	padding: 5px;
	width: 53px;
}</pre>
<p>Don&#8217;t worry, we are finished. Just to explain the last part.</p>
<p>We set the font color to white (color: #FFFFFF), bold it (font-weight: bold), put it on grey background (background-color: #282828).</p>
<p style="font-family:arial;color:#282828;font-size:24px"><strong>IE 6 fix</strong></p>
<p>IE sucks, right? So we need to add this to our CSS to make it work.</p>
<pre>dd#JohnSmith a:hover{
background: no-repeat;
}</pre>
<p>That&#8217;s it! Hope you have enjoyed this tutorial, leave a comment if you did!<br />
<script type="text/javascript"><!--
google_ad_client = "pub-9392223937717562";
/* Embedani */
google_ad_slot = "9865879433";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.designers-chair.com/2009/03/facebook-picture-tagging-system/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>
