<?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>zParacha.com &#187; Web Development</title>
	<atom:link href="http://www.zparacha.com/category/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zparacha.com</link>
	<description>Effective programming and blogging tips by Zaheer Paracha</description>
	<lastBuildDate>Wed, 09 Nov 2011 00:52:38 +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>How to redirect homepage in Joomla</title>
		<link>http://www.zparacha.com/how-to-redirect-homepage-in-joomla/</link>
		<comments>http://www.zparacha.com/how-to-redirect-homepage-in-joomla/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 18:29:18 +0000</pubDate>
		<dc:creator>Zaheer Paracha</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Joomla]]></category>

		<guid isPermaLink="false">http://www.zparacha.com/how-to-redirect-homepage-in-joomla/</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.zparacha.com/how-to-redirect-homepage-in-joomla/' addthis:title='How to redirect homepage in Joomla' ><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like"></a></div>Joomla is a wonderful platform to publish websites. With readily available templates you can have your website up and running in no time. Sometimes though you may need to direct your visitors to a different page than your regular home page, for instance you may want to direct all the visitors to a promotion page [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.zparacha.com/how-to-redirect-homepage-in-joomla/' addthis:title='How to redirect homepage in Joomla' ><a class="addthis_button_googlereader"></a><a class="addthis_button_email"></a><a class="addthis_button_google"></a><a class="addthis_button_twitter"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like"></a><a class="addthis_button_compact"></a></div><p><a href="http://www.zparacha.com/how-to-redirect-homepage-in-joomla/">How to redirect homepage in Joomla</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>



<span style="font-weight:bold;"> Related posts:</span><ul><li><a href='http://www.zparacha.com/how-to-limit-number-of-posts-on-your-wordpress-homepage/' rel='bookmark' title='Permanent Link: How to limit number of posts on your WordPress homepage.'>How to limit number of posts on your WordPress homepage.</a> <small>If you have been blogging regularly for more than few...</small></li>
</ul>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.zparacha.com/how-to-redirect-homepage-in-joomla/' addthis:title='How to redirect homepage in Joomla' ><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like"></a></div><p><!--adsense#greyLeft--><br />
Joomla is a wonderful platform to publish websites. With readily available templates you can have your website up and running in no time. Sometimes though you may need to direct your visitors to a different page than your regular home page, for instance you may want to direct all the visitors to a promotion page during special sales events. There is a very simple and easy way of doing this in Joomla.<span id="more-1338"></span></p>
<ol>
<li>Create and upload the standalone webpage to your domain.
	</li>
<li>
Backup your index.php file in templates/YOUR_TEMPLATE_FOLDER.	</li>
<li>
<p>Add following lines to the index.php file under the templates/YOUR_TEMPLATE_FOLDER.</li>
<pre name="code" class="php">
<?php
if ( JURI::base()==JURI::current() )
 { header( 'Location: http://www.yourdomainname.com/NEW_PAGE.php' ); }
?></pre>
</ol>
<p>Now when the visitors come to your website they will be taken to NEW_PAGE.php.<br />
After the need to redirect the traffic is over simply replace the index.php file with the file you backed up in step 1.</p>
<p>Happy coding..<br />
<!--adsense#tla-->
<div class="tweetmeme_button" style="float:right; margin: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.zparacha.com%2Fhow-to-redirect-homepage-in-joomla%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.zparacha.com%2Fhow-to-redirect-homepage-in-joomla%2F&amp;source=zparacha&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" title="How to redirect homepage in Joomla" alt=" How to redirect homepage in Joomla" /><br />
			</a>
		</div>
<p><a href="http://www.zparacha.com/how-to-redirect-homepage-in-joomla/">How to redirect homepage in Joomla</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'How to redirect homepage in Joomla on zParacha.com: Effective Programming tips',url: 'http://www.zparacha.com/how-to-redirect-homepage-in-joomla/',contentID: 'post-1338',signature: 'If you enjoyed this post, make sure you subscribe to my &lt;a href=\&quot;http://www.zparacha.com/feed/\&quot;&gt; RSS feed&lt;/a&gt;.',suggestTags: 'Joomla',providerName: 'zParacha.com: Effective Programming tips',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-vert.png" class="evernoteSiteMemoryButton" title="How to redirect homepage in Joomla" alt="article clipper vert How to redirect homepage in Joomla" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.zparacha.com/how-to-redirect-homepage-in-joomla/' addthis:title='How to redirect homepage in Joomla' ><a class="addthis_button_googlereader"></a><a class="addthis_button_email"></a><a class="addthis_button_google"></a><a class="addthis_button_twitter"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like"></a><a class="addthis_button_compact"></a></div>

<p><span style="font-weight:bold;"> Related posts:</span><ul><li><a href='http://www.zparacha.com/how-to-limit-number-of-posts-on-your-wordpress-homepage/' rel='bookmark' title='Permanent Link: How to limit number of posts on your WordPress homepage.'>How to limit number of posts on your WordPress homepage.</a> <small>If you have been blogging regularly for more than few...</small></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.zparacha.com/how-to-redirect-homepage-in-joomla/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>An HTML element you don&#039;t want to omit.</title>
		<link>http://www.zparacha.com/doctype-explained/</link>
		<comments>http://www.zparacha.com/doctype-explained/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 04:57:51 +0000</pubDate>
		<dc:creator>Zaheer Paracha</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[doctype]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://www.zparacha.com/?p=1203</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.zparacha.com/doctype-explained/' addthis:title='An HTML element you don&#39;t want to omit.' ><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like"></a></div>As web developers we have the tendency to blame web browsers for inconsistencies and for not displaying the pages as designed. Most of the time the blame is justified, but there are instances when the blame lies at the feet of the web developers. For example, incorrect CSS declarations, missing closing tags in HTML documents [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.zparacha.com/doctype-explained/' addthis:title='An HTML element you don&#39;t want to omit.' ><a class="addthis_button_googlereader"></a><a class="addthis_button_email"></a><a class="addthis_button_google"></a><a class="addthis_button_twitter"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like"></a><a class="addthis_button_compact"></a></div><p><a href="http://www.zparacha.com/doctype-explained/">An HTML element you don&#39;t want to omit.</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>



