<?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>Web Design Blog &#124; Web Design Fan &#124; Resources for Web Designers and Graphic Designers &#187; XHTML</title>
	<atom:link href="http://webdesignfan.com/tag/xhtml/feed/" rel="self" type="application/rss+xml" />
	<link>http://webdesignfan.com</link>
	<description>Web Design Fan is a blog focused on the beautiful and interesting world of web design and development. We post tutorials, review web tools and services, give away graphics, and deliver all of the information web designers need the most.</description>
	<lastBuildDate>Mon, 21 May 2012 11:00:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>WDF Mobile App Landing Page XHTML Template</title>
		<link>http://webdesignfan.com/wdf-mobile-app-landing-page/</link>
		<comments>http://webdesignfan.com/wdf-mobile-app-landing-page/#comments</comments>
		<pubDate>Tue, 31 May 2011 14:30:57 +0000</pubDate>
		<dc:creator>Web Design Fan</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Premium]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[PSD]]></category>
		<category><![CDATA[Template]]></category>
		<category><![CDATA[wdf club]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://webdesignfan.com/?p=7929</guid>
		<description><![CDATA[Today we are bringing our <a href="http://webdesignfan.com/join-the-club/">Web Design Fan Club</a> members a simple and effective mobile app landing page template. Originally designed by Tomas Laurinavičius, this template is easy to edit and make your own. The package includes the XHTML and CSS files, as well as the original PSD. Take a look at our screenshot below for a look at the template or <a href="http://webdesignfan.com/design-a-clean-mobile-app-website-in-photoshop/">visit the original tutorial we posted here</a>.]]></description>
			<content:encoded><![CDATA[<h3>Join the Fan Club!</h3>
<p>You are currently viewing a premium &#8220;Member&#8217;s Only&#8221; post from the <a href="http://webdesignfan.com/join-the-club/">Web Design Fan Club</a>. To continue viewing this awesome content after June 16, you can become a member for the heavily discounted of <b>$36/year </b>or join us on a monthly basis for <b>$9/month</b> after June 16.</p>
<p>Did you read that right? Yes, yes you did. <b>$36 for the year (8 months free) </b>if you become a yearly subscriber before June 16. Seems kind of foolish to pass something like that up, eh?</p>
<p>Joining the <a href="http://webdesignfan.com/join-the-club/">Web Design Fan Club</a> grants you access to all the incredible resources and knowledge you need to become an expert web designer. From WordPress themes to premium icon sets and vectors, advanced tutorials to educational resources and files, the Web Design Fan Club delivers. Not only that, but you gain access to interviews with some of the best web designers and developers working today.</p>
<p><a href="http://webdesignfan.com/join-the-club/"><img title="moneyback" src="http://webdesignfan.com/wp-content/uploads/2011/04/moneyback.png" alt="moneyback " width="475" height="100" /></a></p>
<hr class="hrstyle" />
Today we are bringing our <a href="http://webdesignfan.com/join-the-club/">Web Design Fan Club</a> members a simple and effective mobile app landing page template. Originally designed by Tomas Laurinavičius, this template is easy to edit and make your own. The package includes the XHTML and CSS files, as well as the original PSD. Take a look at our screenshot below for a look at the template or <a href="http://webdesignfan.com/design-a-clean-mobile-app-website-in-photoshop/">visit the original tutorial we posted here</a>. The template was coded by Charles Stover, another talented WDF contributor.</p>
<p><a href="http://webdesignfan.com/wp-content/uploads/2011/05/Screen-shot-2011-05-31-at-4.49.19-AM.png"><img class="alignnone size-full wp-image-7931" title="Screen shot 2011-05-31 at 4.49.19 AM" src="http://webdesignfan.com/wp-content/uploads/2011/05/Screen-shot-2011-05-31-at-4.49.19-AM.png" alt="Screen shot 2011 05 31 at 4.49.19 AM " width="641" height="575" /></a></p>
<p><a href="http://webdesignfan.com/downloads/webdesignfan-app-landing-page.zip">Download the mobile app landing page theme here</a>.</p>
<p>You can easily check out our best quality <a href="http://www.thetestking.info/MB7-225-exam.html">MB7-225</a>  which prepare you well for the real <a href="http://www.thepass4sure.info/70-565-test.html">70-565</a> exam. You can also get success in real <a href="http://www.pass4sures.biz/MB7-231-testking.html">MB7-231</a> exam with the quality <a href="http://www.mypass4sure.info/70-653-dumps.html">70-653</a>.
<div class="shr-publisher-7929"></div>
]]></content:encoded>
			<wfw:commentRss>http://webdesignfan.com/wdf-mobile-app-landing-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using jQuery to Open Standards Compliant XHTML Links in New Tabs or Windows</title>
		<link>http://webdesignfan.com/using-jquery-to-open-standards-compliant-xhtml-links-in-new-tabs-or-windows/</link>
		<comments>http://webdesignfan.com/using-jquery-to-open-standards-compliant-xhtml-links-in-new-tabs-or-windows/#comments</comments>
		<pubDate>Wed, 17 Nov 2010 12:54:02 +0000</pubDate>
		<dc:creator>Charles Stover</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://webdesignfan.com/?p=5434</guid>
		<description><![CDATA[<p>This tutorial will teach you how to use JavaScript to open links in a new tab or window and remain standards compliant.</p><p>Using JavaScript to append a <var>target</var> tag does work. It works for the same reason it works to simply put the <var>target</var> attribute in the markup; the browser ignores your document type declaration, regardless of what you set it to be.</p>
<p>Setting <var>target</var> in JavaScript is not using JavaScript to open the window. It is the browser's interpretation of the <var>target</var> attribute, as defined by <em>non-standard</em> HTML, that opens the window. If the browser were to use actual XHTML standards, it wouldn't know what to do with a <var>target</var> attribute, whether it was set by the markup or set by JavaScript.</p>]]></description>
			<content:encoded><![CDATA[<h3><a name="tutorial"></a>In This Tutorial</h3>
<ol>
<li><a href="#intro">Introduction</a></li>
<li><a href="#why">Why a JavaScript-Set Target Attribute is Not Standards Compliant</a></li>
<li><a href="#how">How to Open Links in a New Tab or Window</a></li>
</ol>
<h3><a name="intro"></a>Introduction</h3>
<p>This tutorial, above all else, is a response to <a href="http://webdesignfan.com/using-jquery-to-create-target-attributes-for-xhtml-1-0-strict/" title="Using jQuery to Create Target Attributes for XHTML 1.0 Strict | Web Design Blog | Web Design Fan | Resources for Web Designers and Graphic Designers">Using jQuery to Create Target Attributes for XHTML 1.0 Strict</a>, which gives incorrect information. That tutorial is not fraudulent, but merely misinformative. With this article, I intend on discussing just two things: <a href="#why">why the previous article is not standards compliant</a>, and <a href="#how">how you are supposed to use JavaScript to open links in a new tab or window</a>.</p>
<div><a href="#tutorial">Back to Top</a></div>
<h3><a name="why"></a>Why a JavaScript-Set Target Attribute is Not Standards Compliant</h3>
<p>One thing that deserves emphasis is that the author of <a href="http://webdesignfan.com/using-jquery-to-create-target-attributes-for-xhtml-1-0-strict/" title="Using jQuery to Create Target Attributes for XHTML 1.0 Strict | Web Design Blog | Web Design Fan | Resources for Web Designers and Graphic Designers">the previous article</a> got something absolutely right: in XHTML, <q>functionality is [to be] handled by JavaScript.</q></p>
<p>What the author seems to forget is that standards compliance is not just about using compliant markup; it&#8217;s about using a compliant <acronym title="Document Object Module">DOM</acronym>. By using JavaScript to append a <var>target</var> attribute, you are still <em>appending a <var>target</var> attribute</em>. Under the XHTML standard, <var>target</var> should not even exist.</p>
<p>To best emphasize this point, imagine you have a strictly standards-compliant browser that only renders standards-compliant markup and programming. If you were to put a <var>target</var> attribute on a link, it would do nothing. If you were to apply a <var>target</var> attribute via JavaScript, it would still do nothing, because <var>target</var> is not an existing attribute.</p>
<p>Using JavaScript to append a <var>target</var> tag does work. It works for the same reason it works to simply put the <var>target</var> attribute in the markup; the browser ignores your document type declaration, regardless of what you set it to be.</p>
<p>Setting <var>target</var> in JavaScript is not using JavaScript to open the window. It is the browser&#8217;s interpretation of the <var>target</var> attribute, as defined by <em>non-standard</em> HTML, that opens the window. If the browser were to use actual XHTML standards, it wouldn&#8217;t know what to do with a <var>target</var> attribute, whether it was set by the markup or set by JavaScript.</p>
<p>Theoretically, standardized HTML is going to eventually replace the older HTML that we so loath. If this were to happen, browsers would stop interpreting <var>target</var>, and setting the value via JavaScript would make absolutely no difference.</p>
<p>If I haven&#8217;t emphasized it enough, I&#8217;ll be perfectly blunt: if your markup or programming would not work in a world where standards-compliant XHTML were the only hypertext markup language in existence, your code is not standards compliant.</p>
<p>But it passes validation! Yes, it does. That is entirely due to a limitation of validators: they don&#8217;t parse JavaScript; they ignore it. If you were to take a copy of the DOM after JavaScript has parsed and attempted to validate it, you would receive errors. <a href="http://www.google.com/chrome/intl/en/landing_chrome.html?hl=en" title="Google Chrome - Get a fast new browser. For PC, Mac, and Linux">Google Chrome</a> will give you a copy of the post-JavaScript DOM if you right-click the page and select &quot;Inspect Element,&quot; for those curious enough to see it themselves.</p>
<p>Here is an example document that will pass pre-parse validation, but not post-parse validation:</p>
<pre class="html"><span class="htmlOtherTag">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;
	&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;</span>
<span class="htmlOtherTag">&lt;html xmlns=<span class="htmlAttributeValue">&quot;http://www.w3.org/1999/xhtml&quot;</span>&gt;</span>
	<span class="htmlOtherTag">&lt;head&gt;</span>
		<span class="htmlOtherTag">&lt;title&gt;</span>My Link Has a Target<span class="htmlOtherTag">&lt;/title&gt;</span>
		<span class="htmlOtherTag">&lt;meta name=<span class="htmlAttributeValue">&quot;content-type&quot;</span> content=<span class="htmlAttributeValue">&quot;text/html; charset=utf-8&quot;</span> /&gt;</span>
	<span class="htmlOtherTag">&lt;/head&gt;</span>
	<span class="htmlOtherTag">&lt;body&gt;</span>
		<span class="htmlOtherTag">&lt;div&gt;</span><span class="htmlAnchorTag">&lt;a href=<span class="htmlAttributeValue">&quot;http://www.charlesstover.com/&quot;</span>&gt;</span>Charles Stover<span class="htmlAnchorTag">&lt;/a&gt;</span><span class="htmlOtherTag">&lt;/div&gt;</span>
		<span class="htmlScriptTag">&lt;script type=<span class="htmlAttributeValue">&quot;text/javascript&quot;</span>&gt;</span>//<span class="htmlOtherTag">&lt;![CDATA[
			document.getElementsByTagName(&quot;a&quot;).item(0).setAttribute(&quot;target&quot;, &quot;_blank&quot;);
		//]]&gt;</span><span class="htmlScriptTag">&lt;/script&gt;</span>
	<span class="htmlOtherTag">&lt;/body&gt;</span>
<span class="htmlOtherTag">&lt;/html&gt;</span></pre>
<div><a href="#tutorial">Back to Top</a></p>
<h3><a name="how"></a>How to Open Links in a New Tab or Window</h3>
<p>Tracking back to what was said before, functionality is to be handled by JavaScript. If we want to open links in a new tab or window, we need to do so with pure JavaScript, not by using JavaScript to instruct the anchor to do it via HTML. The JavaScript-only method of doing this is with <var>window.open</var>.</p>
<p>I will do this jQuery, since jQuery is such a hot item these days. Links that are to be opened in a new window will be designated with the class <var>new-window</var>.</p>
<pre class="javascript">$(&quot;a.new-window[href]&quot;).live(
	&quot;click&quot;,
	function(event)
	{
		window.open($(this).attr("href"));
		event.preventDefault();
	}
);</pre>
<p>To translate this to English: We&#8217;re telling the browser to get all <code>&lt;a&gt;</code> elements that have the class <var>new-window</var> and a <var>href</var> value. When these elements, or future elements with these qualities, are clicked, the browser is to open a new window to the location provided in the <var>href</var> attribute. Lastly, the browser is to ignore its default action, which is to open the link in the same window.</p>
<p>Here is an example document that will pass pre-parse validation <em>and</em> post-parse validation:</p>
<pre class="html"><span class="htmlOtherTag">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;
	&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;</span>
<span class="htmlOtherTag">&lt;html xmlns=<span class="htmlAttributeValue">&quot;http://www.w3.org/1999/xhtml&quot;</span>&gt;</span>
	<span class="htmlOtherTag">&lt;head&gt;</span>
		<span class="htmlOtherTag">&lt;title&gt;</span>My Link Has an Event<span class="htmlOtherTag">&lt;/title&gt;</span>
		<span class="htmlOtherTag">&lt;meta name=<span class="htmlAttributeValue">&quot;content-type&quot;</span> content=<span class="htmlAttributeValue">&quot;text/html; charset=utf-8&quot;</span> /&gt;</span>
		<span class="htmlScriptTag">&lt;script src=<span class="htmlAttributeValue">&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js&quot;</span> type=<span class="htmlAttributeValue">&quot;text/javascript&quot;</span>&gt;</span><span class="htmlScriptTag">&lt;/script&gt;</span>
	<span class="htmlOtherTag">&lt;/head&gt;</span>
	<span class="htmlOtherTag">&lt;body&gt;</span>
		<span class="htmlOtherTag">&lt;div&gt;</span><span class="htmlAnchorTag">&lt;a class=<span class="htmlAttributeValue">&quot;new-window&quot;</span> href=<span class="htmlAttributeValue">&quot;http://www.charlesstover.com/&quot;</span>&gt;</span>Charles Stover<span class="htmlAnchorTag">&lt;/a&gt;</span><span class="htmlOtherTag">&lt;/div&gt;</span>
		<span class="htmlScriptTag">&lt;script type=<span class="htmlAttributeValue">&quot;text/javascript&quot;</span>&gt;</span>//<span class="htmlOtherTag">&lt;![CDATA[
			$(&quot;a.new-window[href]&quot;).live(
				&quot;click&quot;,
				function(event)
				{
					window.open($(this).attr(&quot;href&quot;));
					event.preventDefault();
				}
			);
		//]]&gt;</span><span class="htmlScriptTag">&lt;/script&gt;</span>
	<span class="htmlOtherTag">&lt;/body&gt;</span>
<span class="htmlOtherTag">&lt;/html&gt;</span></pre>
<div><a href="#tutorial">Back to Top</a></div>
</div>
<div class="shr-publisher-5434"></div>
]]></content:encoded>
			<wfw:commentRss>http://webdesignfan.com/using-jquery-to-open-standards-compliant-xhtml-links-in-new-tabs-or-windows/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Using jQuery to Create Target Attributes for XHTML 1.0 Strict</title>
		<link>http://webdesignfan.com/using-jquery-to-create-target-attributes-for-xhtml-1-0-strict/</link>
		<comments>http://webdesignfan.com/using-jquery-to-create-target-attributes-for-xhtml-1-0-strict/#comments</comments>
		<pubDate>Mon, 18 Oct 2010 21:09:54 +0000</pubDate>
		<dc:creator>Ben Harold</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[accessibility]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://webdesignfan.com/?p=5115</guid>
		<description><![CDATA[<p>If you're serious about web standards, there's no good reason to stick with the XHTML 1.0 transitional doctype declaration.</p>

<p>As development of web standards has progressed, there has been an increasing push to abstract all of the layout and functionality of a web page from the content. The theory goes that XHTML should only be used to define the content of the page, while layout is left to CSS and functionality is handled by JavaScript.</p><p> </p><p>This has led to the depreciation of the <code>target</code> attribute in XHTML 1.0 transitional, while it was dropped altogether from the XHTML 1.0 strict specification. What this means is that if you want to take advantage of the benefits of using the XHTML 1.0 strict specification, you shouldn't be using the <code>target</code> attribute in any of your links.</p>]]></description>
			<content:encoded><![CDATA[<h2>XHTML 1.0 strict vs. XHTML 1.0 transitional</h2>
<p>If you&#8217;re serious about web standards, there&#8217;s no good reason to stick with the XHTML 1.0 transitional doctype declaration. While there are significant differences between the strict and transitional XHTML standards, the majority of them apply to inline styling of XHTML elements, which is forbidden by the XHTML strict specification. If you&#8217;re like me, you&#8217;ve been using CSS to stylize your XHTML for years now, having long ago dropped usage of the <code>&lt;center&gt;</code> element and the <code>border</code> attribute in your markup. However, there are some nuances to the XHTML 1.0 strict specification that require a bit more effort than simply switching to CSS.</p>
<h2>The target attribute and its humble beginnings</h2>
<p>A practice that became common almost immediately upon its conception is use of the <code>target</code> attribute to specify where a link should be opened. The <code>target</code> attribute was introduced way back when Netscape 2.0 was released. Among many other innovations, Netscape 2.0 brought us the then-vaunted &#8220;frames&#8221; feature. With the introduction of frames, web developers needed some way to specify the specific frame in which a link would be opened. While frames based website had their 15 minutes, the <code>target</code> attribute has stuck around like Clark Griswold&#8217;s cousin Eddie. Today, when linking to an out-of-domain website, many site owners prefer to have the external link opened in a separate tab or browser window. Arguing the pros and cons of this paradigm is beyond the scope of this article. Suffice it to say that the practice is widespread and necessary for all designers and developers to be familiar with.</p>
<h2>XHTML 1.0 strict and the target attribute</h2>
<p>As development of web standards has progressed, there has been an increasing push to abstract all of the layout and functionality of a web page from the content. The theory goes that XHTML should only be used to define the content of the page, while layout is left to CSS and functionality is handled by JavaScript. This has led to the depreciation of the <code>target</code> attribute in XHTML 1.0 transitional, while it was dropped altogether from the XHTML 1.0 strict specification. What this means is that if you want to take advantage of the benefits of using the XHTML 1.0 strict specification, you shouldn&#8217;t be using the <code>target</code> attribute in any of your links.</p>
<h2>The solution</h2>
<p>As mentioned previously, the functionality of a user-interface is left to JavaScript in a standards-friendly world. In order to emulate the functionality of the target attribute without breaking our standards-compliance, we need to use JavaScript trickery. While there are multiple methods to achieving this, I&#8217;ll focus on the easiest method that I&#8217;ve found.</p>
<h2>jQuery</h2>
<p>For this solution, we&#8217;ll use the jQuery JavaScript library. The first thing we&#8217;ll need to do is include the jQuery library in the head of our XHTML document. I personally use Google code to provide the necessary JavaScript files for my projects, but hosting the script on your own server is a perfectly viable alternative. The script elements, when using Google code, end up looking something like this:</p>
<div>
<pre><code>
&lt;script src="//www.google.com/jsapi?key=MY_GOOLE_CODE_API_KEY" type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;
</code></pre>
</div>
<p>Notice that I&#8217;ve specified the src attribute without appending &#8220;http:&#8221; to the beginning of it. This allows the scripts to be pulled from either http: or https: as the individual page demands.</p>
<h2>Modifying our links</h2>
<p>Now that we&#8217;ve included our jQuery library, we&#8217;ll take a moment to consider our links. We want to specify that certain links are intended to be opened in external browser windows. jQuery will allow us to select individual elements based on the element name, whether or not they have a specific attribute, or if they have a specific attribute with a specific value. I choose to use the class attribute for several reasons:</p>
<ul>
<li>Unlike the id attribute, the same class attribute can appear many times on one page</li>
<li>We can use the class attribute to stylize our external links in a specific manner</li>
<li>Most novice designers are familiar with the class attribute</li>
</ul>
<p>So, the first thing we want to do is to designate a specific class attribute value to correspond with external links. Let&#8217;s choose a name specific to our task:</p>
<div><code>class="open-in-new-window"</code></div>
<p>Now we need to go through our site and apply this class value to any link that should be opened in a new window. For example:</p>
<div><code><br />
&lt;a class="open-in-new-window" href=http://www.example.com&gt;example link&lt;/a&gt;<br />
</code></div>
<p>We can now use jQuery to apply functionality to these links. We want them to open in a new window, and what&#8217;s the easiest way to do that? How about applying a target attribute?</p>
<h2>Applying the target attribute with jQuery</h2>
<p>All of our external links have a &#8220;open-in-new-window&#8221; class applied to them. This makes the selection of those links with jQuery trivial:</p>
<div><code>$('.open-in-new-window');</code></div>
<p>That simple line of code will select any element on the page with an &#8220;open-in-new-window&#8221; class applied to it. We can get more specific, selecting only anchor link elements:</p>
<div><code>$('a.open-in-new-window');</code></div>
<p>In and of itself, that line of code does nothing but select the elements in question. We want to add a target attribute to those links. Thanks to jQuery, adding attributes is trivial:</p>
<div><code>$('a.open-in-new-window').attr('target', '_blank');</code></div>
<p>In order to make sure this line of code isn&#8217;t executed too soon (i.e. before the page finishes loading) we wrap it in the standard jQuery &#8220;wait until the document is ready&#8221; function:</p>
<pre><code>
$(document).ready(function() {
	$('a.open-in-new-window').attr('target', '_blank');
});
</code></pre>
<p>That&#8217;s all there is to it. We now have a standards-compliant page with anchor links that have <code>target</code> attributes.</p>
<h2>The not-so-double-standard</h2>
<p>Now, you may be saying to yourself &#8220;I thought we were eliminating the <code>target</code> attribute.&#8221; We are eliminating the <code>target</code> attribute from the XHTML markup. Nothing in the XHTML 1.0 strict specification prevents us from adding the attribute via JavaScript. It&#8217;s analogous to the situation in which we remove <code>&lt;center&gt;</code> elements from an old site. We can simply replace the <code>&lt;center&gt;</code> elements with <code>&lt;div class="center"&gt;</code> elements, then specify the following in our CSS:</p>
<div><code>.center {text-align:center;}</code></div>
<p>By itself, the <code>&lt;div class="center"&gt;</code> element has no layout-specific functionality beyond the plain-old <code>&lt;div&gt;</code> element. It is only when this element is coupled with CSS that the layout change is applied.</p>
<p>As such, our solution doesn&#8217;t mean a thing if you don&#8217;t consider the JavaScript involved. Any user without JavaScript enabled will have plain-old links that open in the same browser window. Any validator that reads our markup will see the same thing, a plain link with no <code>target</code> attribute. It is only through the functionality of JavaScript that our solution is applied. And since functionality of a user-interface is relegated to JavaScript, we&#8217;ve stuck to the abstraction paradigm to which all good web developers take heed.</p>
<p>We offer up to date <a href="http://www.testkings.mobi/70-513-exam.html">testking 70-513</a> practice questions with self paced test engine to help you pass <a href="http://www.testking.biz/testking-70-643.htm">Testking 70-643</a> exam and complete your <a href="http://www.thepass4sure.net/HP0-J40.html">HP0-J40</a> &#038; <a href="http://www.realtests.com/training/DB2.htm">db2 certification</a>, you should also find <a href="http://www.testkings.ws/1Y0-A05-exam.html">testking 1Y0-A05</a> for your complete task.
<div class="shr-publisher-5115"></div>
]]></content:encoded>
			<wfw:commentRss>http://webdesignfan.com/using-jquery-to-create-target-attributes-for-xhtml-1-0-strict/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Code a Modern Design Studio from PSD to HTML</title>
		<link>http://webdesignfan.com/code-a-modern-design-studio-from-psd-to-html/</link>
		<comments>http://webdesignfan.com/code-a-modern-design-studio-from-psd-to-html/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 07:59:47 +0000</pubDate>
		<dc:creator>Ryan Turki</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[PSD]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://webdesignfan.com/?p=3311</guid>
		<description><![CDATA[Today we're going to convert the <strong>Modern Design Studio PSD Template</strong> created by Tomas Laurinavičius a few days ago to a clean and working XHTML/CSS code. You can download free PSD from <strong><a href="http://webdesignfan.com/free-modern-design-studio-psd-template/">The Modern Design Studio PSD Template</a></strong>.]]></description>
			<content:encoded><![CDATA[<p>Today we&#8217;re going to convert the <strong>Modern Design Studio PSD Template</strong> created by Tomas Laurinavičius a few days ago to a clean and working XHTML/CSS code. You can download free PSD from <strong><a href="http://webdesignfan.com/free-modern-design-studio-psd-template/">The Modern Design Studio PSD Template</a></strong>.</p>
<h3>The Final Result</h3>
<p>If you follow along with the tutorial, you will end up with the following <strong><a href="http://webdesignfan.com/demo/psd-to-html/index.html">result</a></strong>.</p>
<p><a href="http://webdesignfan.com/demo/psd-to-html/index.html"><img class="aligncenter size-full wp-image-3337" title="Code a Web Template from PSD to HTML" src="http://webdesignfan.com/wp-content/uploads/2010/02/Final.jpg" alt="Code a Web Template from PSD to HTML" width="590" height="460" /></a></p>
<h3>Setting up the files</h3>
<p>Start out by creating a new folder on your computer in which we will put all of the site files. I named it <strong>ModerndesignStudio</strong>. Create another folder in your working folder you just created and call it images, it will contain all the images of the site. Next open up your favorite code editor (I use Dreamweaver) and create a new HTML file titled <strong>index.html</strong> in the root of the folder, this will be our main page template. Now create a new css file, and name it <strong>style.css</strong>.</p>
<p><img class="aligncenter size-full wp-image-3340" title="Code a Web Template from PSD to HTML" src="http://webdesignfan.com/wp-content/uploads/2010/02/img1.jpg" alt="Code a Web Template from PSD to HTML" width="590" height="350" /></p>
<p>Open up your <strong>index.html</strong> file. At the top of your document inside the head tags, link to your style sheet (<strong>style.css</strong>) so that it&#8217;s ready to go. You can use the code below.</p>
<pre class="brush:xml">&lt;link <strong>href="style.css"</strong> rel="stylesheet" type="text/css" /&gt;</pre>
<p>So your code will looks like this one:</p>
<pre class="brush:xml">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;title&gt;Modern Design Studio&lt;/title&gt;
&lt;link href="style.css" rel="stylesheet" type="text/css" /&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;/body&gt;
&lt;/html&gt;</pre>
<h3>Setting up the html structure</h3>
<p>Now we will set the structure of our html file. I&#8217;m going to set 3 sections (header, content, footer) like I did here:</p>
<pre class="brush:html">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;link rel="stylesheet" type="text/css" href="style.css" /&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id="<strong>header</strong>"&gt;

&lt;/div&gt;
&lt;div id="<strong>content</strong>"&gt;

&lt;/div&gt;
&lt;div id="<strong>footer</strong>"&gt;

&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<h3>Slicing the background</h3>
<p>Our psd file includes a lot of textures and splashes so I&#8217;m going to slice the psd block by block so we will not loose these beautiful designs. Also, I&#8217;m going to add a div in each section which I&#8217;ll call <strong>container</strong> to align our web page contents.</p>
<pre class="brush:xml">&lt;body&gt;
&lt;div id="header"&gt;
  &lt;div id="<strong>container</strong>"&gt;

  &lt;/div&gt;
&lt;/div&gt;
&lt;div id="content"&gt;
  &lt;div id="<strong>container</strong>"&gt;

  &lt;/div&gt;
&lt;/div&gt;
&lt;div id="footer"&gt;
  &lt;div id="<strong>container</strong>"&gt;

  &lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;</pre>
<p>Now let&#8217;s begin with opening the <a href="http://webdesignfan.com/free-modern-design-studio-psd-template/"><strong>psd layout</strong></a> in Photoshop, hide everything except the &#8220;Background&#8221; and &#8220;Background texture&#8221;.</p>
<p><img class="aligncenter size-full wp-image-3343" title="Code a Web Template from PSD to HTML" src="http://webdesignfan.com/wp-content/uploads/2010/02/img2.jpg" alt="Code a Web Template from PSD to HTML" width="232" height="216" /></p>
<p>Now take the Slice Tool (C), select the background, go to File, Save for Web &amp; Devices (Alt + Shift + Ctrl + S) and change the image&#8217;s width to 1600px. Then save it under the name of <strong>background.jpg</strong> in your images folder.</p>
<p><img class="aligncenter size-full wp-image-3346" title="Code a Web Template from PSD to HTML" src="http://webdesignfan.com/wp-content/uploads/2010/02/img3.jpg" alt="Code a Web Template from PSD to HTML" width="318" height="115" /></p>
<h3>Coding the template’s body background</h3>
<p>Now that we have our background image sliced out of the Photoshop document, we can begin coding. Open up your CSS file (<strong>style.css</strong>) in your source code editor, and then use the following code.</p>
<pre class="brush:xml">* {
   margin: 0px;
   padding: 0px;
}
body
{
   background:url(images/background.jpg);
}
#container
{
   margin: auto;
   width: 960px;
}</pre>
<p>Let’s go over the styles in more detail.<br />
First, we reset all of our elements margins and paddings to <strong>0</strong> to avoid cross-browser inconsistencies. We do this with the * selector.<br />
Next, we style the body element: we set <strong>background.jpg</strong> as it’s background property.<br />
Finally, we style the #container margins to auto to center the layout, and set a fixed width of 960px.</p>
<h3>Slicing the header</h3>
<p>Go back to Photoshop and hide everything in the <strong>Header</strong> folder except the Header and Header texture layers, pick the slice tool and select the header section and save it for Web &amp; Devices under the name of <strong>header.jpg</strong> in the images folder.</p>
<h3>Coding the header&#8217;s background</h3>
<p>In your css file add this code:</p>
<pre class="brush:xml">#header
{
	background:url(images/header.jpg);
	height:124px;
}</pre>
<p>In this code I styled the header element. I set <strong>header.jpg</strong> as it’s background, and I set it&#8217;s height to 124px.</p>
<h3>Slicing the logo/site name</h3>
<p>Now hide all of the Header, Background, Header texture and the Background texture layers. With your slice tool select the logo and the slogan and save them like we did earlier under the name of <strong>logo.png</strong>.</p>
<p><img class="aligncenter size-full wp-image-3349" title="Code a Web Template from PSD to HTML" src="http://webdesignfan.com/wp-content/uploads/2010/02/img4.jpg" alt="Code a Web Template from PSD to HTML" width="390" height="144" /></p>
<h3>Adding the logo to the html</h3>
<p>Now switch back to your HTML document. Inside #header #container, create a new div with an ID of logo.</p>
<pre class="brush:xml">&lt;div id="header"&gt;
   &lt;div id="container"&gt;
      &lt;div id="logo"&gt;&lt;a href="#"&gt;&lt;img src="images/logo.png" class="logo"&gt;&lt;/a&gt;&lt;/div&gt;
   &lt;/div&gt;
&lt;/div&gt;</pre>
<p>Now, let’s move over to the stylesheet. To style our #logo section elements. Here is the CSS code.</p>
<pre class="brush:xml">.logo
{
	margin-top:20px;
	border:none;
}</pre>
<h3>Coding the navigation</h3>
<p>Still inside the #header #container, create a simple unordered list containing the navigation links. Here’s the code block for the navigation.</p>
<pre class="brush:xml">&lt;div id="header"&gt;
   &lt;div id="container"&gt;
      &lt;div id="logo"&gt;&lt;a href="#"&gt;&lt;img src="images/logo.png" class="logo"&gt;&lt;/a&gt;&lt;/div&gt;
      &lt;ul&gt;
      &lt;li&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;About&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;Work&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;Blog&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;Contact&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
   &lt;/div&gt;
&lt;/div&gt;</pre>
<h3>Styling the navigation</h3>
<p>Now, it’s time to add the CSS code for the navigation of the web template. Head on over to your stylesheet and use the following CSS:</p>
<pre class="brush:xml ">#header li
{
	color:#959595;
	list-style:none;
	float:left;
	margin-right:20px;
	font-family:"Myriad Pro",arial;
	font-weight:bold;
	font-size:24px;
}
#header li a
{
	color:#959595;
	text-decoration:none;
	padding:10px;
}
#header ul
{
	float:right;
	margin-top:-40px;
}
#header li a:hover
{
	background:#202020;
	color:#d2d2d2;
	-moz-border-radius:5px;
	-khtml-border-radius:5px;
	-webkit-border-radius:5px;
}</pre>
<p>I added some styles to #header li such as the color (#959595), I removed the list style, changed the font family to Myriad Pro, the font weight to bold, the font size to 24px and floated the li elements without forgetting the marging right to make some space between li elements.<br />
For the hover I used some <strong>CSS3</strong> features like the border radius and I changed the background color to <strong>#202020</strong>.</p>
<h3>Creating the featured box</h3>
<p>Now we&#8217;ve finished with the header section, let&#8217;s head over to the content section.</p>
<p>Let&#8217;s add two new divs in this section, the first #featured (it will contain the featured section) and the other #paragraphs.</p>
<pre class="brush:xml">&lt;div id="content"&gt;
  &lt;div id="container"&gt;
      &lt;div id="featured"&gt;

     &lt;/div&gt;
     &lt;div id="paragraphs"&gt;

     &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;</pre>
<p>In the psd file as we did before, select the slice tool and slice the featured box after hiding the more projects button and the little text then save it under the name of <strong>featured.jpg</strong>.</p>
<p><img class="aligncenter size-full wp-image-3352" title="Code a Web Template from PSD to HTML" src="http://webdesignfan.com/wp-content/uploads/2010/02/img5.jpg" alt="Code a Web Template from PSD to HTML" width="590" height="268" /></p>
<p>In your HTML file add this code to the featured div to add the more project link and some dummy text:</p>
<pre class="brush:xml">&lt;div id="content"&gt;
  &lt;div id="container"&gt;
     &lt;div id="featured"&gt;
       &lt;a href="#"&gt;MORE PROJECTS&lt;/a&gt;
       &lt;p class="dummytext"&gt;&lt;span&gt;Portfolio project, Jan 5th, 2010&lt;/span&gt; Have you
	   ever wanted to create clean and nice portfolio design? In this tutorial I
	   will show you how to design clean blue portfolio layout. Have you ever wanted
	   to create clean and nice portfolio design? In this tutorial I will show you how
	   to design clean blue portfolio layout in Adobe Photoshop.&lt;/p&gt;
     &lt;/div&gt;
     &lt;div id="paragraphs"&gt;

     &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;</pre>
<p>In the PSD file I will take the more project button and duplicate it and reverse the Gradient Overlay, slice both of the more project buttons and slice them(The dimensions are about 124px x 60px) and save the button under png-8 format and name it <strong>button.png.</strong></p>
<p><img class="aligncenter size-full wp-image-3355" title="Code a Web Template from PSD to HTML" src="http://webdesignfan.com/wp-content/uploads/2010/02/img6.jpg" alt="Code a Web Template from PSD to HTML" width="590" height="270" /></p>
<p>Now we&#8217;ve got the images ready let&#8217;s head over to the CSS file and add this code.</p>
<pre class="brush:xml">#featured
{
	background:url(images/featured.jpg) no-repeat;
	height:381px;
	margin-top:30px;
	margin-left:80px;
}
#featured a
{
	background:url(images/button.png);
	height:30px;
	width:124px;
	text-indent:-9999px;
	position:absolute;
	margin-top:330px;
	margin-left:180px;
}
#featured a:hover
{
	background-position:0px 30px;
}</pre>
<p>I will begin with explaining #featured: I set it&#8217;s background to the featured image that we have sliced, then I positioned it with some margins. For the more projects link I set the background to <strong>button.png</strong> the height 30px so we could get the top button, I removed the text with text-indent and positioned it with the margins. Don&#8217;t forget to set the button&#8217;s position to absolute. Now to get a nice hover effect I changed the background position.</p>
<p>Now I&#8217;m going to add some style to the dummytext element:</p>
<pre class="brush:xml">.dummytext
{
	color:#d2d2d2;
	width:245px;
	margin-top:150px;
	position:absolute;
	font-family:Arial, Helvetica, sans-serif;
	font-size:12px;
	line-height:180%;
	margin-left:290px;
}
.dummytext span
{
	font-size:16px;
	color:#191919;
	font-weight:bold;
}</pre>
<h3>Creating the paragraphs</h3>
<p>After we finished with the featured div let&#8217;s add some paragraphs to our content section.</p>
<pre class="brush:xml">&lt;div id="paragraphs"&gt;
       &lt;p class="paragraph"&gt;
         &lt;span&gt;BEAUTIFUL&lt;/span&gt;WebDesignFan is a design related blog about web design, photoshop, freebies
         and tutorials. We publish useful information dedicated to web designers and developers. Here you can find free
         resources like vectors, wordpress themes and a lot of inspiration.
       &lt;/p&gt;

       &lt;p class="paragraph"&gt;
         &lt;span&gt;EFFECTIVE&lt;/span&gt;WebDesignFan is a design related blog about web design, photoshop, freebies
         and tutorials. We publish useful information dedicated to web designers and developers. Here you can find free
         resources like vectors, wordpress themes and a lot of inspiration.
       &lt;/p&gt;

       &lt;p class="paragraph"&gt;
         &lt;span&gt;FUNCTIONAL&lt;/span&gt;WebDesignFan is a design related blog about web design, photoshop, freebies
         and tutorials. We publish useful information dedicated to web designers and developers. Here you can find free
         resources like vectors, wordpress themes and a lot of inspiration.
       &lt;/p&gt;
&lt;/div&gt;</pre>
<p>So our content section will looks like this:</p>
<pre class="brush:xml">&lt;div id="content"&gt;
  &lt;div id="container"&gt;
     &lt;div id="featured"&gt;
       &lt;a href="#"&gt;MORE PROJECTS&lt;/a&gt;
       &lt;p class="dummytext"&gt;&lt;span&gt;Portfolio project, Jan 5th, 2010&lt;/span&gt; Have you
	   ever wanted to create clean and nice portfolio design? In this tutorial I
	   will show you how to design clean blue portfolio layout. Have you ever wanted
	   to create clean and nice portfolio design? In this tutorial I will show you how
	   to design clean blue portfolio layout in Adobe Photoshop.&lt;/p&gt;
     &lt;/div&gt;
     &lt;div id="paragraphs"&gt;
       &lt;p class="paragraph"&gt;
         &lt;span&gt;BEAUTIFUL&lt;/span&gt;WebDesignFan is a design related blog about web design, photoshop, freebies
         and tutorials. We publish useful information dedicated to web designers and developers. Here you can find free
         resources like vectors, wordpress themes and a lot of inspiration.
       &lt;/p&gt;

       &lt;p class="paragraph"&gt;
         &lt;span&gt;EFFECTIVE&lt;/span&gt;WebDesignFan is a design related blog about web design, photoshop, freebies
         and tutorials. We publish useful information dedicated to web designers and developers. Here you can find free
         resources like vectors, wordpress themes and a lot of inspiration.
       &lt;/p&gt;

       &lt;p class="paragraph"&gt;
         &lt;span&gt;FUNCTIONAL&lt;/span&gt;WebDesignFan is a design related blog about web design, photoshop, freebies
         and tutorials. We publish useful information dedicated to web designers and developers. Here you can find free
         resources like vectors, wordpress themes and a lot of inspiration.
       &lt;/p&gt;
     &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;</pre>
<p>After adding this code to your HTML go to your CSS file and add these styles to the paragraphs.</p>
<pre class="brush:xml">#paragraphs span
{
	font-family:"Myriad pro", Helvetica, sans-serif;
	font-size:22px;
	font-weight:600;
	letter-spacing:-2px;
}
#paragraphs
{
	margin-left:80px;
	font-family:Arial, Helvetica, sans-serif;
	color:#191919;
	font-size:12px;
	margin-top:15px;
}
.paragraph
{
	width:250px;
	margin-left:15px;
	float:left;
}</pre>
<p>Here is what you will end up with:</p>
<p><img class="aligncenter size-full wp-image-3358" title="Code a Web Template from PSD to HTML" src="http://webdesignfan.com/wp-content/uploads/2010/02/img7.jpg" alt="Code a Web Template from PSD to HTML" width="590" height="326" /></p>
<h3>Slicing the footer</h3>
<p>Now we finished with the header and te content sections and we will begin creating the footer section.</p>
<p>First, in your psd file hide every thing in the footer folder except the Footer and Footer texture layers, then slice the footer and save it as <strong>footer.jpg</strong>. You can take a look at this image below.</p>
<p><img class="aligncenter size-full wp-image-3359" title="Code a Web Template from PSD to HTML" src="http://webdesignfan.com/wp-content/uploads/2010/02/img8.jpg" alt="Code a Web Template from PSD to HTML" width="590" height="247" /></p>
<p>Then slice the <strong>Follow Us</strong> button and the <strong>birds image</strong>. Name the first one <strong>follow.png</strong> and the second <strong>bird.jpg</strong>.</p>
<h3>Coding the footer</h3>
<p>Our footer section will contain some text, a link to twitter and the birds image.</p>
<p>So here is the HTML code to add these blocks.</p>
<pre class="brush:xml">&lt;div id="footer"&gt;
  &lt;div id="container"&gt;
    &lt;p&gt;2010 © Fictional Design Studio. Design by Webdesignfan.&lt;/p&gt;
    &lt;a href="#"&gt;Follow us on Twitter&lt;/a&gt;
    &lt;img src="images/bird.jpg" /&gt;
  &lt;/div&gt;
&lt;/div&gt;</pre>
<p>Now, we style our footer section using the following styles (go to your stylesheet and place this code block in there).</p>
<pre class="brush:xml">#footer
{
	background:url(images/footer.jpg);
	height:71px;
	margin-top:191px;
}
#footer p
{
	font-family:Arial, Helvetica, sans-serif;
	font-size:12px;
	color:#959595;
	position:absolute;
	margin-top:30px;
}
#footer a
{
	background:url(images/follow.png);
	text-indent:-9999px;
	position:absolute;
	height:27px;
	width:124px;
	margin-left:730px;
	margin-top:30px;
}
#footer img
{
	float:right;
	margin-top:10px;
}</pre>
<p>I used <strong>footer.jpg</strong> as the background of the footer, then I added some styles to the text included in the footer (The p element).</p>
<p>For the follow link I used the same techniques that we applyed with the more project link, then for the bird image I floated it to the right and used the margin.</p>
<h3>And we’re all finished!</h3>
<p><a href="http://webdesignfan.com/demo/psd-to-html/index.html"><img class="aligncenter size-full wp-image-3360" title="Code a Web Template from PSD to HTML" src="http://webdesignfan.com/wp-content/uploads/2010/02/Final1.jpg" alt="Code a Web Template from PSD to HTML" width="590" height="460" /></a><a href="http://webdesignfan.com/demo/psd-to-html/index.html"></a></p>
<h4 style="text-align: center;"><a href="http://webdesignfan.com/demo/psd-to-html/index.html">Live Demo</a> // <a href="http://webdesignfan.com/demo/psd-to-html/coding-modern-design-studio.zip">Download the source files</a> (0,7 MB)</h4>
<p><!--Ads1--></p>
<p>Thanks for following along through the full tutorial. I hope you learned some coding techniques and PSD to XHTML/CSS tricks. Feel free to ask any questions and definitely let me know what you think in the comments area.</p>
<p>Join <a href="http://www.testking.com/SY0-201.htm">SY0-201</a> online web designing course to learn how to cod a modern design studio from psd to html.  Take advantage of the latest <a href="http://www.testking.com/70-680.htm">70-680</a> tutorials and <a href="http://www.testking.com/642-902.htm">642-902</a> study guide to learn different tips and techniques that you can use to design your web/blog page.
<div class="shr-publisher-3311"></div>
]]></content:encoded>
			<wfw:commentRss>http://webdesignfan.com/code-a-modern-design-studio-from-psd-to-html/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
