<?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>phoenixheart - portfolio &#38; more &#187; Design</title>
	<atom:link href="http://www.phoenixheart.net/category/design/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phoenixheart.net</link>
	<description>phoenixheart - portfolio &#38; more</description>
	<lastBuildDate>Wed, 23 Mar 2011 09:47:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
	<script type="text/javascript">
if (typeof Meebo == "undefined") {
Meebo=function(){(Meebo._=Meebo._||[]).push(arguments)};
(function(q){

	var args = arguments;
	if (!document.body) { return setTimeout(function(){ args.callee.apply(this, args) }, 100); }
	var d=document, b=d.body, m=b.insertBefore(d.createElement('div'), b.firstChild); s=d.createElement('script');
	m.id='meebo'; m.style.display='none'; m.innerHTML='<iframe id="meebo-iframe"></iframe>';
	s.src='http'+(q.https?'s':'')+'://'+(q.stage?'stage-':'')+'cim.meebo.com/cim/cim.php?network='+q.network;
	b.insertBefore(s, b.firstChild);

})({network:'phoenixheartnet_bo16we'});	}</script>	<item>
		<title>Social Sketches &#8211; a free icon set released for Six Revisions</title>
		<link>http://www.phoenixheart.net/2010/01/social-sketches-a-free-icon-set-released-for-six-revisions/</link>
		<comments>http://www.phoenixheart.net/2010/01/social-sketches-a-free-icon-set-released-for-six-revisions/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 02:08:30 +0000</pubDate>
		<dc:creator>An</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Freebies]]></category>

		<guid isPermaLink="false">http://www.phoenixheart.net/?p=435</guid>
		<description><![CDATA[Today I&#8217;m so pleased to announce the release of Social Sketches, my hand-drawn icon set exclusively done for Six Revisions. Initially it was made for Referrer Detector on my just-started sketch project The Daily Faces, but then I decided to make it available for public use, hence the featuring on Six Revisions yesterday. Here is [...]]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;m so pleased to announce the release of Social Sketches, my hand-drawn icon set exclusively done for Six Revisions. Initially it was made for Referrer Detector on my just-started sketch project <a href="http://dai.lyfaces.com">The Daily Faces</a>, but then I decided to make it available for public use, hence <a href="http://sixrevisions.com/freebies/icons/social-sketches-exclusive-free-hand-sketched-icon-set/">the featuring on Six Revisions</a> yesterday.</p>
<p>Here is the preview of the set:</p>
<p><img class="shot" title="Social Sketches Preview" src="/wp-content/uploads/2010/01/social-sketches-preview.jpg" alt="" width="435" height="512" /></p>
<p>For more information and download, please head to <a href="http://sixrevisions.com/freebies/icons/social-sketches-exclusive-free-hand-sketched-icon-set/">Six Revisions&#8217; post</a>.</p>
<p>P.S. I have a plan to add some more icons into the set, so stay tuned <img src='http://www.phoenixheart.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<img style='display:none' id="post-435-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.phoenixheart.net/2010/01/social-sketches-a-free-icon-set-released-for-six-revisions/',title:'Social Sketches &#8211; a free icon set released for Six Revisions',tweet:'Today I&#8217;m so pleased to announce the release of Social Sketches, my hand-drawn icon set exclus',description:'Today I&#8217;m so pleased to announce the release of Social Sketches, my hand-drawn icon set exclus'})"><script type='text/javascript'>document.getElementById("post-435-blankimage").onload();</script>]]></content:encoded>
			<wfw:commentRss>http://www.phoenixheart.net/2010/01/social-sketches-a-free-icon-set-released-for-six-revisions/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>How I made use of WordPress &#8220;sticky posts&#8221; feature</title>
		<link>http://www.phoenixheart.net/2008/12/how-i-made-use-of-wordpress-sticky-posts-feature/</link>
		<comments>http://www.phoenixheart.net/2008/12/how-i-made-use-of-wordpress-sticky-posts-feature/#comments</comments>
		<pubDate>Wed, 31 Dec 2008 09:08:22 +0000</pubDate>
		<dc:creator>An</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.phoenixheart.net/?p=181</guid>
		<description><![CDATA[As you may have already known, WordPress 2.7 introduces a lot of new features, among them are the hierarchical comment system, a brand new admin panel, and most interesting (for me) the ability to make a post &#8220;sticky&#8221;. This concept of sticky posts is not new, in fact it&#8217;s been around quite a while in [...]]]></description>
			<content:encoded><![CDATA[<p><span class="drop-cap">A</span>s you may have already known, WordPress 2.7 introduces a lot of new features, among them are the hierarchical comment system, a brand new admin panel, and most interesting (for me) the ability to make a post &#8220;sticky&#8221;. This concept of sticky posts is not new, in fact it&#8217;s been around quite a while in forums and bulletin boards, but now it&#8217;s the first time we see it in blog world. Need I say how useful it is?</p>
<p>So, yesterday I came up with this idea: making use of &#8220;sticky posts&#8221; to stick something called &#8220;best verses&#8221; or &#8220;most refined verses&#8221; for my <a href="http://www.thica.net">Thica.net</a> which is dedicated to poetry. As its name tells, this special post is not a poem as normal ones, but contains some best verses (chosen by me <img src='http://www.phoenixheart.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ) only, and its content should be changed once every day or so. For this special mission, it should be decorated different to catch the eyes of users. After some hours playing with Photoshop, this is what I got:</p>
<p><img class="shot" src="/wp-content/uploads/2008/12/sticky-design.gif" alt="Sticky Post - Design" width="459" height="359" /><span id="more-181"></span></p>
<p>Then, I created a new post and marked it as &#8220;sticky&#8221;. This way, any query_posts() call will include it on the top.</p>
<p><a href="/wp-content/uploads/2008/12/sticky-edit.gif"><img class="shot" src="/wp-content/uploads/2008/12/sticky-edit.gif" alt="Sticky Post - Edit" width="500" /></a></p>
<p>You may notice, as this is a special post, I don&#8217;t need/want any comments and pings for it.</p>
<p>Now go to the code. Before any modification were made, the loop in my theme&#8217;s home.php page looks like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span>
    <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span>
        the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #666666; font-style: italic;">// html to display the post (poems) here...</span>
    <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Now, for the sticky guy to come in on stage, I modified those lines a bit:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span>
    <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span>
        the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>is_sticky<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span>
            <span style="color: #666666; font-style: italic;">// specially html to that applies for the sticky post</span>
        <span style="color: #b1b100;">else</span> <span style="color: #339933;">:</span>
            <span style="color: #666666; font-style: italic;">// html to display the NORMAL post (poems) here...</span>
        <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>The condition tag is_sticky() tells us if the current post is sticky or not, and we decorate it respectively. In fact there&#8217;s another (more professional) way for this: using the new post_class() function. Calling this function inside the loop will generate some HTML code like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;">class=&quot;post sticky category-cat category-pets tags-dogsandcats&quot;</pre></td></tr></table></div>

<p>This comes very handy when you want full control over the CSS styles of each and every post you have. In this example, you may define these styles in your css:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.category-cat</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #808080; font-style: italic;">/* let's say you want a specific background image for the posts inside &quot;Cat&quot; category */</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'/images/bgr-cat.gif'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.category-dog</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #808080; font-style: italic;">/* and a different one for &quot;Dog&quot; */</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'/images/bgr-dog.jpg'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>And, of course, in my case:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.sticky</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #808080; font-style: italic;">/* whatever and however I want the sticky post to be */</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>So after all those changes, I tested everything on my localhost and push them LIVE. The final result isn&#8217;t that bad <img src='http://www.phoenixheart.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> : <a href="http://www.thica.net">http://www.thica.net</a></p>
<p>Now all I have to do is just updating that sticky post everyday with some good verses. One sticky post saves me tons of time, and opens endless customizations ahead. There&#8217;s indeed no limitation for those darn creative minds there at WordPress!</p>
<img style='display:none' id="post-181-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.phoenixheart.net/2008/12/how-i-made-use-of-wordpress-sticky-posts-feature/',title:'How I made use of WordPress &#8220;sticky posts&#8221; feature',tweet:'As you may have already known, WordPress 2.7 introduces a lot of new features, among them are the hi',description:'As you may have already known, WordPress 2.7 introduces a lot of new features, among them are the hi'})"><script type='text/javascript'>document.getElementById("post-181-blankimage").onload();</script>]]></content:encoded>
			<wfw:commentRss>http://www.phoenixheart.net/2008/12/how-i-made-use-of-wordpress-sticky-posts-feature/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Make your site *look* pro with simple CSS techniques</title>
		<link>http://www.phoenixheart.net/2008/10/make-your-site-look-pro-with-simple-css-techniques/</link>
		<comments>http://www.phoenixheart.net/2008/10/make-your-site-look-pro-with-simple-css-techniques/#comments</comments>
		<pubDate>Sat, 25 Oct 2008 15:11:45 +0000</pubDate>
		<dc:creator>An</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.phoenixheart.net/?p=74</guid>
		<description><![CDATA[Big things are created with tiny bits, that&#8217;s what I hear them say. It can&#8217;t be more correct with web design &#8211; a small detail can change the whole site. In this article (and more to come) I will introduce some small CSS techniques that can make your site look pro &#8211; I must emphasize [...]]]></description>
			<content:encoded><![CDATA[<p><span class="drop-cap">B</span>ig things are created with tiny bits, that&#8217;s what I hear them say. It can&#8217;t be more correct with web design &#8211; a small detail can change the whole site. In this article (and more to come) I will introduce some small <abbr title="Cascading Style Sheets">CSS</abbr> techniques that can make your site <em>look</em> pro &#8211; I must emphasize the word, since it&#8217;s all about visual effects. After all, it&#8217;s always the content that matters.</p>
<h3>Photograph-like images</h3>
<p>Here is what&#8217;s *very* often used to make a photo look like a &#8211; erm &#8211; photo:</p>
<p><img class="shot" title="Boat" src="/wp-content/uploads/2008/10/boat.jpg" alt="" /></p>
<p>And here is the DEAD SIMPLE style applied:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.entry-extended</span> img<span style="color: #6666ff;">.shot</span>
<span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">6px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>As you can see, we simply use a white background color, increase the padding value, and add a thin solid border. Change the style a bit to get what you want. <span id="more-74"></span>Something like:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.entry-extended</span> img<span style="color: #6666ff;">.shot</span>
<span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* A black background */</span>
    <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">12px</span> <span style="color: #933;">12px</span> <span style="color: #933;">24px</span> <span style="color: #933;">24px</span> <span style="color: #808080; font-style: italic;">/* To make the bottom &quot;border&quot; stand out*/</span>
    <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>will produce this:</p>
<p><img style="background: #000; padding: 12px 12px 24px 12px; border: 1px solid #ccc; " src="/wp-content/uploads/2008/10/sunset.jpg" alt="" /></p>
<p>There are definitely rooms to improve for this effect (like a drop shadow), but to me it&#8217;s enough most of the time.</p>
<h3>Stylish horizontal rules</h3>
<p>Yes, everyone know about the &lt;hr /&gt; tag and what it&#8217;s used for. Here is a horizontal rule at its natural form:</p>
<hr />
<p>Nothing but a thin gray/black line across your screen. Isn&#8217;t it ugly? Now consider this horizontal rule being used at my <a href="http://thica.net">Thica.net</a>:</p>
<div style="margin: 10px auto; background: transparent url(/wp-content/uploads/2008/10/bb_hr.jpg) no-repeat scroll center center; height: 40px;">
<hr style="display:none" /></div>
<p>Much cooler eh? Here is what helped:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">div<span style="color: #6666ff;">.hr</span>
<span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/bb_hr.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">40px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
div<span style="color: #6666ff;">.hr</span> hr
<span style="color: #00AA00;">&#123;</span>
     <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>We wrapped the horizontal rule inside a div, hide it away, and style the div with a good-looking background image.</p>
<p>So why must we use a &lt;hr /&gt; tag here when it&#8217;s not displayed? Isn&#8217;t it redundant? Doesn&#8217;t a simple line-like image bring an exact result? The answer is: using &lt;hr /&gt; however is the <em>correct</em> way to divide a page&#8217;s content. And that&#8217;s where <abbr title="Search Engine Optimization">SEO</abbr> come into play.</p>
<h3><a href="http://en.wikipedia.org/wiki/Drop_cap">Drop caps</a> aka. Initials</h3>
<p>A drop cap is the first character in a (printed) paragraph that&#8217;s often way bigger and different from the remains. For example, the first letter B of this post is a drop cap. To create such an effect, the CSS I&#8217;m using is:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.drop-cap</span>
<span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span> <span style="color: #933;">5px</span> <span style="color: #933;">1px</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">6px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#737b7f</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#393b36</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">80px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">60px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> times<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Add this class into any &lt;span&gt; element will make it a drop cap, and your page look like a magazine. For example, this</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;drop-cap&quot;</span>&gt;</span>L<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>orem ipsum dolor sit amet, consectetuer adipiscing elit.
Nullam tincidunt. Vivamus blandit. Suspendisse potenti. Nullam vulputate,
enim sed mattis aliquet, tortor augue pretium tortor, id porta massa urna
id ante. Praesent urna magna, posuere a, facilisis egestas, lobortis a,
nibh. Phasellus nec neque. Maecenas tincidunt, dui ut vehicula vehicula,
nisi mauris hendrerit ligula, id facilisis magna elit sed erat.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span></pre></td></tr></table></div>

<p>will display:</p>
<p><span class="drop-cap">L</span>orem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam tincidunt. Vivamus blandit. Suspendisse potenti. Nullam vulputate, enim sed mattis aliquet, tortor augue pretium tortor, id porta massa urna id ante. Praesent urna magna, posuere a, facilisis egestas, lobortis a, nibh. Phasellus nec neque. Maecenas tincidunt, dui ut vehicula vehicula, nisi mauris hendrerit ligula, id facilisis magna elit sed erat.</p>
<p>P.S: There is a pseudo class called &#8220;first-letter&#8221;, but as far as I know it&#8217;s still buggy on both Firefox and <abbr title="Internet Explorer">IE</abbr>, so no bother.</p>
<h3>Rollover effects</h3>
<p>As mentioned in <a href="http://www.phoenixheart.net/2008/10/bad-practices-and-how-to-avoid-them-in-web-development/">one of my recent post</a>, we can <em>always</em> replace the oh-so-popular javascript rollover effect with a pure CSS solution.</p>
<p>The idea is, instead of attaching onmouseover and onmouseout events into the anchor elements, we use a &#8220;double&#8221; background image and some lines of CSS to do the trick. Here they are:</p>
<p><img src="/wp-content/themes/WordPressFun/images/rss.gif" alt="" /></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">a <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/rss.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* so that it can have a fixed width and height */</span>
    <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">65px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">65px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
a<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span> <span style="color: #933;">-65px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* half the height of the background image */</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>There, we have 2 states in one image: the top for &#8220;normal&#8221;, the bottom for &#8220;hovered&#8221;, each is 65px in height. When the mouse is over the link, the &#8220;hover&#8221; pseudo class will be activated, which simply brings the background image 65px to the top. This results in the &#8220;hovered&#8221; part being shown (and the &#8220;normal&#8221; becomes hidden), which creates a cool rollover effect. You can see the demo <abbr title="Really Simple Syndication">RSS</abbr> link right on this page &#8211; and be sure to subscribe <img src='http://www.phoenixheart.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</p>
<p>Now what I&#8217;m really convinced about this method is, since we have only one image, the effect is seamless &#8211; no need to wait for any &#8220;hover&#8221; image to be downloaded. And it&#8217;s Javascript-free, means I can rest assure about the user&#8217;s browser configuration.</p>
<h3>Enhanced &#8220;visited&#8221; links</h3>
<p>By default, a visited link will have a color of <span style="color: #551a8b;">#551a8b</span> (like in Google Search results for an example), with may look too simple or ugly. With CSS, you can decorate those links to be more impressive and stand out from normal ones, which is very good for user experience. In this example, we will mark the links with a &#8220;checked&#8221; icon on the right.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">a<span style="color: #3333ff;"><span style="color: #00AA00;">:</span>visited
</span><span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">padding-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">16px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Make some room for the icon */</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/bgr_visited.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">center</span> <span style="color: #000000; font-weight: bold;">right</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Tweak the positions */</span>
    <span style="color: #808080; font-style: italic;">/* other cool styles here */</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>You can tweak the position until get satisfied with the result. </p>
<p>Here is <a style="padding-right: 16px; background: url(/wp-content/uploads/2008/10/bgr_visited.gif) center right no-repeat;" href="/2008/10/make-your-site-look-pro-with-simple-css-techniques">the visited link</a> that I&#8217;ve come up with. Much better right? </p>
<h3>And more awaiting&#8230;</h3>
<p>These are just the most frequently used (by me) CSS techniques. More to come in the new features, when more complex tips and tricks will come into play.</p>
<img style='display:none' id="post-74-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.phoenixheart.net/2008/10/make-your-site-look-pro-with-simple-css-techniques/',title:'Make your site *look* pro with simple CSS techniques',tweet:'Big things are created with tiny bits, that&#8217;s what I hear them say. It can&#8217;t be more cor',description:'Big things are created with tiny bits, that&#8217;s what I hear them say. It can&#8217;t be more cor'})"><script type='text/javascript'>document.getElementById("post-74-blankimage").onload();</script>]]></content:encoded>
			<wfw:commentRss>http://www.phoenixheart.net/2008/10/make-your-site-look-pro-with-simple-css-techniques/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>My icons</title>
		<link>http://www.phoenixheart.net/2008/10/my-icons/</link>
		<comments>http://www.phoenixheart.net/2008/10/my-icons/#comments</comments>
		<pubDate>Fri, 24 Oct 2008 06:54:16 +0000</pubDate>
		<dc:creator>An</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Freebies]]></category>
		<category><![CDATA[icons]]></category>

		<guid isPermaLink="false">http://www.phoenixheart.net/?p=70</guid>
		<description><![CDATA[It was 3 years ago &#8211; how time flies &#8211; when I joined Wincustomize community. I was *very* deep into PC customization that time, especially Object Dock (so ashamed to admit I was using a cracked version of this great application). To make up my dock I was hunting PNG icons all the time, till [...]]]></description>
			<content:encoded><![CDATA[<p><span class="drop-cap">I</span>t was 3 years ago &#8211; how time flies &#8211; when I joined <a href="http://www.wincustomize.com">Wincustomize</a> community. I was *very* deep into PC customization that time, especially <a href="http://www.objectdock.com/">Object Dock</a> (so ashamed to admit I was using a cracked version of this great application). To make up my dock I was hunting PNG icons all the time, till that day when I decided to do something on my own.</p>
<p>So this was my first attempt &#8211; an icon for Alcohol 120%:</p>
<p><a href="http://phoenixheart.wincustomize.com/skins.aspx?skinid=8893&amp;libid=29"><img class="shot" title="Alcohol 120%" src="/wp-content/uploads/2008/10/8893.jpg" alt="Alcohol 120%" width="400" height="300" /></a></p>
<p>Not impressive at all, I know&#8230;</p>
<p>Some weeks after I came up with this idea: create a forum thread that accepts requests from people who are in need of a icon for their not-so-well-known application. &#8220;<a href="http://forums.wincustomize.com/96380">Rare Icon Request</a>&#8221; thread was born. Though I was too busy to continue my contribution in the thread and had to quit a while ago, the thread is still alive and kicking. Now it&#8217;s 3 year old, has 1832 replies in 74 pages, and provided hundreds of high quality icons totally free of charge. I&#8217;m happy <img src='http://www.phoenixheart.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Now I&#8217;m not making icons anymore, but still I have special sympathy for them&#8230;</p>
<p>Here are some icons I made in the good old times. All of my icons were done in Photoshop, with mouse and keyboard &#8211; till now I&#8217;ve never ever owned a tablet. <span id="more-70"></span></p>
<p><a href="http://phoenixheart.wincustomize.com/skins.aspx?skinid=8996&amp;libid=29"><img class="shot" title="DeskTask icon" src="/wp-content/uploads/2008/10/8996.jpg" alt="DeskTask icon" width="450" height="306" /></a></p>
<p><a href="http://phoenixheart.wincustomize.com/skins.aspx?skinid=8997&amp;libid=29"><img class="shot" title="Free Commander" src="/wp-content/uploads/2008/10/8997.jpg" alt="Free Commander" width="450" height="306" /></a></p>
<p><a href="http://phoenixheart.wincustomize.com/skins.aspx?skinid=8998&amp;libid=29"><img class="shot" title="ArcExplorer" src="/wp-content/uploads/2008/10/8998.jpg" alt="ArcExplorer" width="450" height="306" /></a></p>
<p><a href="http://phoenixheart.wincustomize.com/skins.aspx?skinid=9064&amp;libid=29"><img class="shot" title="Feeding Frenzy" src="/wp-content/uploads/2008/10/9064.jpg" alt="Feeding Frenzy" width="450" height="306" /></a></p>
<p><a href="http://phoenixheart.wincustomize.com/skins.aspx?skinid=9217&amp;libid=29"><img class="shot" title="GeForce" src="/wp-content/uploads/2008/10/9217.jpg" alt="GeForce" width="450" height="306" /></a></p>
<p><a href="http://phoenixheart.wincustomize.com/skins.aspx?skinid=9218&amp;libid=29"><img class="shot" title="PhatPad" src="/wp-content/uploads/2008/10/9218.jpg" alt="PhatPad" width="450" height="306" /></a></p>
<p><a href="http://phoenixheart.wincustomize.com/skins.aspx?skinid=11990&amp;libid=29"><img class="shot" title="Windows Live Messenger" src="/wp-content/uploads/2008/10/11990.jpg" alt="Windows Live Messenger" width="450" height="358" /></a></p>
<p>I&#8217;ve never been a professional icon designs, but I&#8217;m rather proud of my &#8220;children&#8221;. <a href="http://phoenixheart.wincustomize.com/">Here they are</a>.</p>
<p>Bonus: <a href="http://web.stardock.net/images/accounts/22/74/2274040/desktop.jpg">Here</a> is a screenshot of my desktop those days.</p>
<img style='display:none' id="post-70-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.phoenixheart.net/2008/10/my-icons/',title:'My icons',tweet:'It was 3 years ago &#8211; how time flies &#8211; when I joined Wincustomize community. I was *very*',description:'It was 3 years ago &#8211; how time flies &#8211; when I joined Wincustomize community. I was *very*'})"><script type='text/javascript'>document.getElementById("post-70-blankimage").onload();</script>]]></content:encoded>
			<wfw:commentRss>http://www.phoenixheart.net/2008/10/my-icons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bad practices (and how to avoid them) in web development</title>
		<link>http://www.phoenixheart.net/2008/10/bad-practices-and-how-to-avoid-them-in-web-development/</link>
		<comments>http://www.phoenixheart.net/2008/10/bad-practices-and-how-to-avoid-them-in-web-development/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 07:40:15 +0000</pubDate>
		<dc:creator>An</dc:creator>
				<category><![CDATA[Client stuffs]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.phoenixheart.net/?p=47</guid>
		<description><![CDATA[(Yet another post taken from the ruins of Tekaboo) Whether you are a web designer or a server side guy, there are certain times when you must get your hands dirty with HTML codes. Since HTML is rich, and even getting richer with the coming HTML 5, many HTML coders tend to do it improperly [...]]]></description>
			<content:encoded><![CDATA[<p>(Yet another post taken from the ruins of <a href="http://tekaboo.com">Tekaboo</a>)</p>
<p><span class="drop-cap">W</span>hether you are a web designer or a server side guy, there are certain times when you must get your hands dirty with HTML codes. Since HTML is rich, and even getting richer with the coming <a href="http://en.wikipedia.org/wiki/HTML_5">HTML 5</a>, many HTML coders tend to do it improperly to achieve what could have done differently (and better). This results in many bad habits that should be avoided.</p>
<h3>Table designing</h3>
<p><img class="shot" title="An internet with tables " src="http://www.phoenixheart.net/wp-content/uploads/2008/10/table.gif" alt="tabletrtd.inter.net" width="478" height="149" /></p>
<p>No, tables just won’t die (soon), and I’m not insisting them to. They will live happily so long as this internet still has some tabular data to display, or until W3C decides to replace “table” by “chair” which obviously sounds cooler for developers to write.However, for those who are still using tables to align the paragraphs, links, images, and other HTML objects out there, please dust away the cells and begin playing around with CSS design. There are some very good reasons why:</p>
<ul>
<li>Codes with table design are almost totally unreadable compared to CSS design</li>
<li>Tables increase your page’s file size significantly in most cases</li>
<li>Table design means more work for the browser, especially when you have nested tables (as most of table designers do)</li>
<li>Finally, regardless of all those conservative heads out there, with all of its advantages, CSS design is the future of the web. Take a look around, now every design job posted on every freelance site includes this line: MUST BE IN CSS AND NOT TABLES, sometimes with 3 or more exclamation marks (!) following.</li>
</ul>
<p>So, don’t be easy to yourself. In your next project, begin CSS. Don’t let tables’ “ease of use” prevent you from following the standard. Anyway, who told you that designing using CSS was <em>that </em>difficult to learn?<span id="more-47"></span></p>
<h3>Relying on Javascript</h3>
<p>I bet that you’ve seen this bunch of codes more than once:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/JavaScript&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;!--</span>
<span style="color: #003366; font-weight: bold;">function</span> MM_swapImgRestore<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//v3.0</span>
    <span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">,</span>x<span style="color: #339933;">,</span>a<span style="color: #339933;">=</span>document.<span style="color: #660066;">MM_sr</span><span style="color: #339933;">;</span> <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>a<span style="color: #339933;">&amp;&amp;</span>i<span style="color: #339933;">&lt;</span>a.<span style="color: #660066;">length</span><span style="color: #339933;">&amp;&amp;</span><span style="color: #009900;">&#40;</span>x<span style="color: #339933;">=</span>a<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&amp;&amp;</span>x.<span style="color: #660066;">oSrc</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> x.<span style="color: #660066;">src</span><span style="color: #339933;">=</span>x.<span style="color: #660066;">oSrc</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> 
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> MM_preloadImages<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//v3.0</span>
    <span style="color: #003366; font-weight: bold;">var</span> d<span style="color: #339933;">=</span>document<span style="color: #339933;">;</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>d.<span style="color: #660066;">images</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>d.<span style="color: #660066;">MM_p</span><span style="color: #009900;">&#41;</span> d.<span style="color: #660066;">MM_p</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">,</span>j<span style="color: #339933;">=</span>d.<span style="color: #660066;">MM_p</span>.<span style="color: #660066;">length</span><span style="color: #339933;">,</span>a<span style="color: #339933;">=</span>MM_preloadImages.<span style="color: #660066;">arguments</span><span style="color: #339933;">;</span> <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>a.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>a<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">!=</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> d.<span style="color: #660066;">MM_p</span><span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> Image<span style="color: #339933;">;</span> d.<span style="color: #660066;">MM_p</span><span style="color: #009900;">&#91;</span>j<span style="color: #339933;">++</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">src</span><span style="color: #339933;">=</span>a<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span> 
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> MM_findObj<span style="color: #009900;">&#40;</span>n<span style="color: #339933;">,</span> d<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//v4.01</span>
  <span style="color: #003366; font-weight: bold;">var</span> p<span style="color: #339933;">,</span>i<span style="color: #339933;">,</span>x<span style="color: #339933;">;</span>  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>d<span style="color: #009900;">&#41;</span> d<span style="color: #339933;">=</span>document<span style="color: #339933;">;</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>p<span style="color: #339933;">=</span>n.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;?&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&gt;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">&amp;&amp;</span>parent.<span style="color: #660066;">frames</span>.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    d<span style="color: #339933;">=</span>parent.<span style="color: #660066;">frames</span><span style="color: #009900;">&#91;</span>n.<span style="color: #660066;">substring</span><span style="color: #009900;">&#40;</span>p<span style="color: #339933;">+</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">document</span><span style="color: #339933;">;</span> n<span style="color: #339933;">=</span>n.<span style="color: #660066;">substring</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span>p<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span>x<span style="color: #339933;">=</span>d<span style="color: #009900;">&#91;</span>n<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&amp;&amp;</span>d.<span style="color: #660066;">all</span><span style="color: #009900;">&#41;</span> x<span style="color: #339933;">=</span>d.<span style="color: #660066;">all</span><span style="color: #009900;">&#91;</span>n<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;!</span>x<span style="color: #339933;">&amp;&amp;</span>i<span style="color: #339933;">&lt;</span>d.<span style="color: #660066;">forms</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> x<span style="color: #339933;">=</span>d.<span style="color: #660066;">forms</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>n<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;!</span>x<span style="color: #339933;">&amp;&amp;</span>d.<span style="color: #660066;">layers</span><span style="color: #339933;">&amp;&amp;</span>i<span style="color: #339933;">&lt;</span>d.<span style="color: #660066;">layers</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> x<span style="color: #339933;">=</span>MM_findObj<span style="color: #009900;">&#40;</span>n<span style="color: #339933;">,</span>d.<span style="color: #660066;">layers</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">document</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>x <span style="color: #339933;">&amp;&amp;</span> d.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#41;</span> x<span style="color: #339933;">=</span>d.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>n<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000066; font-weight: bold;">return</span> x<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> 
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> MM_swapImage<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//v3.0</span>
  <span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">,</span>j<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span>x<span style="color: #339933;">,</span>a<span style="color: #339933;">=</span>MM_swapImage.<span style="color: #660066;">arguments</span><span style="color: #339933;">;</span> document.<span style="color: #660066;">MM_sr</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #339933;">;</span> <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span><span style="color: #009900;">&#40;</span>a.<span style="color: #660066;">length</span><span style="color: #339933;">-</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>i<span style="color: #339933;">+=</span><span style="color: #CC0000;">3</span><span style="color: #009900;">&#41;</span>
   <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>x<span style="color: #339933;">=</span>MM_findObj<span style="color: #009900;">&#40;</span>a<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">!=</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>document.<span style="color: #660066;">MM_sr</span><span style="color: #009900;">&#91;</span>j<span style="color: #339933;">++</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span>x<span style="color: #339933;">;</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>x.<span style="color: #660066;">oSrc</span><span style="color: #009900;">&#41;</span> x.<span style="color: #660066;">oSrc</span><span style="color: #339933;">=</span>x.<span style="color: #660066;">src</span><span style="color: #339933;">;</span> x.<span style="color: #660066;">src</span><span style="color: #339933;">=</span>a<span style="color: #009900;">&#91;</span>i<span style="color: #339933;">+</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #006600; font-style: italic;">//--&gt;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Oh, you’ve not seen it ever? Well, I lost my bet… Under the name of a VERY popular HTML editor, these codes are VERY popularly used, for a VERY popular effect that you must have known (this time I bet, really!!!) &#8211; the rollover, or “image-swapping” animation. Basically, there are 2 images involved: one for “normal” state:</p>
<p><img title="click_normal" src="http://www.phoenixheart.net/wp-content/uploads/2008/10/click_normal.gif" alt="click_normal Bad practices (and how to avoid them) in web development" width="88" height="25" /></p>
<p>and the other for “hover” state:</p>
<p><img title="click_hover" src="http://www.phoenixheart.net/wp-content/uploads/2008/10/click_hover.gif" alt="click_hover Bad practices (and how to avoid them) in web development" width="88" height="25" /></p>
<p>When the mouse hovers that gray image, the orange one is shown up, which creates a “lighten up” effect and somehow tells the user: Click me, I’m sexy &amp; ready.</p>
<p>So what’s wrong with this very cool method, you ask?</p>
<ul>
<li>First, the code is huge. See above. And you must implement a “preloading” feature too, or it will take time for the hover-state image to be downloaded and shown up.</li>
<li>Second, this technique is totally useless if the user disables JavaScript.</li>
<li>Third, as we have 2 different images here, the number of requests to server is increased.</li>
<li>And, don’t you know that browser is painfully slow in displaying an image?</li>
</ul>
<p>Convinced? Here is the most common solution: Instead of using two images for two different states and make them swap, the HTML experts out there are using just one background image for BOTH states and some attribute of CSS called “<a href="http://www.w3schools.com/css/pr_background-position.asp">background-position</a>” to create a “rollover” effect that doesn’t hurt. I won’t go into details here, since it will in no doubt lengthen this article unnecessarily, but I have <a href="http://www.findmotive.com/2006/10/31/simple-css-image-rollover/">a good resource</a> for you. Using this very simple technique, all the disadvantages listed above will just vanish.</p>
<p>With all this blahblah, however, I’m not stressing on a rollover effect alone. What I’m trying to tell is that sometimes you just don’t have to Javascript at all. We know that not everything can be done in CSS instead of Javascript, as JS has undeniable pros. But keep in mind that pros come with cons, and whenever you can, avoid it.</p>
<h3>Overusing images</h3>
<p><img class="shot" title="Too many images!!!" src="http://www.phoenixheart.net/wp-content/uploads/2008/10/toomuch.jpg" alt="Too many images!!!" width="288" height="203" /></p>
<p>I know, “A picture speaks a thousand words” as they say. What a pity that doesn’t apply in web designing &#8211; if the term “picture” implies a “text displayed as image”. Following the innovation of Web 2.0 where only content matters, images are being reduced from websites, and yes they have good reasons to do so:</p>
<ul>
<li>Images weigh. A small image can easily weigh ~10KB, that is (how coincident) ~1000 words. If you have a busy site, that image can easily cost you gigabytes of bandwidth each month. It’s money. So how to save some of that bandwidth/money? Use some meaningful texts instead. How about replacing that fancy button with the “Click me” text now?</li>
<li>Those are fat, slow. Images are not an exception. A site loaded with images will load v……e….r…….y s…..l….o……..w…….l…..y. And <a href="http://www.akamai.com/html/about/press/releases/2006/press_110606.html">researches have shown</a> that 4 seconds is the maximum loading time a web surfer accepts (<a href="http://www.websiteoptimization.com/speed/1/">some</a> say that it’s 8 sec anyway). Then, if your page takes more than ten seconds to load, unless it has some real pictures about aliens on Mars, users will leave. So, following Mc Donald’s rule: if you want your visitors to stay, don’t make them wait.</li>
<li>Images are very bad in term of accessibility. Web visitors with limited seeing ability tend to use the built-in “Text Size” tool available in almost all browsers to increase or decrease the size of text, thus can have a better reading experience. With images, they simply can’t. Very bad, I must repeat.</li>
<li>Pages with images all over the place suck in printing. When the acceptable print resolution is 300dpi, normal web image resolution is only 72 dpi or so. This results in a terrible print quality.</li>
</ul>
<p>With all these proofs (and maybe more that I’ve not come up with), along with the fact that 90% of images on your page are totally replaceable by plain text, let there be text!</p>
<h3>Everything is &lt;p&gt;</h3>
<p>More than often I encounter websites in which every text content is contained in &lt;p&gt;…&lt;/p&gt; tag pairs, where the titles and headers &lt;p&gt;’s are formatted to be bold, with bigger size, underlines etc. to differentiate from other normal &lt;p&gt; elements.</p>
<p><img class="shot" title="Header and paragraph" src="http://www.phoenixheart.net/wp-content/uploads/2008/10/p.gif" alt="Header and paragraph" width="474" height="141" /></p>
<p>It is a misuse of &lt;p&gt;.</p>
<p>&lt;p&gt; is intended to display paragraph content, while heading tags like &lt;h1&gt;, &lt;h2&gt;, &lt;h3&gt; etc. are for heading and title texts. Though you can always use CSS to make a specified &lt;p&gt; to stand out of the crowd to be an article title, and it seems to make no difference or problem in displaying or accessibility or readability or whatsoever, it’s perfectly wrong. According to Wikipedia, &lt;h&gt; tags have something to do with “the document’s structure and organization” and “some programs use them to generate outlines and tables of contents”. So, to human eyes, your page may look like a document, but with cyber programs, it may not. Talking about <abbr title="Search Engine Optimization">SEO</abbr> this misuse will likely result in a low rank in Google.</p>
<p>So here’s the final line: let &lt;p&gt; be &lt;p&gt;. There’s no special &lt;p&gt; in this web development world, please.</p>
<h3>“Look what I can do” style</h3>
<p>(I must admit, this is the bad habit I’m trying to give up too). <img class="shot" style="margin: 5px; float: right;" title="Please wait while I'm fading in" src="http://www.phoenixheart.net/wp-content/uploads/2008/10/wait.gif" alt="Please wait while I'm fading in" width="297" height="373" /></p>
<p>Thanks to the open source wave in web development, now creating cool user experiences is easier than ever. Back in the old days, a drop-down menu was a breathtaking effect, and you attracted user attention by making the text blink. Now, it’s a massive number of killing javascript stuffs out there: slide up down right left, fading in and out, shaking, scaling, folding, bouncing, exploding, fish eye, light box, drag and drop… each with one or two lines of code. And you don’t have to care about cross browser compatibility, as they (jQuery, mootools, script.aculo.us, Dojo) have done that already for you. Web developers, we’re at your service!</p>
<p>Ok, wait…</p>
<p>Since effects are all cool, you may want to show them off. “Look this, and this, and this, hey, impressed?” that’s how your website is saying. But (I hate this word, <em>but</em> I have to use it yet again), beware, those fancy stuffs may be something that make your site not accessible. Like, a user may have to click on a link and wait for the invisible div to slowly fade in just to read its content. Isn’t it something tiring? Why must the content be one click (and five seconds) away from him? Why wasn’t it there from the beginning?</p>
<p>Unless you have a very good reason to, don’t ever hide your content from the users. Sure, fading divs are candies for the eyes, but a rushing user’s eyes don’t need any candy. By the way may I ask who’s not rushing today?</p>
<h3>What else?</h3>
<p>Actually I had something more in mind before starting this articles, such as “Click me” linking, frame structure, Ajax overuse etc., during writing I got a feeling that those are too much into details, so I decided to omit them. Maybe I will put them back into the table (not <em>that</em> table) in the near future.</p>
<img style='display:none' id="post-47-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.phoenixheart.net/2008/10/bad-practices-and-how-to-avoid-them-in-web-development/',title:'Bad practices (and how to avoid them) in web development',tweet:'(Yet another post taken from the ruins of Tekaboo) Whether you are a web designer or a server side g',description:'(Yet another post taken from the ruins of Tekaboo) Whether you are a web designer or a server side g'})"><script type='text/javascript'>document.getElementById("post-47-blankimage").onload();</script>]]></content:encoded>
			<wfw:commentRss>http://www.phoenixheart.net/2008/10/bad-practices-and-how-to-avoid-them-in-web-development/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk (enhanced) (user agent is rejected)
Database Caching 1/18 queries in 0.014 seconds using disk
Object Caching 489/516 objects using disk

Served from: www.phoenixheart.net @ 2012-02-04 02:50:03 -->