<span style="font-weight:bold;"> Related posts:</span><ul><li><a href='http://www.zparacha.com/how-to-position-html-element-in-the-center-using-css/' rel='bookmark' title='Permanent Link: How to position HTML element in the center using CSS.'>How to position HTML element in the center using CSS.</a> <small>Positioning text in the center of an element is easily...</small></li>
<li><a href='http://www.zparacha.com/encode-decode-html-entities/' rel='bookmark' title='Permanent Link: Encode / Decode HTML Entities'>Encode / Decode HTML Entities</a> <small>Image credit:lloydi Have you been typing HTML entities by hand...</small></li>
<li><a href='http://www.zparacha.com/textfield_focus/' rel='bookmark' title='Permanent Link: Set focus on the first text field of HTML form.'>Set focus on the first text field of HTML form.</a> <small>A HTML form is a very good channel that you...</small></li>
</ul>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.zparacha.com/doctype-explained/' addthis:title='An HTML element you don&#39;t want to omit.' ><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like"></a></div><p><div id="attachment_1222" class="wp-caption alignleft" style="width: 210px"><a href="http://www.zparacha.com/doctype-explained/doctypes/" rel="attachment wp-att-1222"><img src="http://www.zparacha.com/wp-content/uploads/2010/02/doctypes.gif" alt="doctypes An HTML element you don&#39;t want to omit. " title="doctypes" width="200" height="228" class="size-full wp-image-1222" /></a><p class="wp-caption-text">Doctypes</p></div>As web developers we have the tendency to blame web browsers for inconsistencies and for not displaying the pages as designed. Most of the time the blame is justified,  but there are instances when the blame lies at the feet of the web developers.  For example, incorrect CSS declarations, missing closing tags in HTML documents will break you website. Another common and often overlooked reason of broken web pages is the missing or incorrect DOCYTYPE declaration. <span id="more-1203"></span></p>
<p>  If your website is not rendered properly by some browsers,  the first thing you need to check is the first line in your HTML document. <!--more--></p>
<p>The first line of every HTML document should have a valid DOCTYPE declaration. A missing or invalid DOCTYPE sends browsers in to the quirks mode and then the web browser uses its own methods to parse and render your page.</p>
<h2>What is DOCTYPE?</h2>
<p>A <strong>Document Type Declaration (DOCTYPE)</strong> informs the browsers which version of (X)HTML your web page is using. Browsers use this information to validate and render your documents. All compliant web pages must begin with a valid DOCTYPE declaration. If you don&#8217;t include a DOCTYPE declaration or if it is not valid, your web pages will not be validated and the web browser won&#8217;t be able to render your web pages properly.</p>
<h2>Why DOCTYPE is important?</h2>
<p>All standard-compliant browser need some information about the page to validate its content and then display it properly. There are several versions of HTML and XHTML and browsers need to know the version you are using.<br />
A DOCTYPE tells browsers which (X)HTML version you are using and help them to render your page in standards–compliant mode. This will ensure that your pages are displayed by all browsers like you want them.</p>
<p>[ad#GreyLeft]But if you don&#8217;t include the DOCTYPE or if your DOCTYPE declaration is invalid, most browsers will assume that you are using an older version HTML and your page does not meet latest standards. The browser will then try to parse and render your page in backward compatible fashion (known as quirks mode) and may use browser-specific DOM.<br />
Of course, you don&#8217;t want this. So save yourself some time and frustration by adding one of the following DOCTYPES in all your HTML page.</p>
<table  style="background:none repeat scroll 0 0 #FFFFBE;border:1px solid #333;margin-bottom:2em;font-size: 0.9em;">
<tbody>
<tr style="font-size:1.0em;background:#eee;color:#000;">
<th>Version</th>
<th>DTD list</th>
<th>DOCTYPE Declaration in documents</th>
</tr>
<tr>
<td class="html"><a href="http://www.w3.org/TR/html401/">HTML&nbsp;4.01</a></td>
<td class="dtd"><a href="http://www.w3.org/TR/html401/strict.dtd" class="broken_link">Strict</a>, <a href="http://www.w3.org/TR/html401/loose.dtd" class="broken_link">Transitional</a>, <a href="http://www.w3.org/TR/html401/frameset.dtd" class="broken_link">Frameset</a></td>
<td class="htmlcmt">
<pre>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd"&gt;
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd"&gt;
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
   "http://www.w3.org/TR/html4/frameset.dtd"&gt;
	</pre>
</td>
</tr>
<tr>
<td class="html"><a href="http://www.w3.org/TR/xhtml1/">XHTML&nbsp;1.0</a></td>
<td class="dtd"><a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" class="broken_link">Strict</a>, <a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" class="broken_link">Transitional</a>, <a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd" class="broken_link">Frameset</a></td>
<td class="htmlcmt">
<pre>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"&gt;
	</pre>
</td>
</tr>
</tbody>
</table>
<p>I copied these DOCTYPE declarations from W3C website. You can find complete table of DOCTYPE declarations at <a href="http://www.w3.org/QA/2002/04/Web-Quality">http://www.w3.org/QA/2002/04/Web-Quality</a>.</p>
<p>This one line in all your HTML pages will make your relationship with browsers a little less stressful. My advise to all web developers, &#8220;Don&#8217;t publish a web page without DOCTYPE.&#8221;</p>
<div class="tweetmeme_button" style="float:right; margin: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.zparacha.com%2Fdoctype-explained%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.zparacha.com%2Fdoctype-explained%2F&amp;source=zparacha&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" title="An HTML element you don&#39;t want to omit. " alt=" An HTML element you don&#39;t want to omit. " /><br />
			</a>
		</div>
<p><a href="http://www.zparacha.com/doctype-explained/">An HTML element you don&#39;t want to omit.</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'An HTML element you don\&#039;t want to omit. on zParacha.com: Effective Programming tips',url: 'http://www.zparacha.com/doctype-explained/',contentID: 'post-1203',signature: 'If you enjoyed this post, make sure you subscribe to my &lt;a href=\&quot;http://www.zparacha.com/feed/\&quot;&gt; RSS feed&lt;/a&gt;.',suggestTags: 'doctype,html,Web Development',providerName: 'zParacha.com: Effective Programming tips',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-vert.png" class="evernoteSiteMemoryButton" title="An HTML element you don&#39;t want to omit. " alt="article clipper vert An HTML element you don&#39;t want to omit. " />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.zparacha.com/doctype-explained/' addthis:title='An HTML element you don&#39;t want to omit.' ><a class="addthis_button_googlereader"></a><a class="addthis_button_email"></a><a class="addthis_button_google"></a><a class="addthis_button_twitter"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like"></a><a class="addthis_button_compact"></a></div>

<p><span style="font-weight:bold;"> Related posts:</span><ul><li><a href='http://www.zparacha.com/how-to-position-html-element-in-the-center-using-css/' rel='bookmark' title='Permanent Link: How to position HTML element in the center using CSS.'>How to position HTML element in the center using CSS.</a> <small>Positioning text in the center of an element is easily...</small></li>
<li><a href='http://www.zparacha.com/encode-decode-html-entities/' rel='bookmark' title='Permanent Link: Encode / Decode HTML Entities'>Encode / Decode HTML Entities</a> <small>Image credit:lloydi Have you been typing HTML entities by hand...</small></li>
<li><a href='http://www.zparacha.com/textfield_focus/' rel='bookmark' title='Permanent Link: Set focus on the first text field of HTML form.'>Set focus on the first text field of HTML form.</a> <small>A HTML form is a very good channel that you...</small></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.zparacha.com/doctype-explained/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Why you should stop using onload method.</title>
		<link>http://www.zparacha.com/better-alternative-to-onload/</link>
		<comments>http://www.zparacha.com/better-alternative-to-onload/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 03:46:27 +0000</pubDate>
		<dc:creator>Zaheer Paracha</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[focus]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[onload]]></category>

		<guid isPermaLink="false">http://www.zparacha.com/?p=1127</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.zparacha.com/better-alternative-to-onload/' addthis:title='Why you should stop using onload method.' ><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like"></a></div>It is amazing that many web developers still use onload method embedded in the BODY tag, like &#60;HEAD&#62; &#60;BODY onload="document.contact.userID.focus();"&#62; &#60;form name="contact"&#62; &#60;input type="text" name="userID" &#62; &#60;/form&#62; &#60;/BODY&#62; &#60;/HEAD&#62; There are two problems with this line of code. Embedding code (behavior) with HTML (structure) makes it difficult to maintain the page. onload() method will executes [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.zparacha.com/better-alternative-to-onload/' addthis:title='Why you should stop using onload method.' ><a class="addthis_button_googlereader"></a><a class="addthis_button_email"></a><a class="addthis_button_google"></a><a class="addthis_button_twitter"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like"></a><a class="addthis_button_compact"></a></div><p><a href="http://www.zparacha.com/better-alternative-to-onload/">Why you should stop using onload method.</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>



<span style="font-weight:bold;"> Related posts:</span><ul><li><a href='http://www.zparacha.com/textfield_focus/' rel='bookmark' title='Permanent Link: Set focus on the first text field of HTML form.'>Set focus on the first text field of HTML form.</a> <small>A HTML form is a very good channel that you...</small></li>
<li><a href='http://www.zparacha.com/css-text-resize/' rel='bookmark' title='Permanent Link: Dynamically Resize Text'>Dynamically Resize Text</a> <small>.codeText{color:blue;font-weight:normal;width:100%;} .subhead{color:gray;font-weight:bold;text-decoration:underline;} CSS, combined with little JavaScript, offers great flexibility...</small></li>
<li><a href='http://www.zparacha.com/ajax-contact-from/' rel='bookmark' title='Permanent Link: AJAX Contact Form'>AJAX Contact Form</a> <small>Want to collect input from your web site&#8217;s visitors? Don&#8217;t...</small></li>
</ul>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.zparacha.com/better-alternative-to-onload/' addthis:title='Why you should stop using onload method.' ><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like"></a></div><div id="attachment_1152" class="wp-caption alignleft" style="width: 286px"><a href="http://www.zparacha.com/better-alternative-to-onload/onload-2/" rel="attachment wp-att-1152"><img src="http://www.zparacha.com/wp-content/uploads/2010/02/onload1-276x300.png" alt="onload1 276x300 Why you should stop using onload method." title="onload" width="276" height="300" class="size-medium wp-image-1152" /></a><p class="wp-caption-text">Onload</p></div>
<p>It is amazing that many web developers still use onload method embedded in the BODY tag, like</p>
<pre><code>
 &lt;HEAD&gt;
 &lt;BODY onload="document.contact.userID.focus();"&gt;
  &lt;form name="contact"&gt;
   &lt;input type="text" name="userID" &gt;
  &lt;/form&gt;
  &lt;/BODY&gt;
 &lt;/HEAD&gt;
</code></pre>
<p>There are two problems with this line of code. </p>
<ol>
<li>
Embedding code (behavior) with HTML (structure) makes it difficult to maintain the page.</li>
<li>onload() method will executes only after the page is fully displayed.</li>
</ul>
<p>Let&#8217;s see how to fix these problems.<span id="more-1127"></span><br />
Fixing problem # is quite simple. Just move your JavaScript code to the header section of you HTML page.</p>
<pre><code>
&lt;HTML&gt;
&lt;HEAD&gt;
&lt;script language="javascript"&gt;
function setFocus(){
	document.contact.userID.focus();
}
&lt;/script&gt;
&lt;/HEAD&gt;
&lt;BODY onload="setFocus();"&gt;
&lt;form name="contact"&gt;
&lt;input type="text" name="userID" &gt;
&lt;/form&gt;
&lt;/BODY>
&lt;/HTML&gt;
</pre>
<p></code></p>
<p>Even better approach would be to move the code to an external Javascript file and add a reference to that file in the header section of the HTML document. For example, if the code is in script.js you can import the code like</p>
<pre><code>
&lt;HTML&gt;
&lt;HEAD&gt;&lt;script language="javascript" ref="scripts/script.js"&gt;
&lt;/HEAD&gt;
&lt;BODY onload="setFocus();"&gt;
&lt;form name="contact"&gt;
&lt;input type="text" name="userID" &gt;
&lt;/form&gt;
&lt;/BODY>&lt;
/HTML&gt;
</code></pre>
<p><!--adsense#greyLeft--></p>
<p>This approach will make your HTML code clutter-free and the code will be more manageable. But this does not address the fact the there is a delay in the exectuion of the code. onload method executes after the page is completely loaded.  For instance, if you want to set focus to a text field on your web page using onload method, the foucs will be set after the page is completly downloaded.</p>
<p>If your web page is a simple text page with no images or multimedia elements then using onload might be OK. However, nowadays almost all web pages have at least few images, some even have embedded audio, video, Flash or other rich multimedia resources. These large resources take considerably long time to be fully loaded. And until all the content of the page is fully downloaded and the DOM tree is constructed, onload will not be fired. </p>
<h3>Set focus to the text field without onload:</h3>
<p>There is nothing wrong with the onload method, the problem is the large size of page elements that need to be downloaded by the browser. The browser needs to construct the DOM tree, load all the images and other multi-media resources and when everything is done then it will execute the onload method. A DOM tree is constructed instantly by the browser, but the large size of other elements take a while to be fully loaded. It means these external multilmedia files keep browser from executing the code triggred my onload event. The best approach would be to wait just long enough to let browser contstuct the DOM tree and then execute your code without waiting for all the objects to be completely downloaded. This can be done by using jQuery's <b>ready()</b> function.</p>
<pre><code>
  &lt;script type="text/javascript" src="scripts/jquery-1.3.2.min.js"&gt;
  &lt;/script&gt;
    &lt;script type="text/javascript"&gt;
      jQuery(document).ready(function() {
        document.contact.userID.focus();
      });
    &lt;/script&gt;
</code></pre>
<p>or more formally.</p>
<pre><code>
$(function(){
	document.contact.userID.focus();
}
</code></pre>
<p>So now your HTML code will be like</p>
<pre><code>
 &lt;HTML&gt;
 &lt;HEAD&gt;
  &lt;script type="text/javascript" src="scripts/jquery-1.3.2.min.js"&gt;
  &lt;/script&gt;
    &lt;script type="text/javascript"&gt;
      jQuery(document).ready(function() {
        document.contact.userID.focus();
      });
    &lt;/script&gt;
 &lt;/HEAD&gt;
 &lt;BODY &gt;
 &lt;form name="contact"&gt;
 &lt;input type="text" name="userID" &gt;
 &lt;/form&gt;
 &lt;/BODY>
 &lt;/HTML&gt;
</pre>
<p></code></p>
<p>Now our JavaScript code will be executed as soon as the DOM is fully constructed, without waiting for images and other multimedia resources. In this example the focus will be set to your input text field almost instantly and user can start typing in the information without waiting for rest of the page to be downloaded. This is a simple but effective way of improving your website's usability. </p>
<p><!--adsense#tla-->
<div class="tweetmeme_button" style="float:right; margin: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.zparacha.com%2Fbetter-alternative-to-onload%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.zparacha.com%2Fbetter-alternative-to-onload%2F&amp;source=zparacha&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" title="Why you should stop using onload method." alt=" Why you should stop using onload method." /><br />
			</a>
		</div>
<p><a href="http://www.zparacha.com/better-alternative-to-onload/">Why you should stop using onload method.</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Why you should stop using onload method. on zParacha.com: Effective Programming tips',url: 'http://www.zparacha.com/better-alternative-to-onload/',contentID: 'post-1127',signature: 'If you enjoyed this post, make sure you subscribe to my &lt;a href=\&quot;http://www.zparacha.com/feed/\&quot;&gt; RSS feed&lt;/a&gt;.',suggestTags: 'focus,Javascript,jQuery,JS,onload',providerName: 'zParacha.com: Effective Programming tips',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-vert.png" class="evernoteSiteMemoryButton" title="Why you should stop using onload method." alt="article clipper vert Why you should stop using onload method." />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.zparacha.com/better-alternative-to-onload/' addthis:title='Why you should stop using onload method.' ><a class="addthis_button_googlereader"></a><a class="addthis_button_email"></a><a class="addthis_button_google"></a><a class="addthis_button_twitter"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like"></a><a class="addthis_button_compact"></a></div>

<p><span style="font-weight:bold;"> Related posts:</span><ul><li><a href='http://www.zparacha.com/textfield_focus/' rel='bookmark' title='Permanent Link: Set focus on the first text field of HTML form.'>Set focus on the first text field of HTML form.</a> <small>A HTML form is a very good channel that you...</small></li>
<li><a href='http://www.zparacha.com/css-text-resize/' rel='bookmark' title='Permanent Link: Dynamically Resize Text'>Dynamically Resize Text</a> <small>.codeText{color:blue;font-weight:normal;width:100%;} .subhead{color:gray;font-weight:bold;text-decoration:underline;} CSS, combined with little JavaScript, offers great flexibility...</small></li>
<li><a href='http://www.zparacha.com/ajax-contact-from/' rel='bookmark' title='Permanent Link: AJAX Contact Form'>AJAX Contact Form</a> <small>Want to collect input from your web site&#8217;s visitors? Don&#8217;t...</small></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.zparacha.com/better-alternative-to-onload/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Google says Adios to IE6.</title>
		<link>http://www.zparacha.com/google-says-goodbye-to-ie6/</link>
		<comments>http://www.zparacha.com/google-says-goodbye-to-ie6/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 17:31:31 +0000</pubDate>
		<dc:creator>Zaheer Paracha</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[IE6]]></category>

		<guid isPermaLink="false">http://www.zparacha.com/?p=1119</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.zparacha.com/google-says-goodbye-to-ie6/' addthis:title='Google says Adios to IE6.' ><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like"></a></div>Google agrees that the time has come for us to lay IE6 to rest. Google announced in a blog post that it will stop supporting IE6 from March 01, 2010. Google will start by phasing out IE6 support for Google Docs and Google Sites, but I believe eventually all Google products will stop supporting IE6. [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.zparacha.com/google-says-goodbye-to-ie6/' addthis:title='Google says Adios to IE6.' ><a class="addthis_button_googlereader"></a><a class="addthis_button_email"></a><a class="addthis_button_google"></a><a class="addthis_button_twitter"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like"></a><a class="addthis_button_compact"></a></div><p><a href="http://www.zparacha.com/google-says-goodbye-to-ie6/">Google says Adios to IE6.</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>



<span style="font-weight:bold;"> Related posts:</span><ul><li><a href='http://www.zparacha.com/how-to-incorporate-google-custom-search-engine-with-adsense-into-your-wordpress-blog/' rel='bookmark' title='Permanent Link: How to incorporate Google Custom Search engine with Adsense into your WordPress blog.'>How to incorporate Google Custom Search engine with Adsense into your WordPress blog.</a> <small>AdSense is by far the most popular and easy to...</small></li>
<li><a href='http://www.zparacha.com/publish-your-blog-posts-to-twitter-with-feedburne/' rel='bookmark' title='Permanent Link: Publish your blog posts to Twitter with Feedburner.'>Publish your blog posts to Twitter with Feedburner.</a> <small>One of earliest third party tools that I started using...</small></li>
</ul>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.zparacha.com/google-says-goodbye-to-ie6/' addthis:title='Google says Adios to IE6.' ><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like"></a></div><p><img title="ie6 die jpg" src="http://www.zparacha.com/images/ie6_die.jpg " style="border: 0px none;" height="214px" width="300px" alt=" Google says Adios to IE6." /><br />
Google agrees that the time has come for us to lay IE6 to rest. Google <a href="http://googleenterprise.blogspot.com/2010/01/modern-browsers-for-modern-applications.html"> announced </a> in a blog post that it will stop supporting IE6 from March 01, 2010. Google will start by phasing out IE6 support for Google Docs and Google Sites, but I believe eventually all Google products will stop supporting IE6.<br />
<span id="more-1119"></span></p>
<p><!--adsense#tla--></p>
<p>From Google&#8217;s official blog:</p>
<blockquote><p>Many other companies have already stopped supporting older browsers like Internet Explorer 6.0 as well as browsers that are not supported by their own manufacturers. We’re also going to begin phasing out our support, starting with Google Docs and Google Sites. As a result you may find that from March 1 key functionality within these products &#8212; as well as new Docs and Sites features &#8212; won’t work properly in older browsers.</p></blockquote>
<p>Even Microsoft itself <a href="http://blogs.technet.com/srd/archive/2010/01/15/assessing-risk-of-ie-0day-vulnerability.aspx">recommends</a> users to stop using IE6. Many corporations have already stopped supporting or using IE6, with the addition of an Internet giant like Google I hope the drive to abandon the aging IE6 will get some momentum. Hopefully 2010 will be year where wen can move away from IE6.  That would be an awesome news for all web developers. </p>
<p>What are your thoughts on IE6?</p>
<p><!--adsense#tla--></p>
<p><span style="font-size:10px;">Image src: http://www.ferdychristant.com</span></p>
<div class="tweetmeme_button" style="float:right; margin: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.zparacha.com%2Fgoogle-says-goodbye-to-ie6%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.zparacha.com%2Fgoogle-says-goodbye-to-ie6%2F&amp;source=zparacha&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" title="Google says Adios to IE6." alt=" Google says Adios to IE6." /><br />
			</a>
		</div>
<p><a href="http://www.zparacha.com/google-says-goodbye-to-ie6/">Google says Adios to IE6.</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Google says Adios to IE6. on zParacha.com: Effective Programming tips',url: 'http://www.zparacha.com/google-says-goodbye-to-ie6/',contentID: 'post-1119',signature: 'If you enjoyed this post, make sure you subscribe to my &lt;a href=\&quot;http://www.zparacha.com/feed/\&quot;&gt; RSS feed&lt;/a&gt;.',suggestTags: 'browsers,Google,IE6',providerName: 'zParacha.com: Effective Programming tips',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-vert.png" class="evernoteSiteMemoryButton" title="Google says Adios to IE6." alt="article clipper vert Google says Adios to IE6." />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.zparacha.com/google-says-goodbye-to-ie6/' addthis:title='Google says Adios to IE6.' ><a class="addthis_button_googlereader"></a><a class="addthis_button_email"></a><a class="addthis_button_google"></a><a class="addthis_button_twitter"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like"></a><a class="addthis_button_compact"></a></div>

<p><span style="font-weight:bold;"> Related posts:</span><ul><li><a href='http://www.zparacha.com/how-to-incorporate-google-custom-search-engine-with-adsense-into-your-wordpress-blog/' rel='bookmark' title='Permanent Link: How to incorporate Google Custom Search engine with Adsense into your WordPress blog.'>How to incorporate Google Custom Search engine with Adsense into your WordPress blog.</a> <small>AdSense is by far the most popular and easy to...</small></li>
<li><a href='http://www.zparacha.com/publish-your-blog-posts-to-twitter-with-feedburne/' rel='bookmark' title='Permanent Link: Publish your blog posts to Twitter with Feedburner.'>Publish your blog posts to Twitter with Feedburner.</a> <small>One of earliest third party tools that I started using...</small></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.zparacha.com/google-says-goodbye-to-ie6/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Five free tools to choose perfect colors for your website.</title>
		<link>http://www.zparacha.com/free-color-tools-for-webdesigners/</link>
		<comments>http://www.zparacha.com/free-color-tools-for-webdesigners/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 06:03:07 +0000</pubDate>
		<dc:creator>Zaheer Paracha</dc:creator>
				<category><![CDATA[Most Popular Posts]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[color wheel]]></category>
		<category><![CDATA[colorrotate]]></category>
		<category><![CDATA[colors]]></category>
		<category><![CDATA[colourlovers]]></category>
		<category><![CDATA[kuler]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[webdesign]]></category>

		<guid isPermaLink="false">http://www.zparacha.com/?p=1061</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.zparacha.com/free-color-tools-for-webdesigners/' addthis:title='Five free tools to choose perfect colors for your website.' ><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like"></a></div>Color coordination plays a big role in the look and feel of a website. An appealing color scheme is an important prerequisite for eye catching web design. Dull or very sharp colors or mismatch colors will not only look ugly it may overshadow other nice elements of your website. Choosing vibrant, harmonious colors that are [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.zparacha.com/free-color-tools-for-webdesigners/' addthis:title='Five free tools to choose perfect colors for your website.' ><a class="addthis_button_googlereader"></a><a class="addthis_button_email"></a><a class="addthis_button_google"></a><a class="addthis_button_twitter"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like"></a><a class="addthis_button_compact"></a></div><p><a href="http://www.zparacha.com/free-color-tools-for-webdesigners/">Five free tools to choose perfect colors for your website.</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>



<span style="font-weight:bold;"> Related posts:</span><ul><li><a href='http://www.zparacha.com/best-twitter-tools/' rel='bookmark' title='Permanent Link: Best free tools for Twitter'>Best free tools for Twitter</a> <small>Twitter provides an excellent platform to bloggers to promote their...</small></li>
<li><a href='http://www.zparacha.com/css-color-chart/' rel='bookmark' title='Permanent Link: Colors by name with hex and RGB codes.'>Colors by name with hex and RGB codes.</a> <small>Today I stumbled upon a rather useful website. CSS Color...</small></li>
<li><a href='http://www.zparacha.com/top-10-tools-for-bloggers/' rel='bookmark' title='Permanent Link: Top 10 tools for bloggers.'>Top 10 tools for bloggers.</a> <small>If you are looking for ways to improve your blogging...</small></li>
</ul>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.zparacha.com/free-color-tools-for-webdesigners/' addthis:title='Five free tools to choose perfect colors for your website.' ><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like"></a></div><p><div id="attachment_1155" class="wp-caption alignleft" style="width: 310px"><a href="http://www.zparacha.com/free-color-tools-for-webdesigners/rainbow-colors/" rel="attachment wp-att-1155"><img src="http://www.zparacha.com/wp-content/uploads/2010/01/rainbow-colors-300x225.jpg" alt="rainbow colors 300x225 Five free tools to choose perfect colors for your website." title="rainbow-colors" width="300" height="225" class="size-medium wp-image-1155" /></a><p class="wp-caption-text">Rainbow colors</p></div><br />
Color coordination plays a big role in the look and feel of a website. An appealing color scheme is an important prerequisite for eye catching web design. Dull or very sharp colors or mismatch colors  will not only look ugly it may overshadow other nice elements of your website. Choosing vibrant, harmonious colors that are pleasant to eyes enhance the aesthetics appeal of a website. Following is a list of online resources you can use to construct the color schemes for your next web design project.<br />
<span id="more-1061"></span></p>
<p/>
<h4><a href="http://kuler.adobe.com/"> Kuler</a></h4>
<p><img src="http://www.zparacha.com/images/kuler.png" alt="kuler Five free tools to choose perfect colors for your website."  title="Five free tools to choose perfect colors for your website." /></p>
<p/>
Kuler is a featured-rich online color free tool from Adobe that you can use to create your color themes or browse through thousands of themes generated by community members. As a registered user you can save your themes and then view them in MyKuler. You can create themes using single color or by using color wheel.  You can also extract color scheme from your images, for that you can upload your images or import them from Flickr. Kuler is my favorite. </p>
<p/>
<h4><a href="http://www.colorotate.org/">ColorRotate:</a></h4>
<p><img src="http://www.zparacha.com/images/colorrotate.png" alt="colorrotate Five free tools to choose perfect colors for your website."  title="Five free tools to choose perfect colors for your website." />
<p/>
Like Adobe Kuler, Colorrotate is also a free, online tool to generate color templates, but this is a 3D tool. Its intuitive 3D interface is fun to use and it enables you to quickly see the multidimensional nature of your colors and the relationships between colors. You can use its drag-and-drop option to adjust hue, brightness, and saturation. You can load color themes from you images. It also has a vast collection of community generated themes that you can browse to get some inspiration. </p>
<p/>
<p><!--adsense#top--></p>
<h4><a href="http://colorschemedesigner.com">ColorSchemeDesinger</a></h4>
<p><img src="http://www.zparacha.com/images/colorscheme.png" alt="colorscheme Five free tools to choose perfect colors for your website."  title="Five free tools to choose perfect colors for your website." /></p>
<p/>ColorSchemeDesigner is another free, online tool to generate color palettes.  Its unique, easy-to-use color theme creator packs many useful featuers. You can generate single monochromatic, complimentary, triad, tetrad, analogic, and accented analogic color palettes.  Not only you can create the color palette , you can also user their preview function to apply your palette to a dummy web page, to see how your colors will look on your website. This will definitely save many designers lot of time.<br />
Another great feature is the ability to export  your color palette as a Photoshop palette, HTML+CSS, XML, TXT, and GPL .<br />
This tool does not work in IE6.</p>
<p/>
<h4><a href="http://www.colourlovers.com/">ColourLovers</a></h4>
<p><img src="http://www.zparacha.com/images/colorlover.png" alt="colorlover Five free tools to choose perfect colors for your website."  title="Five free tools to choose perfect colors for your website." /></p>
<p/>If you need color inspiration, you will love ColourLovers. Designers from all over the world share their creative ideas on this website. It has over 286,866 members and showcase more than 2,407,124 colors, 1,090,882 palettes and 732,299 patterns. You can create your own color palettes or just pick one from this enormous collection. </p>
<blockquote><p>
COLOURlovers  is a resource that monitors and influences color trends. COLOURlovers gives the people who use color &#8211; whether for ad campaigns, product design, or in architectural specification &#8211; a place to check out a world of color, compare color palettes, submit news and comments, and read color related articles and interviews.
</p></blockquote>
<p/>
<h4><a href="http://www.ficml.org/jemimap/style/color/wheel.html">4096 Color Wheel</a></h4>
<p><img src="http://www.zparacha.com/images/colorwheel.png" alt="colorwheel Five free tools to choose perfect colors for your website." style="border:1px solid #333;" title="Five free tools to choose perfect colors for your website." /></p>
<p/>If you don&#8217;t want all the bells and whistles of above mentioned tools, you may want to try Color Wheel. This is a simple web-based tool to view and choose web-safe colors. It offers you a palette of seven colors, displayed on the left side of the screen. You can change these 7 colors one by one by clicking on a color wheel. It is a nice little tool to generate a color palette.  </p>
<p>What are your favorite tools for creating color schemes?</p>
<div class="tweetmeme_button" style="float:right; margin: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.zparacha.com%2Ffree-color-tools-for-webdesigners%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.zparacha.com%2Ffree-color-tools-for-webdesigners%2F&amp;source=zparacha&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" title="Five free tools to choose perfect colors for your website." alt=" Five free tools to choose perfect colors for your website." /><br />
			</a>
		</div>
<p><a href="http://www.zparacha.com/free-color-tools-for-webdesigners/">Five free tools to choose perfect colors for your website.</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Five free tools to choose perfect colors for your website. on zParacha.com: Effective Programming tips',url: 'http://www.zparacha.com/free-color-tools-for-webdesigners/',contentID: 'post-1061',signature: 'If you enjoyed this post, make sure you subscribe to my &lt;a href=\&quot;http://www.zparacha.com/feed/\&quot;&gt; RSS feed&lt;/a&gt;.',suggestTags: 'color wheel,colorrotate,colors,colourlovers,kuler,tools,webdesign',providerName: 'zParacha.com: Effective Programming tips',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-vert.png" class="evernoteSiteMemoryButton" title="Five free tools to choose perfect colors for your website." alt="article clipper vert Five free tools to choose perfect colors for your website." />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.zparacha.com/free-color-tools-for-webdesigners/' addthis:title='Five free tools to choose perfect colors for your website.' ><a class="addthis_button_googlereader"></a><a class="addthis_button_email"></a><a class="addthis_button_google"></a><a class="addthis_button_twitter"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like"></a><a class="addthis_button_compact"></a></div>

<p><span style="font-weight:bold;"> Related posts:</span><ul><li><a href='http://www.zparacha.com/best-twitter-tools/' rel='bookmark' title='Permanent Link: Best free tools for Twitter'>Best free tools for Twitter</a> <small>Twitter provides an excellent platform to bloggers to promote their...</small></li>
<li><a href='http://www.zparacha.com/css-color-chart/' rel='bookmark' title='Permanent Link: Colors by name with hex and RGB codes.'>Colors by name with hex and RGB codes.</a> <small>Today I stumbled upon a rather useful website. CSS Color...</small></li>
<li><a href='http://www.zparacha.com/top-10-tools-for-bloggers/' rel='bookmark' title='Permanent Link: Top 10 tools for bloggers.'>Top 10 tools for bloggers.</a> <small>If you are looking for ways to improve your blogging...</small></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.zparacha.com/free-color-tools-for-webdesigners/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>How to position HTML element in the center using CSS.</title>
		<link>http://www.zparacha.com/how-to-position-html-element-in-the-center-using-css/</link>
		<comments>http://www.zparacha.com/how-to-position-html-element-in-the-center-using-css/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 04:56:58 +0000</pubDate>
		<dc:creator>Zaheer Paracha</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[cascading_style_sheet]]></category>
		<category><![CDATA[positioning]]></category>
		<category><![CDATA[web development tools]]></category>

		<guid isPermaLink="false">http://www.zparacha.com/?p=1035</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.zparacha.com/how-to-position-html-element-in-the-center-using-css/' addthis:title='How to position HTML element in the center using CSS.' ><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like"></a></div>Positioning text in the center of an element is easily done using text-align:center property. But how do you position an entire element, for e.g; a div or an image in the center of the containing parent element? For example, if you want to put an image at the center of your header div how do [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.zparacha.com/how-to-position-html-element-in-the-center-using-css/' addthis:title='How to position HTML element in the center using CSS.' ><a class="addthis_button_googlereader"></a><a class="addthis_button_email"></a><a class="addthis_button_google"></a><a class="addthis_button_twitter"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like"></a><a class="addthis_button_compact"></a></div><p><a href="http://www.zparacha.com/how-to-position-html-element-in-the-center-using-css/">How to position HTML element in the center using CSS.</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>



<span style="font-weight:bold;"> Related posts:</span><ul><li><a href='http://www.zparacha.com/ad_placement/' rel='bookmark' title='Permanent Link: Position Ad Units in Posts'>Position Ad Units in Posts</a> <small>Photo credit: AMagill Ever since I started placing AdSense units...</small></li>
<li><a href='http://www.zparacha.com/doctype-explained/' rel='bookmark' title='Permanent Link: An HTML element you don&#39;t want to omit.'>An HTML element you don&#39;t want to omit.</a> <small>As web developers we have the tendency to blame web...</small></li>
<li><a href='http://www.zparacha.com/textfield_focus/' rel='bookmark' title='Permanent Link: Set focus on the first text field of HTML form.'>Set focus on the first text field of HTML form.</a> <small>A HTML form is a very good channel that you...</small></li>
</ul>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.zparacha.com/how-to-position-html-element-in-the-center-using-css/' addthis:title='How to position HTML element in the center using CSS.' ><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like"></a></div><p><!--adsense#greyLeft-->Positioning text in the center of an element is easily done using text-align:center property. But how do you position an entire element, for e.g; a div or an image in the center of the containing parent element?</p>
<p>For example, if you want to put an image at the center of your header div how do you accomplish this?</p>
<p>There are several ways to align an element in the center but the preferred and elegant method is to use <b>margin</b> property. <span id="more-1035"></span></p>
<p>By setting left and right margin widths to &#8220;auto&#8221; you tell the browser to put this element at the horizontal center of the the parent element.</p>
<div style="border:1px solid #333;background:#fff;width:450px;">
<h4>Outer DIV</h4>
<div style="margin:auto; background:#eee;width:50%">
THIS DIV is in the center of the parent div. We used following CSS declaration to align this div.</p>
<pre>
#outerDiv{
 background:#fff;
 border:1px solid #333;
 width:450px;

}
#innerDiv{
  <strong>margin:auto;</strong>
  background:#eee;
  width:50%
}
</div>
</div>
</pre>
<p>Piece of cake, huh? Not so fast. This approach will work in all browsers except, you guessed it, in IE6. I am sure you are not surprised that IE6 will not render this div as you would have expected. But there is a workaround for this IE6 behavior. You can set <strong>text-align</strong> property of the outer div to center and this will align your inner div nicely in the center in IE6. </p>
<p><!--adsense#tla--></p>
<p>This will, however, introduce a side effect. Since you are setting text-align property of the parent element to center, your inner div (the child) will inherit this property also and the text will be center-aligned. If you don&#8217;t want your text to be in the center, reset text-align property at the child level by adding <strong>text-align:left;</strong></p>
<p>So your final style sheet will have this declaration.</p>
<div style="border:1px solid #333;background:#fff;width:450px;text-align:center;">
<h4 style="text-align:left;">Outer DIV</h4>
<div style="margin:auto; background:#eee;width:50%;text-align:left;">
THIS DIV is in the center of the parent div. We used following CSS declaration to align this div.
<pre>
#outerDiv{
 background:#fff;
 border:1px solid #333;
 width:450px;
<strong> text-align:center;</strong>
}
#innerDiv{
 margin:auto;
 background:#eee;
 width:50%
 <strong>text-align:left;</strong>
}
</div>
</div>
</pre>
<p>Good luck!</p>
<div class="tweetmeme_button" style="float:right; margin: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.zparacha.com%2Fhow-to-position-html-element-in-the-center-using-css%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.zparacha.com%2Fhow-to-position-html-element-in-the-center-using-css%2F&amp;source=zparacha&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" title="How to position HTML element in the center using CSS." alt=" How to position HTML element in the center using CSS." /><br />
			</a>
		</div>
<p><a href="http://www.zparacha.com/how-to-position-html-element-in-the-center-using-css/">How to position HTML element in the center using CSS.</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'How to position HTML element in the center using CSS. on zParacha.com: Effective Programming tips',url: 'http://www.zparacha.com/how-to-position-html-element-in-the-center-using-css/',contentID: 'post-1035',signature: 'If you enjoyed this post, make sure you subscribe to my &lt;a href=\&quot;http://www.zparacha.com/feed/\&quot;&gt; RSS feed&lt;/a&gt;.',suggestTags: 'cascading_style_sheet,CSS,positioning,web development tools',providerName: 'zParacha.com: Effective Programming tips',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-vert.png" class="evernoteSiteMemoryButton" title="How to position HTML element in the center using CSS." alt="article clipper vert How to position HTML element in the center using CSS." />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.zparacha.com/how-to-position-html-element-in-the-center-using-css/' addthis:title='How to position HTML element in the center using CSS.' ><a class="addthis_button_googlereader"></a><a class="addthis_button_email"></a><a class="addthis_button_google"></a><a class="addthis_button_twitter"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like"></a><a class="addthis_button_compact"></a></div>

<p><span style="font-weight:bold;"> Related posts:</span><ul><li><a href='http://www.zparacha.com/ad_placement/' rel='bookmark' title='Permanent Link: Position Ad Units in Posts'>Position Ad Units in Posts</a> <small>Photo credit: AMagill Ever since I started placing AdSense units...</small></li>
<li><a href='http://www.zparacha.com/doctype-explained/' rel='bookmark' title='Permanent Link: An HTML element you don&#39;t want to omit.'>An HTML element you don&#39;t want to omit.</a> <small>As web developers we have the tendency to blame web...</small></li>
<li><a href='http://www.zparacha.com/textfield_focus/' rel='bookmark' title='Permanent Link: Set focus on the first text field of HTML form.'>Set focus on the first text field of HTML form.</a> <small>A HTML form is a very good channel that you...</small></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.zparacha.com/how-to-position-html-element-in-the-center-using-css/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Reset CSS: A simple solution to browsers&#8217; inconsistencies.</title>
		<link>http://www.zparacha.com/reset-css-a-simple-solution-to-browsers-inconsistencies/</link>
		<comments>http://www.zparacha.com/reset-css-a-simple-solution-to-browsers-inconsistencies/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 00:52:34 +0000</pubDate>
		<dc:creator>Zaheer Paracha</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[web development tools]]></category>

		<guid isPermaLink="false">http://www.zparacha.com/?p=989</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.zparacha.com/reset-css-a-simple-solution-to-browsers-inconsistencies/' addthis:title='Reset CSS: A simple solution to browsers&#8217; inconsistencies.' ><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like"></a></div>One of the challenges web designers face is to get various web browsers render their web pages in a consistent manner. The reason is every browser assigns slightly different default styles to certain page elements. A simple approach to handle this cross-browser inconsistency is to overwrite browsers&#8217; default styles. This technique is known as resetting [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.zparacha.com/reset-css-a-simple-solution-to-browsers-inconsistencies/' addthis:title='Reset CSS: A simple solution to browsers&#8217; inconsistencies.' ><a class="addthis_button_googlereader"></a><a class="addthis_button_email"></a><a class="addthis_button_google"></a><a class="addthis_button_twitter"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like"></a><a class="addthis_button_compact"></a></div><p><a href="http://www.zparacha.com/reset-css-a-simple-solution-to-browsers-inconsistencies/">Reset CSS: A simple solution to browsers&#8217; inconsistencies.</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>



<span style="font-weight:bold;"> Related posts:</span><ul><li><a href='http://www.zparacha.com/blogging_tips-2/' rel='bookmark' title='Permanent Link: Simple tips to make you a better blogger.'>Simple tips to make you a better blogger.</a> <small>Image credit:Kelly Sims To become a successful blogger is not...</small></li>
<li><a href='http://www.zparacha.com/how-to-position-html-element-in-the-center-using-css/' rel='bookmark' title='Permanent Link: How to position HTML element in the center using CSS.'>How to position HTML element in the center using CSS.</a> <small>Positioning text in the center of an element is easily...</small></li>
<li><a href='http://www.zparacha.com/css-text-resize/' rel='bookmark' title='Permanent Link: Dynamically Resize Text'>Dynamically Resize Text</a> <small>.codeText{color:blue;font-weight:normal;width:100%;} .subhead{color:gray;font-weight:bold;text-decoration:underline;} CSS, combined with little JavaScript, offers great flexibility...</small></li>
</ul>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.zparacha.com/reset-css-a-simple-solution-to-browsers-inconsistencies/' addthis:title='Reset CSS: A simple solution to browsers&#8217; inconsistencies.' ><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like"></a></div><p>One of the challenges web designers face is to get various web browsers  render their web pages in a consistent manner.  The reason is every browser assigns slightly different default styles to certain page elements. </p>
<p><!--adsense#greyLeft--><br />
A simple approach to handle this cross-browser inconsistency is to overwrite browsers&#8217; default styles. This technique is known as  <b>resetting <a id="aptureLink_W5qO178ej4" href="http://www.amazon.com/gp/product/1430223979?tag=zaheparc-20">CSS</a></b>. To me it is more like setting a starting point for your web page being rendered by various browser. By setting <i>(or resetting)</i> the base styles you start with a consistent base for each browser.<span id="more-989"></span><br />
Now the question is how to reset browser&#8217;s default style. <a href="http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/">Eric Meyer</a> created the following style sheet to reset browsers&#8217; default CSS style. </p>
<pre name="code" class="css">

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
	margin: 0;
	padding: 0;
	border: 0;
	outline: 0;
	font-weight: inherit;
	font-style: inherit;
	font-size: 100%;
	font-family: inherit;
	vertical-align: baseline;
}
/* remember to define focus styles! */
:focus {
	outline: 0;
}
body {
	line-height: 1;
	color: black;
	background: white;
}
ol, ul {
	list-style: none;
}
/* tables still need 'cellspacing="0"' in the markup */
table {
	border-collapse: separate;
	border-spacing: 0;
}
caption, th, td {
	text-align: left;
	font-weight: normal;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: "";
}
blockquote, q {
	quotes: "" "";
}
</pre>
<p>Many web developers considered this as the standard reset style sheet. Save this CSS as reset.css and include this file in your header file (or header section of every web page). Make sure that this style sheet comes before your other style sheets otherwise it will overwrite your styles. </p>
<p><!--adsense#tla--></p>
<div class="tweetmeme_button" style="float:right; margin: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.zparacha.com%2Freset-css-a-simple-solution-to-browsers-inconsistencies%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.zparacha.com%2Freset-css-a-simple-solution-to-browsers-inconsistencies%2F&amp;source=zparacha&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" title="Reset CSS: A simple solution to browsers inconsistencies." alt=" Reset CSS: A simple solution to browsers inconsistencies." /><br />
			</a>
		</div>
<p><a href="http://www.zparacha.com/reset-css-a-simple-solution-to-browsers-inconsistencies/">Reset CSS: A simple solution to browsers&#8217; inconsistencies.</a> is a post from: <a href="http://www.zparacha.com">zParacha.com | Effective programming and blogging tips by Zaheer Paracha</a></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Reset CSS: A simple solution to browsers\&#039; inconsistencies. on zParacha.com: Effective Programming tips',url: 'http://www.zparacha.com/reset-css-a-simple-solution-to-browsers-inconsistencies/',contentID: 'post-989',signature: 'If you enjoyed this post, make sure you subscribe to my &lt;a href=\&quot;http://www.zparacha.com/feed/\&quot;&gt; RSS feed&lt;/a&gt;.',suggestTags: 'CSS,web development tools',providerName: 'zParacha.com: Effective Programming tips',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-vert.png" class="evernoteSiteMemoryButton" title="Reset CSS: A simple solution to browsers inconsistencies." alt="article clipper vert Reset CSS: A simple solution to browsers inconsistencies." />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.zparacha.com/reset-css-a-simple-solution-to-browsers-inconsistencies/' addthis:title='Reset CSS: A simple solution to browsers&#8217; inconsistencies.' ><a class="addthis_button_googlereader"></a><a class="addthis_button_email"></a><a class="addthis_button_google"></a><a class="addthis_button_twitter"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_facebook_like"></a><a class="addthis_button_compact"></a></div>

<p><span style="font-weight:bold;"> Related posts:</span><ul><li><a href='http://www.zparacha.com/blogging_tips-2/' rel='bookmark' title='Permanent Link: Simple tips to make you a better blogger.'>Simple tips to make you a better blogger.</a> <small>Image credit:Kelly Sims To become a successful blogger is not...</small></li>
<li><a href='http://www.zparacha.com/how-to-position-html-element-in-the-center-using-css/' rel='bookmark' title='Permanent Link: How to position HTML element in the center using CSS.'>How to position HTML element in the center using CSS.</a> <small>Positioning text in the center of an element is easily...</small></li>
<li><a href='http://www.zparacha.com/css-text-resize/' rel='bookmark' title='Permanent Link: Dynamically Resize Text'>Dynamically Resize Text</a> <small>.codeText{color:blue;font-weight:normal;width:100%;} .subhead{color:gray;font-weight:bold;text-decoration:underline;} CSS, combined with little JavaScript, offers great flexibility...</small></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.zparacha.com/reset-css-a-simple-solution-to-browsers-inconsistencies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

