<?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>1stwebdesigner - Graphic and Web Design Blog &#187; html</title>
	<atom:link href="http://www.1stwebdesigner.com/tag/html/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.1stwebdesigner.com</link>
	<description>1stwebdesigner is a design blog dedicated to bloggers, freelancers, web-developers and designers. Topics focus on web design and inspirational articles.</description>
	<lastBuildDate>Sun, 12 Feb 2012 13:09:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Why is the Transition from Static Websites to Dynamic so Painful for Beginning Designers?</title>
		<link>http://www.1stwebdesigner.com/design/transition-static-dynamic-website/</link>
		<comments>http://www.1stwebdesigner.com/design/transition-static-dynamic-website/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 10:00:55 +0000</pubDate>
		<dc:creator>Tsveti</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[dynamic website]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[static website]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.1stwebdesigner.com/?p=55086</guid>
		<description><![CDATA[The times when the Web was static are history. Static HTML sites still have their place on the Web but the majority of sites are database-driven dynamic Web platforms that manage content, e-commerce, customer relations, etc. If a designer wants to stay current, he or she needs to be able to design both static and [...]]]></description>
			<content:encoded><![CDATA[<p>The times when the Web was static are history. Static HTML sites still have their place on the Web but the majority of sites are database-driven dynamic Web platforms that manage content, e-commerce, customer relations, etc. If a designer wants to stay current, he or she needs to be able to design both static and dynamic sites. However, as I have noticed, some designers I know have really hard times when they have to switch from static HTML sites to dynamic ones (blogs, CMS).</p>
<p>Designing static HTML sites is different from designing dynamic sites for sure but is it really that different and that complicated? And if it is, what can one do to overcome it?</p>
<p>CMS are not a new field for a Web designer anymore and it is a safe bet that they will always have a hefty share on the Web design market. Although there are many similarities in designing a static site and a CMS, there are certainly differences as well. To me, designing a CMS is easier than designing a static site but I do feel that both require a different skill set.<span id="more-55086"></span></p>
<p>For instance, if you want to come to friendly terms with a CMS, you need to have some knowledge of programming and databases because if you are totally unaware of the language in which the particular CMS is written and the database behind it, you will constantly stumble and fall. Probably this is the biggest difference between designing a static site and a CMS. I know many talented Web designers who have tried designing a CMS and the experience was very frustrating for them.</p>
<p>On the other hand, many CMS and content sites are <a href="http://www.1stwebdesigner.com/design/battle-psychedelic-minimalist-design/">minimalistic</a>, so they need less design work. Because of this, even if you are not the greatest designer on Earth, with some patience and diligence, you will be able to design great CMS templates. You are not starting from scratch and, just like with static sites, a good CMS template consists of layout and a stylesheet, so even if it is difficult at first, you will soon see that actually designing CMS sites is very easy.</p>
<h2>Before You Start</h2>
<p>Before you start with the layout and the stylesheet, you need some preparation. Here are two important things you may want to consider:</p>
<p><a href="http://www.1stwebdesigner.com/design/transition-static-dynamic-website/attachment/prepare-yourself/" rel="attachment wp-att-55087"><img class="aligncenter size-full wp-image-55087" title="Prepare Yourself" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/09/Prepare-Yourself.jpg" alt="" width="560" height="420" /></a></p>
<p>Image Credits: <a href="http://morguefile.com/archive/display/19615">clarita</a></p>
<ul>
<li><strong>Get familiar with your CMS</strong>. If you are new to CMS design, start familiarizing yourself with CMS in general and with your CMS in particular. Getting some basic idea about CMS is not so time-consuming. However, mastering the intricacies of a given CMS is a never-ending task. Be realistic and at first try to understand what your CMS can do and what it can&#8217;t do. Leave the more complex issues for later.</li>
<li><strong>Acquire some programming skills</strong>. If you have become a designer just because you hated programming, there is some bad news for you. If you want to handle a CMS successfully, you need to have at least some knowledge of the language (PHP, Python, ASP, JSP, etc.) in which it is written. Alternatively, find a programmer to help you. In many cases a complete CMS solution for a client involves not only the graphic work but also writing or modifying some modules, so you will either need to become a developer yourself, or seek the help of one.</li>
<li><strong>Study other designers&#8217; templates</strong>. The best way to see how things work in practice is to study what other designers have created. There are many great <a href="../freebies/the-ultimate-roundup-of-wordpress-tutorials-themes-and-guides/">tutorials</a> to read and <a href="../wordpress/70-free-and-premium-wordpress-themes/">free templates</a> you can study to get started.</li>
</ul>
<h2>Designing the Layout</h2>
<p>Designing the layout is one of the areas, where static sites and CMS differ. Yes, you still have menus, head at the top, variable or fixed width templates, and your own styles, and you can use your HTML layout as the basis, but some of these tasks are done differently with a CMS.</p>
<p><a href="http://www.1stwebdesigner.com/design/transition-static-dynamic-website/attachment/wordpress-index-php-file/" rel="attachment wp-att-55088"><img class="aligncenter size-full wp-image-55088" title="WordPress index.php File" src="http://www.1stwebdesigner.com/wp-content/uploads/2011/09/WordPress-index.php-File.png" alt="" width="547" height="515" /></a></p>
<p>CMS offer many great modules to make design layout flexible but they also have some quite illogical (for a beginner) constraints. Very often the successful approach to dealing with layout problems is by thinking and trying – and reading the postings in the support forums. CMS have their logic and sometimes, when you come from designing static sites, it is difficult at first.</p>
<p>For instance, a couple of years ago when I was new to Joomla, it took me some time to figure out how to have two or three columns of articles on the front page. I tried to do it within the index file to no avail. Then I tried with the stylesheet – no success either. Finally, I read in their support forum how to do it. The solution was very simple – the number of columns in the article area of the front page is set from the Admin panel!</p>
<p>Later, I wanted to have more columns in the module above the content area and I tried to find such a setting but there wasn&#8217;t. Still, having multiple columns (or in my case just cells because I was still using tables and it was a single row that had to be split) in a module was easily achievable in the index file. I was already familiar with the index file and splitting a module into three cells was a matter of seconds!</p>
<p>CMS allow to use different layout for different pages, so similarly to a static site, you will need to have layout for the homepage and the internal pages. You may also have a different layout for the different sections of the site (news, resources, forums, etc.). If you want, you can have a different layout for every single page of your site – CMS allow this – but in practice this idea is simply absurd.</p>
<p>In comparison to static sites, CMS have one enormous advantage – you can always change the layout later. You just upload the new template to the Admin panel, select the pages to apply it to – and that&#8217;s it. In this aspect, a CMS certainly beats any static technology and now when I occasionally have to go back to static HTML sites, I really hate it that content and presentation are so mixed up.</p>
<h2>Designing the Stylesheet</h2>
<p>The second component of a CMS template is the stylesheet. As with static sites, the stylesheet defines fonts, colors, margins, alignment, etc. Your knowledge about CSS for static sites applies to CMS as well, so at least this part of the transition to a CMS is easy.</p>
<p><a href="http://www.1stwebdesigner.com/design/transition-static-dynamic-website/attachment/wordpresscss/" rel="attachment wp-att-55091"><img class="aligncenter size-full wp-image-55091" title="WordPressCSS" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/09/WordPressCSS.png" alt="" width="531" height="668" /></a></p>
<p>CMS do not limit your freedom. You can have a fixed or a variable width template, with tables or a table-less template (though the same cross-browser issues are valid for CMS as well), you can apply backgrounds (including background images) to whatever you like, etc. At least this part of the transition shouldn&#8217;t be painful.</p>
<p>In conclusion, though there are some differences between the two type of sites, this is not a completely new are. In a sense, it is more like the transition from one programming language (i.e. PHP) to another (i.e. Java) &#8211; you need time to switch and all the minor differences are very confusing in the beginning. After all, for many Web designers the transition from static to dynamic sites was not a problem at all. It is interesting to know how it was for you. Did you have similar problems or was the transition smooth and barely noticeable?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.1stwebdesigner.com/design/transition-static-dynamic-website/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Simon&#8217;s Google Doodle &#8211; HTML5 + JS jQuery Game</title>
		<link>http://www.1stwebdesigner.com/css/simons-google-doodle-html-js-jquery-game/</link>
		<comments>http://www.1stwebdesigner.com/css/simons-google-doodle-html-js-jquery-game/#comments</comments>
		<pubDate>Wed, 24 Aug 2011 10:00:05 +0000</pubDate>
		<dc:creator>Rochester Oliveira</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[HTML & CSS]]></category>
		<category><![CDATA[JS & AJAX]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[google doodle]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[js game]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.1stwebdesigner.com/?p=49432</guid>
		<description><![CDATA[Dude, you&#8217;ve heard a lot about Google doodles haven&#8217;t you? What about that Pacman one? It is just addictive. Company owners know how a funny game and unlimited search powers could be dangerous for productivity. And how it can be a marketing boost. The most amazing thing is that we can create our own addictive [...]]]></description>
			<content:encoded><![CDATA[<p>Dude, you&#8217;ve heard a lot about Google doodles haven&#8217;t you? What about that Pacman one? It is just addictive. Company owners know how a funny game and unlimited search powers could be dangerous for productivity. And how it can be a marketing boost. The most amazing thing is that we can create our own addictive HTML game. Actually, this is why we are here today. With this tutorial you&#8217;ll see how to use some of JavaScript and HTML capabilities to build simple yet funny games.</p>
<p>So, let&#8217;s rock!</p>
<p><span id="more-49432"></span></p>
<h2>Demo first, please</h2>
<p>You can <a href="http://dl.dropbox.com/u/35995890/doodle/doodle.zip" target="_blank">download</a> or try our <a href="http://dl.dropbox.com/u/35995890/doodle/index.html" target="_blank">online demo</a>. Please, don&#8217;t forget to come back here if you want to just go playing first :)</p>
<p><img class="alignnone size-full wp-image-52224" title="demo" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/07/demo1.jpg" alt="" width="600" height="352" /></p>
<h2>“Well, actually I don&#8217;t know what a Doodle is..”</h2>
<p>Google Doodles started when Larry and Sergey played with the corporate logo to indicate their attendance at the Burning Man festival in the Nevada desert. Since that day we&#8217;ve seen a lot of funny Doodles, and Google&#8217;s homepage is used to remind us of all kind of important facts.</p>
<p>But they are more than just paintings, games or experiments. They are  made with the best current practices (some of them, created specifically for a Doodle). And Google being as supportive as they are of open source technology, usually release the commented source code, so you can just  take a look and try to understand what those amazing guys are doing.</p>
<p>Oh, and I don&#8217;t know if you knew about it, but today is Simon&#8217;s day according to 1stWebdesigner&#8217;s official fake holiday calendar. Seems important, right? This is why we&#8217;ll build a game for it.</p>
<h2>So, what will we be doing?</h2>
<p>Simon is one of my favorite games (just after Sudoku and Gammon). Can you think of an easier game to code? You know, four buttons, easy actions. I just can&#8217;t think of a better starting point to learn HTML5 gaming.</p>
<p>Well, first of all you need to know what this Simon thing looks like. I just found a picture of it at <a rel="nofollow" href="http://produto.mercadolivre.com.br/MLB-189683151-genius-da-estrela-icone-dos-anos-80-_JM">Mercado Livre</a> (kind of a Brazilian e-bay) and made my own version in Photoshop.</p>
<p>Since we are doing it via HTML5, the colors shouldn&#8217;t be directly on image (otherwise you won&#8217;t be able to change colors, make your own console&#8230;). So I&#8217;ve used <a href="http://css-tricks.com/9561-color-animate-any-shape-2/" target="_blank">Chris Coyier</a>&#8216;s technique for color animation. Basically we make our non-colored elements, and leave everything else transparent. Then our HTML5 will take care of the color itself (via CSS, background-color). Our final game background will be something like this:</p>
<p><img class="alignnone size-full wp-image-52226" style="border: 1px solid #f0f0f0;" title="bg" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/07/bg.jpg" alt="" width="300" height="300" /></p>
<p>Ok, then. Let&#8217;s start the fun part.</p>
<h2>Basic HTML + CSS</h2>
<p>Since our target isn&#8217;t basic HTML itself, I just grab a copy of <a href="http://html5boilerplate.com/">HTML5 Boilerplate</a> with a few edits to make it cleaner:</p>
<pre class="brush: php; title: ; notranslate">
&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
  &lt;meta charset=&quot;utf-8&quot;&gt;

  &lt;title&gt;Google.com - Simon's day  (1stWebDesigner.com game :D)&lt;/title&gt;

  &lt;link rel=&quot;stylesheet&quot; href=&quot;css/style.css?v=2&quot;&gt;
  &lt;script src=&quot;js/libs/modernizr-1.7.min.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;div id=&quot;container&quot;&gt;
    &lt;div id=&quot;main&quot;&gt;
	&lt;!-- Game controls and deisgn --&gt;
    &lt;/div&gt;
	&lt;form id=&quot;search&quot; action=&quot;#&quot; method=&quot;get&quot;&gt;
		&lt;input type=&quot;text&quot; name=&quot;query&quot; id=&quot;query&quot; /&gt;
		&lt;input type=&quot;submit&quot; value=&quot;search&quot; id=&quot;submit&quot; /&gt;
	&lt;/form&gt;
	&lt;div id=&quot;options&quot;&gt;
		&lt;!-- game options --&gt;
	&lt;/div&gt;
  &lt;/div&gt;

  &lt;script src=&quot;//ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js&quot;&gt;&lt;/script&gt;
  &lt;script src=&quot;js/script.js&quot;&gt;&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Now we need our gaming HTML stuff. As we&#8217;ve done it ready for different colors we will need to have two layers:</p>
<ul>
<li>Background color- sets the color and will be animated when you activate a button</li>
<li>Link &#8211; activates all actions for each colored button.</li>
<li>Alerts &#8211; since they are part of the game itself, we&#8217;ll put them with all other game controls (level up, new game, game over)</li>
</ul>
<p>Our HTML for this part will be something like this:</p>
<pre class="brush: php; title: ; notranslate">
	&lt;div id=&quot;main&quot;&gt;
	&lt;!-- lights --&gt;
		&lt;div id=&quot;box-0&quot; class=&quot;box&quot;&gt;&amp;nbsp;&lt;/div&gt;
		&lt;div id=&quot;box-1&quot; class=&quot;box&quot;&gt;&amp;nbsp;&lt;/div&gt;
		&lt;div id=&quot;box-2&quot; class=&quot;box&quot;&gt;&amp;nbsp;&lt;/div&gt;
		&lt;div id=&quot;box-3&quot; class=&quot;box&quot;&gt;&amp;nbsp;&lt;/div&gt;
	&lt;!-- buttons --&gt;
		&lt;a href=&quot;#&quot; class=&quot;box btnTL&quot; id=&quot;box-click-0&quot;&gt;&amp;nbsp;&lt;/a&gt;
		&lt;a href=&quot;#&quot; class=&quot;box btnTR&quot; id=&quot;box-click-1&quot;&gt;&amp;nbsp;&lt;/a&gt;
		&lt;a href=&quot;#&quot; class=&quot;box btnBL&quot; id=&quot;box-click-2&quot;&gt;&amp;nbsp;&lt;/a&gt;
		&lt;a href=&quot;#&quot; class=&quot;box btnBR&quot; id=&quot;box-click-3&quot;&gt;&amp;nbsp;&lt;/a&gt;
	&lt;!-- alerts --&gt;
		&lt;div id=&quot;letsRock&quot; class=&quot;alert&quot;&gt;
			&lt;p&gt;Ready? let's rock!&lt;/p&gt;
		&lt;/div&gt;
		&lt;div id=&quot;ohYes&quot; class=&quot;alert&quot;&gt;
			&lt;p&gt;Oh Yeah!&lt;/p&gt;
		&lt;/div&gt;
		&lt;div id=&quot;ohNoes&quot; class=&quot;alert&quot;&gt;
			&lt;p&gt;Oh Noes... Almost there! &lt;/p&gt;
		&lt;/div&gt;
	&lt;/div&gt;
</pre>
<p>As you can see, the four &#8220;div.box&#8221; elements are the background color for each button (red, blue, green, red).</p>
<p>So when someone clicks #box-click-0 it will &#8220;activate&#8221; the button #box-0. We have a lot of id&#8217;s because they result in better JS performance.</p>
<p>Our CSS for that will be:</p>
<pre class="brush: php; title: ; notranslate">
#main {
	position: relative;
	left: 155px;
	width: 200px;
	height: 200px;
}
	.box {
		display: block;
		float: left;
		width: 100px;
		height: 100px;
	}
	a.box {
		position: absolute;
		text-decoration: none;
		background-image: url(&quot;../img/bg_game.png&quot;);
		background-repeat: no-repeat;
	}
	a.box:focus {
		outline: none;
	}
	.btnTL { background-position: top left; }
	.btnTR { background-position: top right; }
	.btnBL { background-position: bottom left; }
	.btnBR { background-position: bottom right; }
		 .btnTL, .btnTR {
			top: 0;
		 }
		 .btnBL, .btnBR {
			bottom: 0;
		 }
		 .btnTL, .btnBL {
			left: 0;
		 }
		 .btnTR, .btnBR {
			right: 0;
		 }
	#box-0 {
		background: #c00000;
	}
	#box-1 {
		background: #1506a3;
	}
	#box-2 {
		background: #046606;
	}
	#box-3 {
		background: #ea8f0c;
	}
</pre>
<p>Here is our effect: all our links have the console background, bg_game.png (positioned according to what it should be, of course). Since they are on top of divs, what we will see is the bg_game.png AND the element&#8217;s color ( #c00000, #1506a3&#8230;).</p>
<p>Ok, we won&#8217;t be long on this. Maybe this is enough topic for a single article :)</p>
<h2>Search form</h2>
<p>Have you noticed the recent (ok, maybe not that recent) Google&#8217;s switch to real time results? That&#8217;s pretty cool, yeah, I know. But it makes a little bit harder to link directly to a search results page.</p>
<p>Since our demo has a search form and we want to make it work, let&#8217;s put a little JS magic on it:</p>
<pre class="brush: php; title: ; notranslate">
	&lt;form id=&quot;search&quot; action=&quot;#&quot; method=&quot;get&quot;&gt;
		&lt;input type=&quot;text&quot; name=&quot;query&quot; id=&quot;query&quot; /&gt;
		&lt;input type=&quot;submit&quot; value=&quot;search&quot; id=&quot;submit&quot; /&gt;
	&lt;/form&gt;
</pre>
<p>Javascript:</p>
<pre class="brush: php; title: ; notranslate">
$(function(){
	$(&quot;#search&quot;).submit( function(event) { event.preventDefault(); googleRedirect(); } );
});
function googleRedirect() {
	var query = $(&quot;#query&quot;).attr('value');
	var url = &quot;http://www.google.com/#q=&quot; + query + &quot;&amp;fp=1&quot;;
	window.location = url;
}
</pre>
<p>This way it will work ;)</p>
<h2>Cookies? No, no, local storage instead!</h2>
<p>Well, Cookies are great for some things, but this time they aren&#8217;t the very best option. Here we will make use of Local Storage. This is basically the same idea as Cookies, it allows you to store data related to your site, the difference is that it&#8217;s faster and very useful in some situations.</p>
<p>As its name suggest it is local, so it won&#8217;t be sent to the server (you save a few kbytes and processing). Cookies are limited to 4kB and 20 Cookies per domain. With local storage you can record up to 5MB of user data.</p>
<p>The only downside is that it works only on real browsers and IE8+. So, forget about IE7 this time (maybe later with some jQuery data fallback).</p>
<p>Another huge advantage is that it is surprisingly easy to set / remove;</p>
<pre class="brush: php; title: ; notranslate">
localStorage[&quot;level&quot;] = 15; // create it with 15 as value
var level = localStorage[&quot;level&quot;];  //now var level is 15
localStorage.removeItem( &quot;level&quot; ); //remove it!
</pre>
<p>So, this is why we will use it this time.</p>
<h2>A few options</h2>
<p>Then we need to have a way to start the game, see which level we&#8217;re playing, these sort of trivial things. For this, we&#8217;ll just put a simple HTML box with Google&#8217;s logo:</p>
<pre class="brush: php; title: ; notranslate">
&lt;div id=&quot;options&quot;&gt;
	&lt;ul&gt;
		&lt;li&gt;Level: &lt;span id=&quot;levelCount&quot;&gt;1&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;#&quot; onclick=&quot;newGame()&quot; &gt;New Game&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;High Score: &lt;span id=&quot;hs&quot;&gt;1&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;http://www.1stwebdesigner.com&quot; target=&quot;_blank&quot; &gt;Credits&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
&lt;/div&gt;
</pre>
<p>Well, what is important here is that our counters have id&#8217;s wrapping them, so we can easily change their text.</p>
<h2>Let the game begin</h2>
<h3>Random sequence</h3>
<p>The very first thing to do when you start this game should be to generate a random sequence. Because this sequence will be the &#8220;right path&#8221; to be followed by players. We could generate it on-the-fly as our gamer reaches new levels, but it will be easier to do this way.</p>
<p>So we will create a simple function that just generate a random sequence with 50 digits (levels) and only with numbers from 0 to 3 (our colors!):</p>
<pre class="brush: php; title: ; notranslate">
function randomSequence() {
	var chars = &quot;0123&quot;; // four colors!
	var string_length = 50; //pretty hard, isn't it?
	var sequence = &quot;&quot;;
	for (var i=0; i &lt; string_length; i++) { //we'll have from sequence[0] to sequence[49]
		var rnum = Math.floor(Math.random() * chars.length);
		sequence += chars.substring(rnum,rnum+1);
	}
	return sequence;
}
</pre>
<h3>Binding clicks and hovers</h3>
<p>Now we need to prepare our all a.box elements to recognize clicks and to animate properly our div.box when you hover any of them.</p>
<p>This time we will need jQuery .hover() and .click() functions:</p>
<pre class="brush: php; title: ; notranslate">
$(function(){
//caching our elements for better performance
box0 = $(&quot;#box-0&quot;);
box1 = $(&quot;#box-1&quot;);
box2 = $(&quot;#box-2&quot;);
box3 = $(&quot;#box-3&quot;);
clickbox0 = $(&quot;#box-click-0&quot;);
clickbox1 = $(&quot;#box-click-1&quot;);
clickbox2 = $(&quot;#box-click-2&quot;);
clickbox3 = $(&quot;#box-click-3&quot;);
clickbox0.click(
	function(event){
		event.preventDefault();
		clicked(0);
	}
);
clickbox1.click(
	function(event){
		event.preventDefault();
		clicked(1);
	}
);
clickbox2.click(
	function(event){
		event.preventDefault();
		clicked(2);
	}
);
clickbox3.click(
	function(event){
		event.preventDefault();
		clicked(3);
	}
);
var minHover = 0.7;
var maxHover = 1;
var timeHover = 500;
clickbox0.hover(
	function(){
		box0.stop().animate({opacity: minHover}, timeHover);
	}, function() {
		box0.stop().animate({opacity: maxHover}, timeHover);
	}
);
clickbox1.hover(
	function(){
		box1.stop().animate({opacity: minHover}, timeHover);
	}, function() {
		box1.stop().animate({opacity: maxHover}, timeHover);
	}
);
clickbox2.hover(
	function(){
		box2.stop().animate({opacity: minHover}, timeHover);
	}, function() {
		box2.stop().animate({opacity: maxHover}, timeHover);
	}
);
clickbox3.hover(
	function(){
		box3.stop().animate({opacity: minHover}, timeHover);
	}, function() {
		box3.stop().animate({opacity: maxHover}, timeHover);
	}
);
});
</pre>
<p>It is pretty important caching all our elements, since it improves a lot our performance.</p>
<h3>Magical JS variable variables and easy error detection</h3>
<p>At this point you have coded all the hover and click elements, but when you click them nothing happens, of course. Let&#8217;s fix it:</p>
<pre class="brush: php; title: ; notranslate">
// yeah, someone is playing it!
function clicked( color ) {
	// refresh my memory, how long have you gone so far?
	var level = localStorage[&quot;level&quot;]; // this is our current level
	var clicks = localStorage[&quot;clicks&quot;]; //this is our current item INSIDE one level
	var speed = localStorage[&quot;speed&quot;]; //to make it more fun, when you get right it goes faster
	// blink it!
	window['box' + color].stop().animate({ opacity: 0.3 }, (speed * 0.5) ).animate({ &quot;opacity&quot;: &quot;1&quot; }, (speed * 0.3) ); //variable variables in js via window[varname] :)
	// well, this time you've got it right?
	if ( localStorage[&quot;sequence&quot;][clicks] == color) {
		//oh, yeah!
		localStorage[&quot;clicks&quot;]++;
		//have you finished this level?
		if ( level == clicks) {
			nextLevel();
		}
	} else {
		//oh, noes!
		endGame();
	}
}
</pre>
<p>Every variable in javascript can be accessed via its own name, like box1 OR as an index inside window array, just like window['box1']. With this we can easily select which is the right element to blink (when you click any button, it should blink, right?).</p>
<h3>Ok, you are right! Let&#8217;s go to the next level</h3>
<p>When you get it right, the game should get you to the next level and the events should accelerate a little bit.</p>
<p>Then when you get it right you should also know which is the right sequence at your current level + 1, so let&#8217;s do it:</p>
<pre class="brush: php; title: ; notranslate">
function nextLevel() {
	//Oh, Yes
	showBox(&quot;#ohYes&quot;, 1000);
	// you deserve it, let's move on
	localStorage[&quot;level&quot;]++;
	levelCount.text(localStorage[&quot;level&quot;]);

	localStorage[&quot;clicks&quot;] = 0;
	//let's show you how it'll be
	current = 0; //since it's used just for animation, let's leave it as global var
	if ( localStorage[&quot;speed&quot;] &gt; 300 &amp;&amp; (localStorage[&quot;level&quot;] / 5) == 0 ) { //our maximum speed, and we'll only acelerate it each 5 levels
		localStorage[&quot;speed&quot;] = localStorage[&quot;speed&quot;] * 0.8;
	}
	setTimeout( function() { rightPath(); } , localStorage[&quot;speed&quot;] );
}
</pre>
<p>Function showBox  just shows our div and hides it after one second.</p>
<p>As you can see this piece of code isn&#8217;t complete, we will need the function rightPath() to see what comes next. Let&#8217;s go:</p>
<pre class="brush: php; title: ; notranslate">
function rightPath() {
	if ( current &lt;= localStorage[&quot;level&quot;] ) {
		var sel = localStorage[&quot;sequence&quot;][current];
		window['box' + sel].stop().animate({ &quot;opacity&quot;: &quot;0.5&quot; }, (localStorage[&quot;speed&quot;] * 0.5) ).animate({ &quot;opacity&quot;: &quot;1&quot; }, (localStorage[&quot;speed&quot;] * 0.3) );
		setTimeout(
			function() {
				rightPath();
			},
			(localStorage[&quot;speed&quot;] * (1.5) )
		);
		current++;
	}
	for (var i=0; i &lt;= localStorage[&quot;level&quot;] ; i++) {
		var time = 1000 * (i + 1);
	}
	i = 0;
}
</pre>
<p>This is kind of crazy, isn&#8217;t it? This is a simple recursive function. It will call itself, blink the right button for one position and then go to the next until we reach user&#8217;s current level.</p>
<h3>What if you get it wrong?</h3>
<p>Maybe instead of click the right button you can just click the wrong button. Then we need to punish you and ban you from the entire world wide web. Let&#8217;s see our function for that:</p>
<pre class="brush: php; title: ; notranslate">
function endGame() {
	//let's see if you have a high score, and save it
	if ( localStorage[&quot;hs&quot;] == undefined || localStorage[&quot;level&quot;] &gt; localStorage[&quot;hs&quot;] ) {
		localStorage[&quot;hs&quot;] = localStorage[&quot;level&quot;];
		$(&quot;#hs&quot;).text(localStorage[&quot;hs&quot;]);
	}

	localStorage.removeItem( &quot;level&quot; );
	// Oh, noes!
	showBox(&quot;#ohNoes&quot;, 2000);
}
</pre>
<p>Well, here we just check if you&#8217;ve done something better than this play and then remove your current level so you can restart a new game and try a little harder :)</p>
<p>By the way, did I mention how will you start a game? No? Sorry, my bad.</p>
<h3>Sorry, NOW the game will begin</h3>
<p>What do we have to do in order to start a match is to reset almost anything we have here and then show what is the right path.</p>
<pre class="brush: php; title: ; notranslate">
// just like starting over!
function newGame() {
	current = 0;
	levelCount.text(1);
	//let's call our sequence and memorize it
	localStorage[&quot;sequence&quot;] = randomSequence();
	//wow, we haven't got anything right until now :)
	localStorage[&quot;level&quot;] = 0;
	//clicks binding
	localStorage[&quot;clicks&quot;] = 0;
	//let's make things slow for now
	localStorage[&quot;speed&quot;] = 1500;
	//let's show our welcome warning
	showBox(&quot;#letsRock&quot;, 2000);
	//and let's show the first color
	rightPath();
}
</pre>
<h2>What is your best score?</h2>
<p>Hope you enjoy this quick HTML5 game tutorial and that you find some easter eggs, you know, since it&#8217;s a JS game we can&#8217;t hide a lot of things on it :)</p>
<p>But the most important thing here is: what is your best score?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.1stwebdesigner.com/css/simons-google-doodle-html-js-jquery-game/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>jQuery Plugin Development: Hover to Reveal Masked Password</title>
		<link>http://www.1stwebdesigner.com/css/jquery-hover-reveal-masked-password/</link>
		<comments>http://www.1stwebdesigner.com/css/jquery-hover-reveal-masked-password/#comments</comments>
		<pubDate>Sun, 24 Jul 2011 10:00:47 +0000</pubDate>
		<dc:creator>Rochester Oliveira</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[HTML & CSS]]></category>
		<category><![CDATA[JS & AJAX]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[password mask]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.1stwebdesigner.com/?p=50154</guid>
		<description><![CDATA[We talked about how to improve your HTML forms performance a couple of days ago. There we covered a pretty controversial topic &#8220;Don&#8217;t mask your passwords&#8221;, discussing how bad masking your passwords could be for usability. At this moment, we basically have two options: mask password field and don&#8217;t ask for any feedback, or show [...]]]></description>
			<content:encoded><![CDATA[<p>We talked about <a href="http://www.1stwebdesigner.com/design/10-tips-html-forms-performance">how to improve your HTML forms performance</a> a couple of days ago. There we covered a pretty controversial topic &#8220;Don&#8217;t mask your passwords&#8221;, discussing how bad masking your passwords could be for usability.</p>
<p>At this moment, we basically have two options: mask password field and don&#8217;t ask for any feedback, or show password field as text and potentially decrease security.</p>
<p>This is why I think a hover revealing password could be a really good alternative: You can increase your security, and if you are unsure about what you&#8217;ve typed just go and hover over it.</p>
<p>So, what we will be doing today is a jQuery plugin to do that, and additionally, we will have a behavior pretty similar to what many mobiles does, where we can see the last character for a couple of seconds. This is a good chance to learn more about plugins, dynamically generated content, and some good coding practices.</p>
<p>Moreover with this technique we could apply different effects and a lot of variations since all this things are based on non-obtrusive and almost only decorative javascript.</p>
<p>So, let&#8217;s rock!</p>
<p><span id="more-50154"></span></p>
<h2>Demo, download and preview</h2>
<p>Let&#8217;s begin with the best part. You can see our <a href="http://dl.dropbox.com/u/35995890/hovermask/index.html" target="_blank">working demo</a> or <a href="http://dl.dropbox.com/u/35995890/hovermask/jquery.hp.js" target="_blank">download our files and jQuery plugin</a>.</p>
<p><img class="alignnone size-full wp-image-50373" title="demo" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/07/demo.jpg" alt="" width="550" height="300" /></p>
<h2>Usability background</h2>
<p>Before any coding I think it&#8217;s important to know why are we doing all these things. It is all about user experience and to make things the best they can be.</p>
<p>The man who started discussing masked passwords (as far as I know) is Jakob Nielsen, with his extremist opinion expressed in  <a href="http://www.useit.com/alertbox/passwords.html">stop password masking</a> article. But I really think we don&#8217;t need to stick with just two options. I think we can improve all these techniques, like what mobile developers have done, improving user experience by creating a &#8220;new&#8221; way to input password data.</p>
<p>Don&#8217;t get me wrong, sometimes we do need to just keep masking passwords for security reasons. You know, sometimes we are near suspicious people or jealous girlfriends just waiting for a single mistake to steal our password and make big damage to our online life. But sometimes we don&#8217;t. I mean, we don&#8217;t need to let our software ready only for the worst case.</p>
<p>We have to be ready for the worst and the best. From IE6 (argh!) to Chrome 14.0.803.2 beta. From jealous girlfriends to hurried surfers. This is the tricky part, trying to be the best in most cases.</p>
<p>This is why we can&#8217;t just let passwords to be masked by default. We have to give a better option to our loyal users.</p>
<h2>Getting started</h2>
<p>What we will do here is to get a common password field, change it to text and create a mask above it, which is filled as you type. With this you can do anything with the &#8220;mask&#8221; without affecting the input content itself.</p>
<p>Maybe this image will better explain how it works:</p>
<p><img class="alignnone size-full wp-image-50374" title="password-working" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/07/password-working.gif" alt="" width="500" height="400" /></p>
<p>Well, finally, let&#8217;s get started on coding.</p>
<p>We will start with a pretty basic form markup. As you all know it&#8217;s quite simple, so let&#8217;s add two fields, one that should come with a default value and another in blank, for you to play with as you want.</p>
<pre class="brush: php; title: ; notranslate">
&lt;div id=&quot;container&quot;&gt;
	&lt;h1&gt;Sign Up!&lt;/h1&gt;
	&lt;form action=&quot;#&quot; method=&quot;get&quot;&gt;
		&lt;label&gt;
			&lt;span class=&quot;title&quot;&gt;Old Password&lt;/span&gt;
			&lt;span class=&quot;desc&quot;&gt;This is our awesome password field with default value. Try it out!&lt;/span&gt;
			&lt;input type=&quot;text&quot; name=&quot;oldpassword&quot; id=&quot;oldpassword&quot; value=&quot;tHis1$myP4swrd.&quot; /&gt;
		&lt;/label&gt;
		&lt;label&gt;
			&lt;span class=&quot;title&quot;&gt;Password&lt;/span&gt;
			&lt;span class=&quot;desc&quot;&gt;This is our awesome blank password field. Try it out!&lt;/span&gt;
			&lt;input type=&quot;password&quot; name=&quot;password&quot; id=&quot;password&quot; /&gt;
		&lt;/label&gt;
	&lt;/form&gt;
&lt;/div&gt;
</pre>
<p>Ok, then we need to call our magic jQuery and plugin files. Let&#8217;s do that:</p>
<pre class="brush: php; title: ; notranslate">
	&lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js&quot;&gt; // call jQuery from google! &lt;/script&gt;
	&lt;script type=&quot;text/javascript&quot; src=&quot;jquery.hp.js&quot;&gt; // call plugin &lt;/script&gt;
</pre>
<p>Well, let&#8217;s create our basic plugin file. You can see some tips about it in our <a href="http://www.1stwebdesigner.com/css/jquery-plugin-smooth-scrolling/">jQuery Smooth Table of Contents Plugin</a>, where we have a really simple structure.</p>
<pre class="brush: php; title: ; notranslate">
(function($){
 $.fn.hoverpass = function(options) {
	//Our default options
	var defaults = {
		bullet: &quot;&amp;bull;&quot;, //which should be the &quot;masking&quot; character
		font: &quot;'Lucida Console', monospace&quot;, //please just use MONOSPACE fonts
		bg: &quot;#fff&quot;, // background style for bullets
		free: &quot;&quot;, // add your own additional styling here
		freeBul: &quot;float: left; overflow: hidden;&quot;, // add your own additional styling for bullets here
		delay: 500, //how long it takes to create the bullet over the last character, in milliseconds
		delayHover: 3000, //how long it takes to hide again a hovered character
		animation: 500, //how long it takes the animation itself
		maxSize: 10 // maximum number of characters, to prevent  bullets exploding input's size
	};

	//let's extend our plugin with default or user options when defined
	var options = $.extend(defaults, options);

    return this.each(function() {
		//our action goes here
    });
 };
})(jQuery);
</pre>
<p>Above we defined our default variables, let me explain some of them a little bit:</p>
<ul>
<li><strong> bullet</strong> &#8211; Is what will mask our password. You can use any character but use just one character or HTML entity.</li>
<li><strong>font</strong> &#8211; This is really important, this plugin only works with monospaced fonts. Since in other types, each character has his own width, we can&#8217;t &#8220;mask&#8221; it.</li>
<li><strong>bg </strong>- If you use any background in your input, then you should apply it to your mask too, since it will be above the input.</li>
<li><strong>free </strong>- Here you should add margins in order to compensate any padding that your input has. Furthermore you should set your input&#8217;s font-size here.</li>
<li><strong>maxSize</strong> &#8211; This is important if your password field is too short. If you don&#8217;t adjust it you may get some extra bullets exploding your input&#8217;s size.</li>
</ul>
<p>At this point you have a basic plugin, that is called via $(elem).hoverpass(), defined by our second line $.fn.hoverpass = function(){}.<br />
I know, this name sucks. I would be glad if you send suggestions about better names :).</p>
<h2>Change our input type to text</h2>
<p>I don&#8217;t know if you&#8217;ve tried this before, but let me tell you something, you just can&#8217;t change the type of inputs. This happens due to security reasons, right? Well, seems that just IE will worry about it (you can do it via old JavaScript in real browsers). Anyway, what we have to do then is create a &#8220;clone&#8221; of current input without type property.<br />
There is several ways of doing this, I&#8217;ve done it this way:</p>
<pre class="brush: php; title: ; notranslate">
return this.each(function() {
	//let's declare some variables, many as a &quot;shortcut&quot; for options
	var  bullet = options.bullet,
			font = options.font,
			bg = options.bg,
			free = options.free,
			freeBul = options.freeBul,
			delay = options.delay,
			delayHover = options.delayHover,
			animation = options.animation,
			lastBul = &quot;&quot;;

	//since we just can't change a field's type, we'll remove it and append a brand new text input on it's place
	var oldElement = $(this); // caching element, much better performance
	var inputHTML = '&lt;input type=&quot;text&quot; style=&quot;font-family: '+  font +'; &quot; /&gt;'; //this is our basic input text, with our monopace font
	var input = oldElement.after(inputHTML).next(); //appending our simple text field with our styling (font-family) AND caching it as var &quot;input&quot;

	/****
		we are saying here:
			define the following variables: attr , i (zero), attrs (array with all oldElement attributes), l (size of attrs)
			while our counter (i) is smaller than attributes lenght (l) increase our counter and run this code
	*/
	for ( var attr, i=0 , attrs = oldElement[0].attributes , l =attrs.length ; i &lt; l ; i++){
		attr = attrs.item(i)
		if (attr.nodeName != &quot;type&quot; &amp;&amp; attr.nodeName != &quot;style&quot;) { //well, we defined our type as text and font-style!
			input.attr( attr.nodeName, attr.nodeValue );
		}
	}
	oldElement.remove(); // bye, bye input type=&quot;password&quot;!
});
</pre>
<h2>Create our mask and bullets</h2>
<p>Wow, at this point, when you define $(elem).hoverpass() it will turn into a monospaced text input. Pretty cool, huh? But we want more than this.</p>
<p>Now we will create our bullets container. The only really interesting thing in this two lines is that jQuery element caching again. You really should be using this simple technique:</p>
<pre class="brush: php; title: ; notranslate">
	// let the game begin
	var maskHTML = '&lt;div class=&quot;hpMask&quot; style=&quot;position: absolute; cursor: text; height: 1px; font-family: ' +  font + ' ; ' + free + ' &quot; /&gt;'; //our container with his styling
	var maskContainer = input.before(maskHTML).prev(); // appending our container for bullets with styling (font-family, free)
</pre>
<p>Now we&#8217;ll prepare our bullets HTML, since it will be used several times, and add some bullets when we have a &#8220;value&#8221; attribute defined.</p>
<pre class="brush: php; title: ; notranslate">
	var bulletHTML = &quot;&lt;span class='hpBullet' style='background: &quot; + bg + &quot;; &quot; + freeBul + &quot; '&gt;&quot;+ bullet + &quot; &lt;/span&gt; &quot;; // our bullets HTML with styling (bg, freeBul)
	var countBullet = 0; // this is our counter, it is important to prevent our mask to get bigger / smaller than our input or its maximum size

	//since we use it from different places, it's better to add it via function
	function addBullet() {
		// add our last bullet, but hidden, and show anything that isn't last bullet
		lastBul = maskContainer.append(bulletHTML).find(&quot;:last-child&quot;).hide();
		maskContainer.find(&quot;:not(:last-child)&quot;).each( function(){ $(this).show();  } );
		//start timer to show  lastBul
		lastBul.delay(delay).fadeIn(animation);
		countBullet++;
	}

	//first loop adding bullets when we have a default value
	for ( i=0 ; i &lt; input[0].value.length ; i++){
		addBullet();
	}
</pre>
<p>Well, at this point you should see again a textfield but if you have a value attribute defined, you&#8217;ll see a lot of bullets and the last one fading after one second. Although, if you type, nothing happens.</p>
<h2>It&#8217;s time to play with keyboard</h2>
<p>No, we won&#8217;t be taking music classes here :)</p>
<p>We now need to append new bullets every time something is typed in our password field, and remove one bullet if the pressed character is delete or backspace.</p>
<p>We could do this via keypress, keyup or keydown.</p>
<p>Thinking about it a little bit with keydown and keypress (they are very similar) we bind &#8220;pressing key&#8221; and with keyup we bind &#8220;releasing key&#8221;. Looking a little closer, you might notice that in our case it means that keydown/keypress is called before we have any change in our field&#8217;s value but keyup is called after any change occurs.</p>
<p>This is why we need to use keyup here. We have to look at our field&#8217;s value and see &#8220;hey, have you changed your size?&#8221; in order to append or remove bullets. This is because we could have several scenarios when user selects part of the password, press delete in the beginning of the field and much other things that would be too painful to bind as separated actions.</p>
<p>So, let&#8217;s do it:</p>
<pre class="brush: php; title: ; notranslate">
//let's bind all keydown and create / remove our bullets ; we need do use keydown in order to detect special characters in non-gecko browsers
	input.keyup(
		function(event) {
			//check if something was really typed
			if (input[0].value.length &gt; countBullet) {
				addBullet();
			} else { //ooops, delete or backspace?
				//then we check if something was really deleted
				while (input[0].value.length &lt; countBullet) {
					maskContainer.find(&quot;:last-child&quot;).remove();
					countBullet--;
				}
			}
		}
	);
</pre>
<h2>Finally, hover-revealing field!</h2>
<p>Well, now we just have to hide our bullet when someone hovers it. Kind of easy, right? Well, it isn&#8217;t that easy. It is because we have to hide our bullet, but we can&#8217;t lose it&#8217;s width, because if we do, our users would see only the last character of the password (not the ones in the middle). What we can do is to fade it to an insignificant opacity (like 10%) and then change it&#8217;s height to 1px, so we still have width.</p>
<p>Ok, now it&#8217;s just to use elem.hover() and we&#8217;re done, right? Again, no. This is because we have dynamically generated content we should use live() or delegate() to bind it. In my tests delegate had a much better performance, so we will do it this way:</p>
<pre class="brush: php; title: ; notranslate">
//hide bullets based on a jquery object
	function hideBullets(object) {
		object.stop().css({ &quot;height&quot;: &quot;auto&quot;}).animate({ opacity: 1 }, animation).removeClass(&quot;hpHiddenBullet&quot;);
	}
	//hover function for our bullets
	maskContainer.delegate(&quot;.hpBullet&quot;,  'hover',
		function(){
			var item = $(this);
			if (  item.hasClass(&quot;hpHiddenBullet&quot;) != true ) {
				hideBullets( $(&quot;.hpHiddenBullet&quot;) );
				item.stop().addClass(&quot;hpHiddenBullet&quot;).animate( { opacity: 0.01}, animation, function() { item.css({ &quot;height&quot;: &quot;1px&quot;}); } );
				setTimeout( function() {
					if (  item.hasClass(&quot;hpHiddenBullet&quot;) == true ) {
						hideBullets( item );
					}
				}, delayHover);
			}
		}
	);
</pre>
<h2>Are you hungry yet?</h2>
<p>Wow, hope you guys liked it. Maybe you&#8217;re not going to use this effect itself but I&#8217;m sure we have a lot of good snippets here that are worth using in other cases.</p>
<p>Talking about the final effect, what do you think about it? Have you seen a better alternative?</p>
<p>Show us your opinion and let&#8217;s find what could be the very best implementation to our users!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.1stwebdesigner.com/css/jquery-hover-reveal-masked-password/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>17 CSS/HTML Effects with Cross-Browsing Alternatives</title>
		<link>http://www.1stwebdesigner.com/css/17-css-html-effects/</link>
		<comments>http://www.1stwebdesigner.com/css/17-css-html-effects/#comments</comments>
		<pubDate>Fri, 22 Jul 2011 10:00:01 +0000</pubDate>
		<dc:creator>Rochester Oliveira</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[HTML & CSS]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[css effects]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[text shadow]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.1stwebdesigner.com/?p=50443</guid>
		<description><![CDATA[Well, we surely have a lot of different ways to achieve similar effects and with CSS the hardest part is to make it look good in almost every browser. You don&#8217;t need to reinvent the wheel every time, if you get one good snippet that does what you want (and you understand what is happening) [...]]]></description>
			<content:encoded><![CDATA[<p>Well, we surely have a lot of different ways to achieve similar effects and with CSS the hardest part is to make it look good in almost every browser.</p>
<p>You don&#8217;t need to reinvent the wheel every time, if you get one good snippet that does what you want (and you understand what is happening) you don&#8217;t need to reinvent it every time you need a simple round corner, right?</p>
<p>Thus, our point here is to collect some cool CSS effects that you should be using:</p>
<p>• Min / Max width (IE included)<br />
• RGBA (IE included)<br />
• Opacity (IE included)<br />
• Image rotation / scaling (IE included)<br />
• FullScreen Background (IE included)<br />
• Background pattern or bullet without image file<br />
• Text Shadow (IE included)<br />
• Multiple borders (IE included)<br />
• Box Shadows (IE included)<br />
• Rounded corners<br />
• Screen reader only accessible content<br />
• Don&#8217;t use negative text-indent<br />
• Clearfix (IE included)<br />
• @font-face (IE included)<br />
• Pull quotes without image<br />
• CSS for iPhone4 (higher resolution)<br />
• CSS landscape / portrait orientation for mobiles</p>
<p>So, Let&#8217;s rock!</p>
<p><span id="more-50443"></span></p>
<h2>Min / Max width (IE included)</h2>
<p>Well, many of you are used to just replace the lack of min / max width / height for IE with fixed dimensions, right? But you don&#8217;t need to do it anymore. IE is not a strict standards browser and sometimes we can take advantage of this to code things that would be awful to see in standard CSS code.</p>
<p>You can, in this case, insert some IE expressions (basically, JavaScript code) to check current body width and adjust element&#8217;s width as follows:</p>
<pre class="brush: css; title: ; notranslate">
#content {
	width: expression(document.body.clientWidth &lt; 762? &quot;760px&quot; : document.body.clientWidth &gt; 1242? &quot;1240px&quot; : &quot;auto&quot;);
	min-width: 760px;
	max-width: 1240px;
}
</pre>
<h2>RGBA (IE included)</h2>
<p>This time we will need some IE filters to get the job done. You&#8217;ll have the standard markup, IE6 correction and IE8 correction.</p>
<p>IE corrections is based on gradient filter, that actually we put just one color to the beginning and the end, and BAM! We have a pretty RGBA background.</p>
<p>The first two digits should be the opacity and the last one should be the color itself. Don&#8217;t know why, it just don&#8217;t get the opacity right&#8230; Maybe its just a bug inside a bug :)</p>
<pre class="brush: css; title: ; notranslate">
.element {
  background-color: transparent;
  background-color: rgba(255, 255, 255,0.8);
  filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#80ffffff,endColorstr=#80ffffff);
  -ms-filter: &quot;progid:DXImageTransform.Microsoft.gradient(startColorstr=#80ffffff,endColorstr=#80ffffff)&quot;;
}
</pre>
<h2>Opacity (IE included)</h2>
<p>Wow, filters again! But this time we have a different syntax for IE8 and earlier versions. And again be sure to put khtml, moz and standard declarations.</p>
<pre class="brush: css; title: ; notranslate">
.selector {
	ms-filter: &quot;progid:DXImageTransform.Microsoft.Alpha(Opacity=50)&quot;; /* internet explorer 8 */
	filter: alpha(opacity=50); /* internet explorer 5~7 */
	-khtml-opacity: 0.5;      /* khtml, old safari */
	-moz-opacity: 0.5;       /* mozilla, netscape */
	opacity: 0.5;           /* fx, safari, opera */
}
</pre>
<h2>Image rotation / scaling (IE included)</h2>
<p>Another pretty cool and virtually unused feature is image rotation / scaling. There is another filter that allows you to rotate images, but unfortunately it just allows you 90º increments.</p>
<p>Although you can also mirror images, that makes cool image editing possible to almost every real browser and IE. For real browsers we will use the transform property with each vendor prefix.</p>
<pre class="brush: css; title: ; notranslate">
	img {
		transform:
			rotate(180deg)
			scale(-1, 1);

		/* for firefox, safari, chrome, etc. */
		-webkit-transform:
			rotate(180deg)
			scale(-1, 1);
		-moz-transform:
			rotate(180deg)
			scale(-1, 1);

		/* for ie */
		filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);

		/* opera */
		-o-transform:
			rotate(180deg)
			scale(-1, 1);
	}
</pre>
<h2>Fullscreen Background (IE included)</h2>
<p>Sometimes we just need a quick way to get full screen backgrounds. Well, hope you don&#8217;t use JavaScript just to do this, because you can do it with a few lines of CSS.</p>
<p>The magic here is to set a div that goes fullscreen and inside it you can put a landscape, portrait or full sized image.</p>
<pre class="brush: css; title: ; notranslate">
	.content {
		position: relative;
		width: 760px;
		z-index: 10;
	 }
	 .background {
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		position: absolute;
		z-index:2;
	 }
		.portrait {
			height: 100%;
		}
		.landscape {
			width: 100%;
		}
		.full {
			width: 100%;
			height: 100%;
		}
</pre>
<pre class="brush: xml; title: ; notranslate">
&lt;div class=&quot;content&quot;&gt;
	&lt;p&gt;aaaaaaaaaaaaaaaaaaaaaaaaaaaa&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;background&quot;&gt;
	&lt;img class=&quot;full | portrait | landscape&quot; src=&quot;imgURL&quot; alt=&quot;&quot; /&gt;
&lt;/div&gt;
</pre>
<h2>Background pattern or bullet without image file</h2>
<p>Pretty sad that IE doesn&#8217;t allows you to use base64 encoding instead of real files. The best part is to use it for mobiles, since it saves you some http requests and precious time.<br />
I&#8217;ve used it for a custom list style image without images. I just generated the base64 from <a href="http://patternfy.com">Patternfy</a> and pasted it in my CSS, like this:</p>
<pre class="brush: css; title: ; notranslate">
	 ul {
		list-style-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAJCAYAAAAVb42gAAAAFklEQVQImWNgIAro56z9T4Ygbg5BAABTdwtkrDt7swAAAABJRU5ErkJggg==);
	 }
</pre>
<h2>Text Shadow (IE included)</h2>
<p>Again we will need some IE filters. But this time IE filters can destroy your font&#8217;s readability, so try not to use it too much and preferably, only when working with larger fonts.</p>
<pre class="brush: css; title: ; notranslate">
	p {
		text-shadow: #000000 0 0 1px;
		zoom:1;
		filter: progid:DXImageTransform.Microsoft.Glow(Color=#000000,Strength=1);

		-ms-filter: &quot;progid:DXImageTransform.Microsoft.dropshadow(OffX=-1, OffY=-1, Color=#000000)progid:DXImageTransform.Microsoft.dropshadow(OffX=0, OffY=-1, Color=#000000)progid:DXImageTransform.Microsoft.dropshadow(OffX=1, OffY=-1, Color=#000000)progid:DXImageTransform.Microsoft.dropshadow(OffX=1, OffY=0, Color=#000000)progid:DXImageTransform.Microsoft.dropshadow(OffX=1, OffY=1, Color=#000000)progid:DXImageTransform.Microsoft.dropshadow(OffX=0, OffY=1, Color=#000000)progid:DXImageTransform.Microsoft.dropshadow(OffX=-1, OffY=1, Color=#000000)progid:DXImageTransform.Microsoft.dropshadow(OffX=-1, OffY=0, Color=#000000)&quot;;
	}
</pre>
<h2>Multiple borders (IE included)</h2>
<p>When you want more than one border, for real browsers you&#8217;ll need to use an outline or :before and :after elements. For IE you could use filters to gain some an extra border.</p>
<pre class="brush: css; title: ; notranslate">
	div {
		-ms-filter: &quot;progid:DXImageTransform.Microsoft.Shadow(color=#212121,direction=180,strength=0)&quot;; /* IE 8 */
		filter: progid:DXImageTransform.Microsoft.Shadow(color=#212121,direction=180,strength=0); /* IE 7- */
	}
	div:before {
		position: absolute;
		top: 0px;
		width: 100%;
		height: 100%;
		border-top: 1px solid #212121; /* top border! */
		content: '';
	}
	div:after {
		position: absolute;
		width: 100%;
		height: 100%;
		top: 1px;
		border-bottom: 1px solid #212121; /* bottom border! */
		content: '';
	}
</pre>
<h2>Box Shadows (IE included)</h2>
<p>The same filter we&#8217;ve used to create a second border can be used to generate box shadows. Be aware that this filter can mess up an element&#8217;s width, so if you want to use it with any grid system, prepare for the headache.</p>
<pre class="brush: css; title: ; notranslate">
	.shadow {
	    -moz-box-shadow: 0 0 4px #000;
		-webkit-box-shadow: 0 0 4px #000;
		-ms-filter: &quot;progid:DXImageTransform.Microsoft.Glow(color=#666666,strength=3)&quot;;
		filter:
				progid:DXImageTransform.Microsoft.Shadow(color=#666666,direction=0,strength=3)
				progid:DXImageTransform.Microsoft.Shadow(color=#666666,direction=90,strength=3)
				progid:DXImageTransform.Microsoft.Shadow(color=#666666,direction=180,strength=3)
				progid:DXImageTransform.Microsoft.Shadow(color=#666666,direction=270,strength=3);
		box-shadow: 0 0 4px #000;
	}
</pre>
<h2>Rounded corners</h2>
<p>The bad part about almost-standard properties is that each browser implements its syntax differently. So for round corners we have a pretty strange behavior, where standards browsers have different ways to say same thing:</p>
<pre class="brush: css; title: ; notranslate">
.rounded  {
	-moz-border-radius: 10px; /* gecko */
	-webkit-border-radius: 10px; /* webkit */
	border-radius: 10px; /* CSS3 standard */
	-khtml-border-radius: 10px; /* old konkeror */

	-webkit-border-bottom-right-radius: 10px;
	-webkit-border-bottom-left-radius: 10px;
	-webkit-border-top-right-radius: 10px;
	-webkit-border-top-left-radius: 10px;

	-khtml-border-radius-bottomright: 10px;
	-khtml-border-radius-bottomleft: 10px;
	-khtml-border-radius-topright: 10px;
	-khtml-border-radius-topleft: 10px;

	-moz-border-radius-bottomright: 10px;
	-moz-border-radius-bottomleft: 10px;
	-moz-border-radius-topright: 10px;
	-moz-border-radius-topleft: 10px;

	border-bottom-right-radius: 10px;
	border-bottom-left-radius: 10px;
	border-top-right-radius: 10px;
	border-top-left-radius: 10px;
 }
</pre>
<h2>Screen reader only accessible content</h2>
<p>Sometimes you want to improve the accessibility of your site, so you put some fancy links like &#8220;Jump to content&#8221; or &#8220;Jump to navigation&#8221;. So you just put &#8220;display: none&#8221; or &#8220;visibility: hidden&#8221; and hope it works, right? Well, it doesn&#8217;t. Some tests show that many screen readers just ignore the display:none or visibility: hidden part, so you don&#8217;t have any accessibility improvement.</p>
<p>What you can do instead is to use position absolute and hide this content above browsers visible area. But you have some risks on this technique, since it hides content, Google can consider it gray or black hat.</p>
<pre class="brush: css; title: ; notranslate">
.hidden  {
	position: absolute;
	top: -10000px;
	left: -10000px;
 }
</pre>
<h2>Don&#8217;t use negative text-indent</h2>
<p>Since we&#8217;re talking about hidden content, take one more note, never use negative text-indent again. This is a known technique so you have a lot of SEO downsides by using it, since many bots can recognize it nowadays.<br />
Just use alt attribute, that is much safer than hide content.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;h1&gt;&lt;img src=&quot;myLogo&quot; alt=&quot;My company&quot; /&gt;&lt;/h1&gt;
</pre>
<h2>Clearfix (IE included)</h2>
<p>Many of you know about .clearfix method for correcting heights when you use floats. Well, in many of these cases, that amount of code could be replaced by just two lines:</p>
<pre class="brush: css; title: ; notranslate">
	.clearfix {
		zoom:1;
		overflow:hidden;
	}
</pre>
<h2>@font-face (IE included)</h2>
<p>If you&#8217;re still using cufon just because you don&#8217;t trust @font-face, think again.<br />
Font Squirrel provides an amazing <a href="http://www.fontsquirrel.com/fontface/generator">@font-face generator service</a>, that allows you to put really good looking fonts in your site without worrying about all that JavaScript stuff.<br />
The final code provided is something like this:</p>
<pre class="brush: css; title: ; notranslate">
@font-face {
    font-family: 'MandatoryRegular';
    src: url('font/mandator-webfont.eot');
    src: url('font/mandator-webfont.eot?#iefix') format('embedded-opentype'),
         url('font/mandator-webfont.woff') format('woff'),
         url('font/mandator-webfont.ttf') format('truetype'),
         url('font/mandator-webfont.svg#MandatoryRegular') format('svg');
    font-weight: normal;
    font-style: normal;
}
</pre>
<h2>Pull quotes without image</h2>
<p>We talked about this before, but it is possible to <a href="http://www.1stwebdesigner.com/css/css-tricks-quotes-tooltips/">create curly quotes without any image</a>. And it is not that hard. You just need a :before and blockquote:</p>
<pre class="brush: css; title: ; notranslate">
	blockquote:before {
		display: block;
		float: left;
		margin: 10px 15px 0 0;
		font-size: 100px; /* let's make it a big quote! */
		content: open-quote; /* here we define our :before as a smart quote. It could be any content, even the HTML entity alternative to this opening quote, that is “ */
		color: #bababa;
		text-shadow: 0 1px 1px #909090;
	}
</pre>
<h2>CSS for iPhone4 (higher resolution)</h2>
<p>As time goes by we get more and more powerful mobile devices. It is a good practice to give create a mobile version, with reduced images and overall files size, but we have also to give a better experience for the ones with newer devices.<br />
Since iPhone4 has a higher resolution, if you don&#8217;t provide a better (and larger) version of you logo, for example, your users will get a blurry version of it. This is a problem that can be solved with a very few lines:</p>
<pre class="brush: css; title: ; notranslate">
@media handheld, only screen and (max-width: 767px) {
	.logo {
		/* common low-res and low-size, of course */
		background: url(logo.jpg) no-repeat;
	}
}

@media only screen and (-webkit-min-device-pixel-ratio: 2) {
	.logo {
		background: url(logo2x.jpg) no-repeat;
		background-size: 212px 303px;
	}
}
</pre>
<h2>CSS landscape / portrait orientation for mobiles</h2>
<p>This is a nice starting point for correcting layout bugs in each version of each layout mode for many mobiles, <a href="http://www.stuffandnonsense.co.uk/blog/about/hardboiled_css3_media_queries">provided by stuffAndNoise</a></p>
<pre class="brush: css; title: ; notranslate">
	/* Smartphones (portrait and landscape) ----------- */
	@media only screen
	and (min-device-width : 320px)
	and (max-device-width : 480px) {
		/* Styles */
	}

	/* Smartphones (landscape) ----------- */
	@media only screen
	and (min-width : 321px) {
		/* Styles */
	}

	/* Smartphones (portrait) ----------- */
	@media only screen
	and (max-width : 320px) {
		/* Styles */
	}

	/* iPads (portrait and landscape) ----------- */
	@media only screen
	and (min-device-width : 768px)
	and (max-device-width : 1024px) {
		/* Styles */
	}

	/* iPads (landscape) ----------- */
	@media only screen
	and (min-device-width : 768px)
	and (max-device-width : 1024px)
	and (orientation : landscape) {
		/* Styles */
	}

	/* iPads (portrait) ----------- */
	@media only screen
	and (min-device-width : 768px)
	and (max-device-width : 1024px)
	and (orientation : portrait) {
		/* Styles */
	}

	/* Desktops and laptops ----------- */
	@media only screen
	and (min-width : 1224px) {
		/* Styles */
	}

	/* Large screens ----------- */
	@media only screen
	and (min-width : 1824px) {
		/* Styles */
	}

	/* iPhone 4 ----------- */
	@media
	only screen and (-webkit-min-device-pixel-ratio : 1.5),
	only screen and (min-device-pixel-ratio : 1.5) {
		/* Styles */
	}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.1stwebdesigner.com/css/17-css-html-effects/feed/</wfw:commentRss>
		<slash:comments>51</slash:comments>
		</item>
		<item>
		<title>CSS Counters &#8211; The Right Way to Organize Your Ordered Content</title>
		<link>http://www.1stwebdesigner.com/css/css-counters-organize-ordered-content/</link>
		<comments>http://www.1stwebdesigner.com/css/css-counters-organize-ordered-content/#comments</comments>
		<pubDate>Tue, 28 Jun 2011 10:00:14 +0000</pubDate>
		<dc:creator>Rochester Oliveira</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[HTML & CSS]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[counter]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[ordered list]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.1stwebdesigner.com/?p=49445</guid>
		<description><![CDATA[It is pretty common to see step-based content. Tutorials, shopping carts, FAQ&#8217;s, grandma&#8217;s recipes. You know, numbers and steps are really good to grab attention, so many writers use this. But, talking about HTML how should we write it? Most (all?) use numbers as text in headings, as they were common content. Well, let me [...]]]></description>
			<content:encoded><![CDATA[<p>It is pretty common to see step-based content. Tutorials, shopping carts, FAQ&#8217;s, grandma&#8217;s recipes. You know, numbers and steps are really good to grab attention, so many writers use this.</p>
<p>But, talking about HTML how should we write it? Most (all?) use numbers as text in headings, as they were common content.</p>
<p>Well, let me tell you a secret: They are doing it wrong.</p>
<p>Actually <a href="http://www.1stwebdesigner.com/design/how-to-improve-web-designer/">we are doing it wrong</a> ( nothing against this fantastic post of Ruben, just take a look at how we do the numbers, directly in HTML as text ).</p>
<p>A little time ago I was wondering about this thing, isn&#8217;t it more a CSS job? Actually yeah, it is. We have to keep content in HTML and presentation in CSS, and since we may want other ways to order titles, they are all about presentation. But, how can we do this kind of thing? One class for each item? That would be terrible!</p>
<p>Then CSS counter property comes to save us. It is a pretty unknown property that allows us to perform a simple count via CSS. It will be better explained with our demos :D</p>
<p>So, let&#8217;s rock!</p>
<p><img title="More..." src="http://cdn1.1stwebdesigner.com/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" /><span id="more-49445"></span></p>
<h2>Demo!</h2>
<p>Take a look at what you will do at the end of this tutorial:</p>
<p><img title="counter" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/06/counter.jpg" alt="" width="550" height="350" /><br />
I think you should <a href="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/06/css-counter/index.html" target="_blank">check out the demo</a>, and <a href="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/06/css-counter/css-counter.zip" target="_blank">download it</a> to try out a little bit more!</p>
<h2>So, counter?</h2>
<p>Basically a counter is a &#8220;variable&#8221; that we can create with CSS but the only two possible operations that we can perform with it is to increase or to reset. For such operations we can use counter-reset or counter-increment CSS properties.</p>
<p>A basic usage is the first case mentioned in this post, the organized content. So let&#8217;s say you have a multi-step tutorial and want it organized automatically, what you have to do is just add this to your CSS:</p>
<pre class="brush: css; title: ; notranslate">
body {
  counter-reset: first; /* our h1's counter is zero every time we have a body tag (hope only once) */
}
h1 {
  counter-increment: first; /* so, when we have one h1, our counter will increase one unit */
  counter-reset: second; /* and we will reset our h2's counter */
}
h1:before { /* wow, here we will append a pretty formated Step N - Item */
  content: &amp;quot;Step &amp;quot; counter(first) &amp;quot; - &amp;quot;; /* when you write counter(first) we will get its current value */
  font-size: 0.8em;
  font-weight: normal;
  font-style: italic;
  color: #bababa;
}
h2 {
  counter-increment: second; /* so our h2's counter goes up.. */
  counter-reset: third; /* and we reset the h3's */
}
h2:before {
  content: counter(first) &amp;quot;.&amp;quot; counter(second) &amp;quot; - &amp;quot;; /* we will output H1NUMBER.H2NUMBER */
}
h3 {
  counter-increment: third; /* h3 goes up, up, up */
}
h3:before {
  content: counter(first) &amp;quot;.&amp;quot; counter(second) &amp;quot;.&amp;quot; counter(third) &amp;quot; - &amp;quot;; /* and we output H1.H2.H3 */
}
</pre>
<p>As you can see its usage is quite simple. Our downside is that we rely on content: property and after (or before) pseudo-element so older browsers won&#8217;t see this. But it should work just fine in IE8+ and other browsers.</p>
<h2>Multiple counters</h2>
<p>Another great thing is that you can have a &#8220;general&#8221; counter, you just have to separate multiple counters to increase with spaces. Just like this:</p>
<pre class="brush: css; title: ; notranslate">
body {
  counter-reset: general first;
}
h1 {
  counter-increment: general first;
  counter-reset: second;
}
h2 {
  counter-increment: general second;
  counter-reset: third;
}
h3 {
  counter-increment: general third;
}
</pre>
<h2>Better Ordered lists</h2>
<p>Using almost the same code, you can create better ordered lists, with sub-items control.  So instead of just 1 &#8211; ITEM you can have 2.5.3.1 &#8211; ITEM when you have multiple nested OL&#8217;s. This is the code I&#8217;d use:</p>
<pre class="brush: css; title: ; notranslate">
ol {
	list-style: none;
	counter-reset: olfirst; /* our father OL must have olfirst item reseted */
	font-family: arial;
}
ol ol {
  counter-reset: olsecond; /* our sub OL's reset the olsecond, third must to be olthird and so on */
}
	ol li {
		counter-increment: olfirst; /* when we have a item that is children of first OL, it increases first counter*/
	}
	ol li ol li {
		counter-increment: olsecond; /* when the item is children of a OL that is children of another OL, so it is a sub OL */
	}
	ol li:before {
		content: counter(olfirst) &amp;quot; - &amp;quot;; /* let's output our pretty number */
	}
	ol li ol li:before {
		content: counter(olfirst) &amp;quot;.&amp;quot; counter(olsecond) &amp;quot; - &amp;quot;; /* let's output our &amp;quot;sub-number&amp;quot; */
	}
</pre>
<h2>Are you hungry yet?</h2>
<p>This is a pretty tricky attribute so you must to try it out a couple of times until you are familiar with it. But we have some tutorials at W3Schools about CSS <a href="http://www.w3schools.com/css/pr_gen_counter-reset.asp">counter reset</a>, CSS <a href="http://www.w3schools.com/css/pr_gen_counter-increment.asp">counter increment</a> and <a href="http://www.w3schools.com/css/sel_before.asp">before</a> / <a href="http://www.w3schools.com/css/sel_after.asp">after</a> pseudo elements that can help you a lot.</p>
<p>So, it is time for you to talk. Did you know about this property What do you think about it?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.1stwebdesigner.com/css/css-counters-organize-ordered-content/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>An Introduction to Object Oriented CSS</title>
		<link>http://www.1stwebdesigner.com/css/object-oriented-css/</link>
		<comments>http://www.1stwebdesigner.com/css/object-oriented-css/#comments</comments>
		<pubDate>Mon, 27 Jun 2011 10:00:26 +0000</pubDate>
		<dc:creator>Ranjith Kumar</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[HTML & CSS]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[CSS design]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[semantics]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://www.1stwebdesigner.com/?p=49102</guid>
		<description><![CDATA[With richer interactions and media heavy pages mushrooming on the web, creating web pages, which load faster and respond well has become a challenge. Separating the content, presentation and behavior of a page using HTML, CSS and JS, is not the only thing that front-end engineers have to concentrate on nowadays. The limelight is now [...]]]></description>
			<content:encoded><![CDATA[<p>With richer interactions and media heavy pages mushrooming on the web, creating web pages, which load faster and respond well has become a challenge. Separating the content, presentation and behavior of a page using HTML, CSS and JS, is not the only thing that front-end engineers have to concentrate on nowadays. The limelight is now on the performance of the pages, cleanliness and leanness of the code within, scalability and reusability of CSS, and the semantic correctness of the markup.</p>
<p>There are a handful of frameworks, techniques and approaches that are built towards this goal of maintainability, scalability and reusability of CSS. Each of them is having its own pros and cons. But, this is not a stage to elaborate on all of them.</p>
<p>This article is an introduction to implementing the concept of ‘Object Oriented Programming’ in building CSS for high scale websites and applications, with an eye on maintainability and reusability.</p>
<p><span id="more-49102"></span></p>
<h2><strong>What is OO CSS?</strong></h2>
<p><img class="alignleft size-full wp-image-49113" style="padding: 10px;" title="thmb3" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/06/thmb3.jpg" alt="" width="180" height="150" />The concept of ‘Object Oriented Programming’, is widespread among developers, and forms the basic for any modern programming language. Features like data abstraction, modularity and inheritance make it a favorite in coding large-scale applications.</p>
<p>Object Oriented CSS, as the name suggests, is implementing the concepts of OOP in structuring and building CSS rules, which are easy to reuse, thereby reducing the loading time and increasing the performance of web pages incredibly! The key point here is, to identify, build and style modular reusable ‘objects’ in a page, and to reuse it in multiple instances by extending them with additional features wherever needed. Here an ‘object’ refers to the basic HTML markup and its CSS rules. Apparently, here, the key challenge is going to be, identifying the ‘object’ and building rules for it.</p>
<p>This is neither a framework nor a technology, but an approach adopted in building the rules, so as to make the code more reusable, maintainable and scalable. You may already have been making use of this concept in coding your style-sheet for years, but may not be aware of this terminology :).</p>
<p>A UI engineer at Yahoo (‘<a href="http://www.stubbornella.org/content/nicole-sullivan/" target="_blank">Nicole Sullivan’ )</a> coined the term. She had made a number of presentations on the topic on various big stages (<a href="http://developer.yahoo.net/blogs/theater/archives/2009/03/website_and_webapp_performance.html">http://developer.yahoo.net/blogs/theater/archives/2009/03/website_and_webapp_performance.html</a>) and is also included in a feature on <a href="http://www.wait-till-i.com/2009/03/24/ada-lovelace-day-women-in-technology-i-admire/" target="_blank">Women in Technology</a>.</p>
<p>Nicole, who has been hired by Facebook recently, for optimizing the CSS and web page performance, has been leading the way in implementing this approach in the pages for the social networking giant, and the results are to be seen. A faster loading FB, with significantly less response time! This is exactly what this approach of building CSS promises to give back. But again, like all other frameworks, this too has pitfalls and advantages which we shall discuss in detail.</p>
<p>Following are some key aspects in object-oriented approach to CSS building:</p>
<ol>
<li>Create a component library</li>
<li>Separate container and content / Avoid Location dependent styles</li>
<li>Separate Structure and skin</li>
<li>Extend base objects using class names</li>
<li>Stick to semantic class names</li>
</ol>
<h3><strong>Create a component library</strong></h3>
<p><img class="alignleft size-full wp-image-49114" style="padding: 10px;" title="thumb4" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/06/thumb42.jpg" alt="" width="180" height="150" />This is the first thing to do, while building a OO CSS framework for your application, and this is the most time consuming process too. You will have to carefully study the screens of the app, and come up with the recurring reusable UI patterns, and will have to create a library consisting of HTML markup and respective CSS rules of all such components first. This may take some initial time, as you may need to filter out the components and find out the basic structure of a component, and its variations along different screens.</p>
<p>E.g. For a blog, ‘metadata (Refer to the marked area in the figure below)’ will be present in multiple instances of a page. After closer scrutiny, you will come to know that, all the metadata can have the same HTML markup, and the variations can be addressed using CSS (the font size, color, margin and padding are different in each of the occurrences of metadata component). Select a markup, as a base structure, in which you can accommodate majority of the elements that possibly can come in the particular component.</p>
<p><img class="size-full wp-image-49124 alignnone" style="padding: 10px;" title="thumb1" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/06/thumb13.jpg" alt="" width="574" height="430" /></p>
<p>In our example our basic structure of the ‘metadata’ component will be:</p>
<h3>Base Markup</h3>
<pre class="brush: xml; title: ; notranslate">

&lt;p class=”metadata”&gt;&lt;a&gt;Author name&lt;/a&gt;commented on&lt;a&gt;21-02-2010&lt;/a&gt;@&lt;/p&gt;
</pre>
<h3>Base rule</h3>
<pre class="brush: xml; title: ; notranslate">

.metadata{font-size:1.2em; text-align:left; margin:10px 0;}
</pre>
<p>Thus, ‘metadata’ can be now independently used within any other element in the markup, and will have a consistent look and feel, irrespective of where it is used. But as we can see in the figure above, there are multiple variations of the component. This we will tackle using CSS, and will be discussing in the following points.</p>
<p>This way, figure out all the reusable components, and create rules and markup, and group them separately in the CSS file. (It’s even fine to create a separate CSS for the component library, and then merge it with others later during deployment.)</p>
<h3><strong>Separate Content from Container / Avoid location dependent styles</strong></h3>
<p>This is one of the primary requirements of following an OO approach to building CSS files. The core idea here is to consciously differentiate the rules of containers and the content that comes within them, so that content can be plugged into any containers irrespective of their parents.</p>
<p>Often while building large-scale CSS rules there will be instances where a single component will be appearing differently in various instances, when put in different containers. One of the solutions adopted by front-end engineers, for addressing this problem was to assign location dependent selectors to that particular component.</p>
<p>E.g. With reference to the example used in the previous point, where there are multiple variations of the same component – ‘metadata’, each instance can be given location dependent rules by combining the base class ‘metadata’ with the relevant classes/IDs for the containers. i.e.,</p>
<p>‘metadata’ in a blog post can be styled as: <em>.post .metadata{overriding rules}</em><br />
‘metadata’ in a comment can be styled as: <em>.comment .metadata{overriding rules}</em><br />
‘metadata’ in a comment can be styled as: <em>.comment .metadata{overriding rules}</em></p>
<p>The OOCSS approach advocates avoiding this type of usage. Instead <strong>extend</strong> the base class by adding more classes, thereby extending the attributes of the base component to match the variation. We shall discuss the concept of extending the base class in the following points.</p>
<h3><strong>Separate structure and skin</strong></h3>
<p><a rel="attachment wp-att-49115" href="http://www.1stwebdesigner.com/css/object-oriented-css/attachment/thumb5-3/"><img class="alignleft size-full wp-image-49115" style="padding: 10px;" title="thumb5" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/06/thumb52.jpg" alt="" width="180" height="150" /></a>In the first point ‘Creating component library’, we discussed the importance of identifying reusable components, and building base classes and base structures for them. While creating those base rules, an important thing to keep in mind is to separate the structure and skin. In other words, while defining a base class in the component library, we should not create skin-level rules, like width, height, background images, border styles, etc, that can make the component more specific to a certain container.</p>
<p>E.g. For our base class, ‘metadata’ with the following rule</p>
<pre class="brush: css; title: ; notranslate">
.metadata{font-size:1.2em; margin:10px 0;},
</pre>
<p>Adding more skin-level rules as below,</p>
<pre class="brush: css; title: ; notranslate">

.metadata{font-size:1.2em; margin:10px 0; &lt;strong&gt;width:500px; background-color:#efefef; color:#fff;&lt;/strong&gt;},
</pre>
<p>can make it more of a specific component than a generic one, thereby making it difficult to reuse it in many other containers, which would need it to be rendered in a different ‘skin’. Also another danger of not separating structure and skin will be the ‘Specificity war’.</p>
<h3><strong>Extend base objects using class names</strong></h3>
<p><a rel="attachment wp-att-49116" href="http://www.1stwebdesigner.com/css/object-oriented-css/attachment/thumb6-3/"><img class="alignleft size-full wp-image-49116" style="padding: 10px;" title="thumb6" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/06/thumb62.jpg" alt="" width="180" height="150" /></a>As discussed in the second point ‘Separate content from container’, avoiding the usage of contextual selectors will make the content independent from their parent containers and hence will be truly usable across the application. So how do we instantiate the variations of the same object in different containers? What is the solution? Well here comes the concept of <strong>extending</strong> the base ‘object’ (again another term coined by Nicole Sullivan), by adding more class names to it depending on the context, rather than tightly coupling the object with the class names of the containers in which it is to be placed.</p>
<p>E.g. In the first figure of the ‘metadata’ object, where the same object needs to be rendered differently in various containers,</p>
<p>The HTML markup of each of them will look like:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;p class=”metadata commentmetadata”&gt;&lt;a&gt;Authorname&lt;/a&gt;commented on&lt;a&gt;21-02-2010&lt;/a&gt;@&lt;/p&gt;
&lt;p class=”metadata postmetadata”&gt;&lt;a&gt;Authorname&lt;/a&gt;commented on&lt;a&gt;21-02-2010&lt;/a&gt;@&lt;/p&gt;
&lt;p class=”metadata authorlistmetadata”&gt;&lt;a&gt;Authorname&lt;/a&gt;commented on&lt;a&gt;21-02-2010&lt;/a&gt;@&lt;/p&gt;
</pre>
<p>The CSS rules will be:</p>
<pre class="brush: css; title: ; notranslate">

.metadata{font-size:1.2em; margin:10px 0;}
.commentmetadata{font-size:1em; margin:0 0 10px 0; color:#063070; }
.postmetadata{ color:#063070; }
.authormetadata{ color:#fff; }
</pre>
<p>This is a very simple demonstration, to comprehend the concept of implementing OO programming. As the size of the app becomes larger, the UI patterns will become more complex, and there lies the actual challenge and advantage of using such an approach.</p>
<h3><strong>Stick to semantic class names</strong></h3>
<p>A challenge in building CSS for high-scale web applications is to logically come up with meaningful class / ID names matching with the context and moreover making sure, they are reusable and still make sense. With the concept of ‘extending’ base objects, it’s easy to fall into the practice of creating ‘presentational class names’. Some easy examples are ‘leftCol’, ‘redText’, ‘midCol’, ‘bigText’, ‘bolderText’ etc. Such class names are not reusable and are a hindrance to scalability.</p>
<p>Always stick to logical and semantic class names relating to the logical meaning of the component, rather than its presentational meaning. It means, instead of giving the text block with a yellow background color, the class name ‘yellowText’, ‘notification’ would be a more sensible name, as it is a notification element that pops out to notify some activities within the system.<strong> </strong></p>
<h3><strong>Pros and Cons?</strong></h3>
<p>Following such an approach of building CSS has its own pitfalls and advantages</p>
<p>Here are a few cases, where adopting such a framework ‘may’ backfire:</p>
<ol>
<li>OOCSS is suited to really large websites / application which are filled with reusable components. It may not give desired results in smaller websites and applications. So decide sensibly depending on the size of the work in hand</li>
<li>If not smartly used, creating the component library can turn out to be a mess, and become a maintenance nightmare for other coders</li>
<li>Documentation is a must. Each block of code should be clearly commented out with the right points for other coders to absorb the concept, which otherwise can become too tedious in case of a knowledge transition</li>
</ol>
<p>Some obvious advantages of adopting this approach are:</p>
<ol>
<li>Less lines of CSS code</li>
<li>Cleaner HTML markup, with logically sensible class names and hierarchy</li>
<li>Semantic markup, means more SEO friendly pages</li>
<li>Far better page optimization, with much faster loading times, since most of the components are reused</li>
<li>Scalable markup and CSS code, where more components can be added into the library without disturbing other components, as the base objects are independent of any other containers</li>
<li>Easily theme-able layouts, since changes to the base object can completely change almost the whole presentation layer instantly</li>
</ol>
<h3><strong>Courtesy &amp; Resources</strong></h3>
<p><a href="http://www.stubbornella.org/content/2009/02/28/object-oriented-css-grids-on-github/">http://www.webdirections.org/blog/object-oriented-css-the-video/</p>
<p>http://www.stubbornella.org/content/2009/02/28/object-oriented-css-grids-on-github/</a></p>
<p><a href="http://www.iconfinder.com">http://www.iconfinder.com</a> for all the icon resources</p>
]]></content:encoded>
			<wfw:commentRss>http://www.1stwebdesigner.com/css/object-oriented-css/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>10 Tips to Boost Your HTML Forms Performance</title>
		<link>http://www.1stwebdesigner.com/design/10-tips-html-forms-performance/</link>
		<comments>http://www.1stwebdesigner.com/design/10-tips-html-forms-performance/#comments</comments>
		<pubDate>Mon, 13 Jun 2011 10:00:58 +0000</pubDate>
		<dc:creator>Rochester Oliveira</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[html forms]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.1stwebdesigner.com/?p=47611</guid>
		<description><![CDATA[Sometimes we get so used to doing things one way that we forget a little and important thing: to improve. We get so involved with all this CTA stuff that we forget other important things, like the contact form that comes after the pretty button. Our task today is to improve our form, to get [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes we get so used to doing things one way that we forget a little and important thing: <strong>to improve</strong>. We get so involved with all this CTA stuff that we forget other important things, like the contact form that comes after the pretty button.</p>
<p>Our task today is to improve our form, to get better conversion rates, and maybe learn something from it.</p>
<p>We will be talking about conversion, code, and design, in an easy and practical way.</p>
<p>So, let&#8217;s stop talking and rock some forms.</p>
<p><span id="more-47611"></span></p>
<h2>1. Test and track everything</h2>
<p><img class="alignnone size-full wp-image-48491" title="clicktale" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/06/clicktale.jpg" alt="" width="550" height="250" /></p>
<p>Before changing anything, you need to learn how to do split tests so you can measure your improvement. Since there is no magic formula, some techniques that work for other people just don&#8217;t work for you and vice-versa. It&#8217;s kind of a trial and error process.</p>
<p>We have a lot of tools for this tracking job, including <a href="http://www.google.com/support/analytics/bin/answer.py?answer=55515">tracking goals and funnels</a> with Google analytics or <a href="http://www.clicktale.com/">recording users interactions</a> with Clicktale.</p>
<h2>2. Increase conversion by 25%~40% with &#8220;Mad Libs&#8221;</h2>
<p><img class="alignnone size-full wp-image-48492" title="madlibs" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/06/madlibs.jpg" alt="" width="550" height="250" /></p>
<p><a href="http://en.wikipedia.org/wiki/Mad_Libs">According to Wikipedia</a>:</p>
<blockquote><p>Mad Libs consist of a book that has a <a title="Short story" href="http://en.wikipedia.org/wiki/Short_story">short story</a> on each page with many key words replaced with blanks.[...] One player asks the other players, in turn, to contribute some word for the specified type for each blank, but without revealing the context for that word. Finally, the completed story is read aloud.</p>
</blockquote>
<p>It sounds funny, isn&#8217;t it? Well, it is also really good for business. <a href="http://www.lukew.com/ff/entry.asp?1007">LukeW wrote an article</a> about how 2 guys (each one in his own site) have increased dramatically the conversion rates, with this technique.</p>
<p>We have a lot of examples that when you turn your software more <em>friendly</em>, you get much better results. So when you do not have a simple form, but a dialogue the user seems more open to fill it.</p>
<h2>3. Captchas are bad guys</h2>
<p><img class="alignnone size-full wp-image-48498" title="captcha" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/06/captcha.jpg" alt="" width="550" height="250" /></p>
<p>Unless you are a nice guy and want to help in the book digitizing business, I recommend you to remove your captchas.</p>
<p>I say this because we have some alternatives that are almost as efficient as captchas are, but without the downside of reducing our conversion rates.</p>
<p>We have two good examples, one guy who <a href="http://www.90percentofeverything.com/2011/03/25/fk-captcha/">increased his conversion by 33%</a> and other that <a href="http://www.seomoz.org/blog/captchas-affect-on-conversion-rates">lost 3.2% of his conversion while captcha was active</a>, because some people couldn&#8217;t complete the process.</p>
<p>Both replaced captcha with <a href="http://haacked.com/archive/2007/09/11/honeypot-captcha.aspx">honey pot fields</a> and just kept spam at a low level.</p>
<h2>4. Don&#8217;t put optional fields</h2>
<p><img class="alignnone size-full wp-image-48544" title="optional" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/06/optional1.jpg" alt="" width="550" height="250" /></p>
<p>This one is really simple. If this information will be used, you need an obligatory field. If it isn&#8217;t you don&#8217;t need this field.</p>
<p>If you really want to get more information about your users, I recommend you to ask for it after they have finished their current activity (buying, registering&#8230;) so you don&#8217;t waste their time with not-so-important things and keep your forms as short as possible (you know, long forms are bad, bad guys).</p>
<h2>5. Use steps in checkout pages (avoid one page checkout)</h2>
<p><img class="alignnone size-full wp-image-48496" title="steps" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/06/steps.jpg" alt="" width="550" height="250" /></p>
<p>Actually I&#8217;ve done this one wrong many times. When users see long forms they just don&#8217;t want to spend their time filling it out. But the funny part is that if you break a long form in 3 little forms, they are much more open to complete the process.</p>
<p>Proimpact 7 gives us <a href="http://www.proimpact7.com/ecommerce-blog/one-page-checkout-5-reasons-why-not/">5 reasons why not to use one page checkout</a>. Basically, it is because they can reduce your conversion rate by 60%.</p>
<h2>6. Remove that reset button</h2>
<p><img class="alignnone size-full wp-image-48502" title="reset" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/06/reset.jpg" alt="" width="550" height="250" /></p>
<p>All reset buttons should have the label &#8220;you&#8217;ve been rick rolled&#8221;. Really, 99,999% of the cases you just don&#8217;t need them, and it can make the user lose all his data. Jakob Nielsen is pretty extremist about it, he says &#8220;<a href="http://www.useit.com/alertbox/20000416.html">Reset: Don&#8217;t use</a>&#8220;.</p>
<h2>7. Don&#8217;t mask passwords</h2>
<p><img class="alignnone size-full wp-image-48501" title="masking" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/06/masking.jpg" alt="" width="550" height="250" /></p>
<p>This is a pretty controversial thing. Sometimes it is better to mask sometimes not.</p>
<p>What you have to keep in mind is that sometimes it&#8217;s good to give the users the options to &#8220;unmask&#8221; the password field.</p>
<p>Jakob Nielsen again has a pretty extremist opinion that you must <a href="http://www.useit.com/alertbox/passwords.html">stop password masking</a>. I don&#8217;t think it really works&nbsp; this way, but you can try this alternative and measure your results. :D</p>
<h2>8. Validate fields</h2>
<p><img class="alignnone size-full wp-image-48500" title="validation" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/06/validation.jpg" alt="" width="550" height="250" /></p>
<p>Sure, you must be clear about how users must fill some form fields, but it is impossible to prevent all errors. So it is good to have some client-side form validation, like <a href="http://www.vanadiumjs.com/">Vanadium</a>, so users can see what is wrong while they are still typing.</p>
<h2>9. Label above the field is better</h2>
<p><img class="alignnone size-full wp-image-48499" title="label" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/06/label.jpg" alt="" width="550" height="250" /></p>
<p>Above is an eye tracking study that shows how users find it much easier to relate the labels to the fields while they are above them.</p>
<p>It is a really good study of UXMatters about <a href="http://www.uxmatters.com/mt/archives/2006/07/label-placement-in-forms.php">label placement in forms</a>. The only downside of labels above fields is that they need more space so the form can look bigger while it has the same number of inputs than others.</p>
<p>Another good alternative is <a href="http://www.csskarma.com/blog/sliding-labels-v2/">sliding labels</a>, but I think that has potential to save space and be easy to understand.</p>
<h2>10. Auto complete is your friend</h2>
<p><img class="alignnone size-full wp-image-48503" title="autocomplete" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/06/autocomplete.jpg" alt="" width="550" height="250" /></p>
<p><a href="http://www.1stwebdesigner.com/freebies/auto-completion-scripts/">Don&#8217;t know why aren&#8217;t you using it yet</a>.</p>
<h2>Don&#8217;t be afraid to use some custom elements</h2>
<p>Sometimes we need calendars, multiple selects, sliders and others elements that aren&#8217;t available in HTML or they are really bad by default.</p>
<p>When you have this, don&#8217;t be afraid to use jQuery enhancements to your form (non-obtrusive way, of course). We <a href="http://www.tripwiremagazine.com/2010/01/75-top-jquery-plugins-to-improve-your-html-forms.html">have</a> <a href="http://www.tripwiremagazine.com/2010/02/30-jquery-plugins-to-improve-usability-and-look-and-feel-of-html-forms.html">a lot</a> <a href="http://web.enavu.com/tutorials/10-amazing-jquery-plugins-to-improve-your-forms/">of plugins</a> <a href="http://speckyboy.com/2011/05/24/css-form-templates-tools-services/">and resources</a> <a href="http://www.1stwebdesigner.com/css/useful-jquery-techniques-tutorials/">to help</a> us in this task.</p>
<p>One really good example is Uniform, that creates <a href="http://uniformjs.com/">sexy forms with jQuery</a>. It&#8217;s really worth 5 minutes of your attention.</p>
<h2>Are you hungry yet?</h2>
<p>I&#8217;m sure you have read something about it too. Why don&#8217;t you join this conversation and put you thoughts in comments?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.1stwebdesigner.com/design/10-tips-html-forms-performance/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Do&#8217;s and Don&#8217;ts of Writing Better CSS and HTML</title>
		<link>http://www.1stwebdesigner.com/tutorials/dos-donts-better-css-and-html/</link>
		<comments>http://www.1stwebdesigner.com/tutorials/dos-donts-better-css-and-html/#comments</comments>
		<pubDate>Fri, 29 Apr 2011 10:00:33 +0000</pubDate>
		<dc:creator>Ruben D'Oliveira</dc:creator>
				<category><![CDATA[HTML & CSS]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.1stwebdesigner.com/?p=44724</guid>
		<description><![CDATA[CSS and HTML are key languages to begin with, when you decide to invest your time in web design and development. They are powerful languages and most of the time may seem simple to work with. However, every single one of us, beginners, or advanced developers, have committed basic or major mistakes working with both [...]]]></description>
			<content:encoded><![CDATA[<p>CSS and HTML are key languages to begin with, when you decide to invest your time in web design and development. They are powerful languages and most of the time may seem simple to work with.</p>
<p>However, every single one of us, beginners, or advanced developers, have committed basic or major mistakes working with both these languages. With this in mind, I believe it is extremely important and always welcome to learn some good tips and practices which I hope will help you improve your skills and experience.<span id="more-44724"></span></p>
<p>&nbsp;</p>
<p>Some of you may be thinking that since you don&#8217;t see anything out of place when viewing your web page, you have your HTML and CSS documents built correctly, but you may be wrong. The truth is that you should not trust everything you code. Using the same ID more than once on the same page won&#8217;t result in wrong alignments or retrieve any error (unless you try to validate), but it is in fact bad markup and a major flaw in your code.</p>
<h3>Doctype</h3>
<p><a rel="attachment wp-att-44740" href="http://www.1stwebdesigner.com/tutorials/dos-donts-better-css-and-html/attachment/doctype-css-html-how-you-usually-do-and-how-you-should-do-it/"><img class="alignnone size-full wp-image-44740" title="doctype-css-html-How-you-usually-do-and-how-you-should-do-it" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/03/doctype-css-html-How-you-usually-do-and-how-you-should-do-it8.jpg" alt="Doctype" width="570" height="300" /></a></p>
<p>Not so long ago, we had to use those really long Doctypes that were almost impossible to remember. Now, since you just need to use &lt;!DOCTYPE html&gt;  on the top of your document, we have a much cleaner and better solution. Nevertheless, some people still forgets to specify it. This is mandatory for a validated and organized HTML document.</p>
<p><strong>How you should do it</strong></p>
<p>Never forget your DOCTYPE.</p>
<h3>ID vs Classes</h3>
<p><a rel="attachment wp-att-44732" href="http://www.1stwebdesigner.com/tutorials/dos-donts-better-css-and-html/attachment/id-classes-css-html-how-you-usually-do-and-how-you-should-do-it/"><img class="alignnone size-full wp-image-44732" title="id-classes-css-html-How-you-usually-do-and-how-you-should-do-it" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/03/id-classes-css-html-How-you-usually-do-and-how-you-should-do-it.jpg" alt="ID vs Class" width="570" height="300" /></a></p>
<p>An ID is a unique identifier which allows us to target a specific element on the page and, since it is unique, it can only be used once in a page. On the other hand, we have classes which allow us to do exactly the opposite. Classes are used when you have the same element more than once on a page.</p>
<p><strong>How not to do it:<br />
</strong></p>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;block&quot;&gt;
   &lt;div id=&quot;btn&quot;&gt;&lt;/div&gt;
   &lt;div id=&quot;btn&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
</pre>
<p><strong>How you should do it:</strong></p>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;block&quot;&gt;
   &lt;div class=&quot;btn&quot;&gt;&lt;/div&gt;
   &lt;div class=&quot;btn&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
</pre>
<h3>Say no to inline styling</h3>
<p><a rel="attachment wp-att-44734" href="http://www.1stwebdesigner.com/tutorials/dos-donts-better-css-and-html/attachment/inline-styling-css-html-how-you-usually-do-and-how-you-should-do-it/"><img class="alignnone size-full wp-image-44734" title="inline-styling-css-html-How-you-usually-do-and-how-you-should-do-it" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/03/inline-styling-css-html-How-you-usually-do-and-how-you-should-do-it12.jpg" alt="Say no to inline styling" width="570" height="300" /></a></p>
<p><a rel="attachment wp-att-44734" href="http://www.1stwebdesigner.com/tutorials/dos-donts-better-css-and-html/attachment/inline-styling-css-html-how-you-usually-do-and-how-you-should-do-it/"></a></p>
<p>Inline styling is unfortunately a pretty common practice and at the same time a bad one. It has nothing to do with invalid code or bad markup, but with organized code and structure. Imagine you have 30 pages and you need to remove an inline style you have applied to the same div on every single page, it would take you forever and steal precious time.</p>
<p><strong>How not to do it:<br />
</strong></p>
<pre class="brush: xml; title: ; notranslate">
&lt;div style=&quot;width: 100%; background: #fff;&quot;&gt;&lt;/div&gt;
</pre>
<p><strong>How you should do it:</strong></p>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;wrap&quot;&gt;&lt;/div&gt;
</pre>
<h3>Ove use of divs and CSS Classes</h3>
<p><a rel="attachment wp-att-44735" href="http://www.1stwebdesigner.com/tutorials/dos-donts-better-css-and-html/attachment/over-use-css-html-how-you-usually-do-and-how-you-should-do-it/"><img class="alignnone size-full wp-image-44735" title="over-use-css-html-How-you-usually-do-and-how-you-should-do-it" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/03/over-use-css-html-How-you-usually-do-and-how-you-should-do-it3.jpg" alt="Over use of divs and CSS classes" width="570" height="300" /></a></p>
<p>So you started your own project, you know how to use divs, ids, and classes. Inline styling is not your thing (fortunately), and you love to create styles and apply them everywhere. That&#8217;s great, but don&#8217;t write more than you have to.  Having a div with an unordered list inside and a class applied to each li element is unnecessary.</p>
<p><strong>How not to do it:<br />
</strong></p>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;navigation&quot;&gt;
   &lt;ul&gt;
      &lt;li class=&quot;left&quot;&gt;&lt;/li&gt;
      &lt;li class=&quot;left&quot;&gt;&lt;/li&gt;
      &lt;li class=&quot;left&quot;&gt;&lt;/li&gt;
   &lt;/ul&gt;
&lt;/div&gt;
</pre>
<p><strong>How you should do it</strong></p>
<pre class="brush: xml; title: ; notranslate">
&lt;ul id=&quot;navigation&quot;&gt;
   &lt;li&gt;&lt;/li&gt;
   &lt;li&gt;&lt;/li&gt;
   &lt;li&gt;&lt;/li&gt;
&lt;/ul&gt;
</pre>
<p><em>And in your stylesheet</em></p>
<pre class="brush: css; title: ; notranslate">
#navigation li { float: left; }
</pre>
<h3>Browser Resolution</h3>
<p><a rel="attachment wp-att-44738" href="http://www.1stwebdesigner.com/tutorials/dos-donts-better-css-and-html/attachment/browser-resolution-css-html-how-you-usually-do-and-how-you-should-do-it/"><img class="alignnone size-full wp-image-44738" title="browser-resolution-css-html-How-you-usually-do-and-how-you-should-do-it" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/03/browser-resolution-css-html-How-you-usually-do-and-how-you-should-do-it4.jpg" alt="Browser Resolution" width="570" height="300" /></a></p>
<p>According to the W3c&#8217;s latest statistics (January 2011), 13.8% of internet users have a 1024&#215;768 screen resolution, and 85.1% use a bigger screen resolution. So the question is &#8220;What resolution I should design for?&#8221; I personally use a maximum width of 960 or 980 pixels for a vertical layout and between 550 and 640 pixels in case of a horizontal layout. Besides, though 13.8% seems to be a fairly low number, it still represents millions of internet users.</p>
<p><strong>How you should do it</strong></p>
<p>Consider everyone&#8217;s needs, and especially your target audience.</p>
<h3>Block vs Inline elements</h3>
<p><a href="http://www.flickr.com/photos/thienzieyung/5286530393/"><img class="alignnone size-full wp-image-44733" title="inline-block-css-html-How-you-usually-do-and-how-you-should-do-it" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/03/inline-block-css-html-How-you-usually-do-and-how-you-should-do-it1.jpg" alt="Block vs Inline elements" width="570" height="300" /></a></p>
<p>Differentiating block from inline elements can be a a delicate matter for beginners. A block element is displayed on a new line taking by default 100% width of the containing element, like divs (&lt;div&gt;) or paragraphs (&lt;p&gt;). An inline element is displayed with no line breaks meaning that it starts on the same line, taking only his own width, like span (&lt;span&gt;) or image (&lt;img&gt;<img alt="" />).  You can also change the way an element is displayed, this means that you can change an inline element to be display as a block and vice versa.</p>
<p><strong>How you should do it</strong></p>
<pre class="brush: css; title: ; notranslate">

span { display: block; }
</pre>
<h3>Use comments to organize your code</h3>
<p><span style="color: #ff0000;"><a href="http://www.flickr.com/photos/evelynishere/3123831911/"><img class="alignnone size-full wp-image-45043" title="comments-css-html-How-you-usually-do-and-how-you-should-do-it" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/03/comments-css-html-How-you-usually-do-and-how-you-should-do-it44.jpg" alt="Comments" width="570" height="300" /></a></span></p>
<p>When I start a project, I try to organize it through commenting as much as possible and you should do the same. This is something purely optional but I highly recommend its use. It not only helps you find the section or element your are looking for, but also makes your life easier when you need to know which div your &lt;/div&gt;  is closing.</p>
<p><strong>How you should do it</strong></p>
<pre class="brush: xml; title: ; notranslate">
&lt;!-- Begin #header --&gt;
&lt;div id=&quot;header&quot;&gt;
&lt;!-- End #header --&gt;
&lt;/div&gt;
</pre>
<p><em>Stylesheet:</em></p>
<pre class="brush: css; title: ; notranslate">
/* --------------------------------------------------------------
Header
-------------------------------------------------------------- */
#header { background: #fff; }
</pre>
<h3>Cross-Browser Compatibility</h3>
<p><a rel="attachment wp-att-44739" href="http://www.1stwebdesigner.com/tutorials/dos-donts-better-css-and-html/attachment/compatibility-css-html-how-you-usually-do-and-how-you-should-do-it/"><img class="alignnone size-full wp-image-44739" title="compatibility-css-html-How-you-usually-do-and-how-you-should-do-it" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/03/compatibility-css-html-How-you-usually-do-and-how-you-should-do-it8.jpg" alt="Cross-Browser Compatibility" width="570" height="300" /></a></p>
<p>When you decide to make something, you should place yourself in the role of the end-user, and imagine that, even today, some of them still use browsers like IE6. A page in renders differently in Firefox than in Chrome or Internet Explorer. There are some useful tools you can use to check how your page renders in different browsers. Charina wrote a very complete article regarding this topic which I recommend reading &#8211; <a href="http://www.1stwebdesigner.com/design/tools-browser-compatibility-check/" target="_blank">10 Useful Tools For Cross-Browser Compatibility Check</a></p>
<p><strong>How you should do it</strong></p>
<p>Do not forget to pay attention to your layout in different browsers, systematically.</p>
<h3>Keep it short &#8211; Generic classes, properties and CSS files</h3>
<p><a rel="attachment wp-att-44737" href="http://www.1stwebdesigner.com/tutorials/dos-donts-better-css-and-html/attachment/short-css-html-how-you-usually-do-and-how-you-should-do-it/"><img class="alignnone size-full wp-image-44737" title="short-css-html-How-you-usually-do-and-how-you-should-do-it" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/03/short-css-html-How-you-usually-do-and-how-you-should-do-it6.jpg" alt="Keep it short - Generic Classes, properties, and CSS files." width="570" height="300" /></a></p>
<p>When you are coding you should always have one thing in mind, plan for the future. You are already using comments and keeping your code organized, so why stop here? The first thing I do when I&#8217;m coding CSS is to specify a section of generic classes, then on my HTML I simply use them alongside with other elements.</p>
<p><strong>How not to do it:<br />
</strong></p>
<p>Stylesheet</p>
<pre class="brush: css; title: ; notranslate">
#firstblock { background: #000; float: left; }
.genblock { background: #006699; float: left; }
</pre>
<p><em><span style="font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif; font-size: 13px; line-height: 19px; white-space: normal;">HTML</span></em></p>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;firstblock&quot;&lt;/div&gt;
&lt;div class=&quot;genblock&quot;&gt;&lt;/div&gt;
</pre>
<p><strong>How you should do it</strong></p>
<p><em>Stylesheet</em></p>
<pre class="brush: css; title: ; notranslate">
.left { float: left; }
#firstblock { background: #000; }
.genblock { background: #006699; }
</pre>
<p><em>HTML</em></p>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;firstblock&quot; class=&quot;left&quot;&gt;&lt;/div&gt;

&lt;div class=&quot;genblock  left&quot;&gt;&lt;/div&gt;
</pre>
<p>This is a simple way of declaring two classes.  I like to find the most efficient way to do things, and as you can already guess, I really like keeping things organized, so when it comes down to properties, it&#8217;s the same thing.  Why should we write the same property over and over again when we just need to write it once?</p>
<p><strong>How not to do it:<br />
</strong></p>
<pre class="brush: css; title: ; notranslate">
#content { margin-top: 10px; margin-right: 12px; margin-bottom: 0; margin-left: 15px; background-color: #000; background-repeat: no-repeat; }
</pre>
<p><strong>How you should do it:</strong></p>
<pre class="brush: css; title: ; notranslate">
#content { margin: 10px 12px 0 15px; background: #000 no-repeat; }
</pre>
<p>The ideal number of CSS files you should have in your project depends entirely on you and the way you work. I have been involved in projects where there was a &#8220;generic.css&#8221;, &#8220;main.css&#8221;, &#8220;global.css&#8221; among others, it took me forever to understand the purpose of each file. I usually have just two CSS files on my projects &#8211; style.css and reset.css.</p>
<p><strong>How you should do it</strong><br />
You should make it simple and efficient to edit later on.</p>
<h3>Don&#8217;t use heading tags randomly</h3>
<p><a rel="attachment wp-att-44731" href="http://www.1stwebdesigner.com/tutorials/dos-donts-better-css-and-html/attachment/heading-tags-css-html-how-you-usually-do-and-how-you-should-do-it/"><img class="alignnone size-full wp-image-44731" title="heading-tags-css-html-How-you-usually-do-and-how-you-should-do-it" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/03/heading-tags-css-html-How-you-usually-do-and-how-you-should-do-it10.jpg" alt="Don't use heading tags randomly" width="570" height="300" /></a><br />
Heading tags are not just there to make it pretty, they establish the importance of your content which makes them valuable for SEO. There are six Heading tags: h1, h2, h3, h4, h5, and h6. H1 is the most important, so you should use it for your web page or business name only. The rest of the tags should be used according to title or content importance. Also, you don&#8217;t need to have heading tags everywhere on your document.</p>
<p><strong>How not to do it:<br />
</strong></p>
<pre class="brush: xml; title: ; notranslate">

&lt;h6&gt;Post title&lt;/h6&gt;

&lt;h1&gt;Text content&lt;/h1&gt;
</pre>
<p><strong>How you should do it:</strong></p>
<pre class="brush: xml; title: ; notranslate">
&lt;h2&gt;Post title&lt;/h2&gt;
&lt;p&gt;Text content&lt;/p&gt;
</pre>
<h3>Use absolute position only when you have to</h3>
<p><a rel="attachment wp-att-44736" href="http://www.1stwebdesigner.com/tutorials/dos-donts-better-css-and-html/attachment/position-absolute-css-html-how-you-usually-do-and-how-you-should-do-it/"><img class="alignnone size-full wp-image-44736" title="position-absolute-css-html-How-you-usually-do-and-how-you-should-do-it" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/03/position-absolute-css-html-How-you-usually-do-and-how-you-should-do-it8.jpg" alt="Use absolute position only when you need to" width="570" height="300" /></a></p>
<p>When you&#8217;re starting out, you can easily become addicted to the use of absolute positioning. This is because it is an easy way of placing elements, however, this property should not be used excessively. Since elements with absolute position lose their normal flow, it is almost impossible to align them with other sections on the page. You simply can&#8217;t tell a normal element to be on the left side of an element with absolute position.<br />
<strong> </strong></p>
<p><strong>How you should do it:</strong></p>
<p>Use absolute position only when you need to, and not because it is easier.</p>
<h3>Type fonts</h3>
<p><a rel="attachment wp-att-44730" href="http://www.1stwebdesigner.com/tutorials/dos-donts-better-css-and-html/attachment/font-css-html-how-you-usually-do-and-how-you-should-do-it/"><img class="alignnone size-full wp-image-44730" title="font-css-html-How-you-usually-do-and-how-you-should-do-it" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/03/font-css-html-How-you-usually-do-and-how-you-should-do-it6.jpg" alt="Type Fonts" width="570" height="300" /></a></p>
<p>So is there a font you really like and you would love to use it on your page,  is it a standard font? What if not? These are are questions you need to ask before you choose your typography. When you choose a font you must always have a backup plan, this means that in case the user does not have the chosen  font, the second choice (or third, etc) will appear. Examples of standard fonts are Arial, Georgia, Lucida Sans Code, Times New Roman, Verdana, Tahoma, and some more.  Now let&#8217;s say you would like to use a font that is non-standard, what would you do? The most obvious answer is @font-face.</p>
<p><strong>How not to do it:<br />
</strong></p>
<pre class="brush: css; title: ; notranslate">
p { font-family: AurulentSansRegular, Arial, Helvetica, sans-serif; }
</pre>
<p><strong>How you should do it:</strong></p>
<pre class="brush: css; title: ; notranslate">
@font-face {

font-family: 'AurulentSansRegular';

src: url('AurulentSans-Regular-webfont.ttf') format('truetype');

}

p { font-family: 'AurulentSansRegular', Arial, Helvetica, sans-serif; }
</pre>
<h3>Always validate</h3>
<p><a rel="attachment wp-att-44729" href="http://www.1stwebdesigner.com/tutorials/dos-donts-better-css-and-html/attachment/errors-css-html-how-you-usually-do-and-how-you-should-do-it/"><img class="alignnone size-full wp-image-44729" title="validate-css-html-How-you-usually-do-and-how-you-should-do-it" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/03/errors-css-html-How-you-usually-do-and-how-you-should-do-it3.jpg" alt="Always validate your code" width="570" height="300" /></a></p>
<p>The title is pretty self-explanatory, you should always validate your CSS and HTML documents.  Why? The answer is why not? You have a way to know if your code has errors and it gives you solutions to fix them, so really, why not?  Add <a href="http://jigsaw.w3.org/css-validator/" target="_blank">CSS Validator</a> and <a href="http://validator.w3.org/" target="_blank">HTML Validator</a> to your favourites.</p>
<p><strong>How you should do it</strong></p>
<p>Validate your CSS, and after that do the same for your HTML.</p>
<h3>Conclusion</h3>
<p>Some may consider these tips and techniques common sense and simple to understand, others not so much, but the important thing is that every coder make mistakes, and practice makes perfect.</p>
<p>Hope you enjoyed the article and have some fun experimenting, but keep it organized!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.1stwebdesigner.com/tutorials/dos-donts-better-css-and-html/feed/</wfw:commentRss>
		<slash:comments>38</slash:comments>
		</item>
		<item>
		<title>Converting Dezign Folio From PSD to HTML [Very Detailed]</title>
		<link>http://www.1stwebdesigner.com/css/convert-dezign-folio-from-psd-to-html/</link>
		<comments>http://www.1stwebdesigner.com/css/convert-dezign-folio-from-psd-to-html/#comments</comments>
		<pubDate>Fri, 18 Feb 2011 10:16:17 +0000</pubDate>
		<dc:creator>Ahmad Hania</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[HTML & CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[906 Grid]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.1stwebdesigner.com/?p=40999</guid>
		<description><![CDATA[In this article you will learn how to convert Dezign Folio from PSD to HTML in a detailed step-by-step tutorial. You will learn how to create this layout by using a CSS framework, some CSS styles and Javascript. When you&#8217;ve completed this tutorial you&#8217;ll have a valid HTML/CSS, cross browser compatible and dynamic layout. I [...]]]></description>
			<content:encoded><![CDATA[<p>In this article you will learn how to convert <a href="http://www.1stwebdesigner.com/tutorials/dezign-folio-portfolio-tutorial/">Dezign Folio</a> from PSD to HTML in a detailed step-by-step tutorial. You will learn  how to create this layout by using a CSS framework, some CSS styles and  Javascript. When you&#8217;ve completed this tutorial you&#8217;ll have a valid HTML/CSS, cross browser compatible and dynamic  layout. I hope that you can go through this tutorial and learn a few  techniques that will help you in future projects.</p>
<p><span id="more-40999"></span></p>
<p>Now, let’s get started with this tutorial.</p>
<p><strong>Links you will need to complete this tutorial:</strong></p>
<ul>
<li><a href="http://www.1stwebdesigner.com/tutorials/dezign-folio-portfolio-tutorial/">Dezign Folio: Create A Detailed Portfolio Homepage Design In Photoshop</a></li>
<li><a href="http://960.gs/">960 Grid System</a></li>
<li><a href="http://flowplayer.org/tools/scrollable/index.html">jQuery Scrollable</a></li>
</ul>
<p>Here’s what we’ll be creating (Click on image to view a full working <a style="border: 0px none;" href="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/02/dezignfolio/">demo</a>).</p>
<p><a href="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/02/dezignfolio/"><img class="aligncenter size-full wp-image-41000" title="Full Tutorial Demo" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/02/dezignfolio_final.jpg" alt="Full Tutorial Demo" width="690" /></a></p>
<p>You can also download this tutorial&#8217;s source files <a href="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/02/dezignfolio/DezignFolioTutorial.zip">here</a>.</p>
<h2>Step 1 – Preparation</h2>
<p>If you read the          <a href="http://www.1stwebdesigner.com/tutorials/dezign-folio-portfolio-tutorial/">Photoshop tutorial for creating this layout</a> you probably noticed          that <a href="http://960.gs/">960gs</a> grid system was used for guidelines creation.          Well, in this tutorial we will also need the <a href="http://960.gs/">960gs</a> CSS framework. Using CSS frameworks makes  layout and style creation          a lot easier and saves time in web  development. Now you should download the          960 Grid system source  files for usage in this tutorial.</p>
<p>You will also need a code editor; you can use a  plain text          editor such as the Notepad. I always recommend you  use a free code editor and get used to it, this helps you get things  done faster.</p>
<p>During this tutorial you should test your  layout in          different browsers, you don’t want to return to the  beginning because of browser          compatibility issues. In this  tutorial I am using some CSS3 styles, but as you          might know not  all browsers support CSS3 features. The CSS3 styles  used in          this tutorial have been tested with Firefox version 3.6.</p>
<h2>Step 2 – Getting Your Files Ready</h2>
<p>First thing you should do is create a directory for your website.          I usually create an <strong>/images/</strong> directory for images and a <strong>/styles/</strong> directory which will hold every style sheet (CSS) file. The HTML file goes in          the root directory.</p>
<p>Now you need to grab the CSS files from the 960gs grid system we           downloaded earlier, extract the ZIP file and then copy the CSS  files from <strong>/code/css/</strong> folder to your <strong> /styles/</strong> directory, you should copy <strong>960.css</strong>, <strong>reset.css</strong> and <strong>text.css</strong> files. You should notice a directory called <strong>/uncompressed/</strong> which has          the same files but in a bigger and more readable  format, I recommend using the          compressed CSS files. You also  need to create a new file in your root directory          called <strong>index.html</strong> and create another file called <strong>style.css</strong> in <strong>/styles/</strong> directory.</p>
<p>In this tutorial we need to export images from Photoshop to use in  our HTML          layout. You can export these images yourself if you  have the layered PSD file          from the original Photoshop tutorial,  or you can just grab the source files          with this tutorial and  you’ll find the images I created.</p>
<h2>Step 3 – Simple Starter Layout</h2>
<p>We need to start by creating a Simple HTML layout as the basis of our site to be. By looking at the Photoshop Layout you should notice  a few things:</p>
<ol>
<li>The layout has these sections: header, slide show, services, information and a footer.</li>
<li>You&#8217;ll also notice that we can use a single repeating image as the background for the body that covers header, slide show and services.</li>
<li>Both information and footer sections have the same horizontally repeating background image.</li>
<li>Finally, notice that header, slide show, information and footer sections have fixed heights.</li>
</ol>
<p>Based on these points we create the following HTML layout.</p>
<pre class="brush: php; title: ; notranslate">
&lt;!--&lt;span class=&quot;hiddenSpellError&quot; pre=&quot;&quot;--&gt;DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
    &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
    &lt;title&gt;DezignFolio&lt;/title&gt;
    css&quot; href=&quot;styles/reset.css&quot; rel=&quot;stylesheet&quot; media=&quot;all&quot; /&gt;
    css&quot; href=&quot;styles/text.css&quot; rel=&quot;stylesheet&quot; media=&quot;all&quot; /&gt;
    &lt;link type=&quot;text/css&quot; href=&quot;styles/960.css&quot; rel=&quot;stylesheet&quot; media=&quot;all&quot; /&gt;
    &lt;link type=&quot;text/css&quot; href=&quot;styles/style.css&quot; rel=&quot;stylesheet&quot; media=&quot;all&quot; /&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;div class=&quot;header container_12&quot;&gt;
        header content goes here.
    &lt;/div&gt;

&lt;div class=&quot;&lt;span class=&quot;&gt;slideshow&quot;&gt;&lt;/div&gt;
        slide show content goes here.
    &lt;/div&gt;
    &lt;div class=&quot;services container_12&quot;&gt;
        services content goes here.
    &lt;/div&gt;
    &lt;div class=&quot;information&quot;&gt;
        &lt;div class=&quot;container_12&quot;&gt;
            information content goes here.
        &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class=&quot;footer&quot;&gt;
        &lt;div class=&quot;container_12&quot;&gt;
            &lt;div class=&quot;grid_12&quot;&gt;
                Copyright 2010 1stwebdesigner.com
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>As you can see in this layout we added links for the CSS files in the header, created five main <strong>&lt;div&gt;</strong> sections each with a unique class name for styling. I added an extra class <strong>&#8220;container_12&#8243;</strong> to header and services. I also added a <strong>&lt;div&gt;</strong> with a class <strong>&#8220;container_12&#8243;</strong> inside information and footer sections, this will allow us to style the information and footer sections to take full width of the browser area and to hold the repeating background. Finally, notice that <strong>&#8220;container_12&#8243;</strong> in the footer has a <strong>&#8220;grid_12&#8243;</strong> division, this division will take the whole width of <strong>&#8220;container_12&#8243;</strong> and it is styled in <strong>960.css</strong> file. Now          let’s add the CSS as follows (all CSS should be added in <strong>style.css</strong> file):</p>
<pre class="brush: php; title: ; notranslate">
body {
    color: #696969;
    background: #fff url(../images/bg.jpg) repeat-x top center;
    font-size: 12px;
    line-height: 17px;
    font-family: Verdana;
    padding: 0;
}

a {
    text-decoration: none;
}

.header {
    height: 101px;
    overflow: hidden;
}

.slideshow {
    padding: 30px 0 0 0;
    height: 475px;
    overflow: hidden;
    background: url(../images/message_bg.png) no-repeat;
    background-position: center 348px;
}

.information {
    width: 100%;
    height: 318px;
    display: block;
    overflow: hidden;
    background: url(../images/information_footer_bg.jpg) repeat-x top center;
}

.footer {
    width: 100%;
    height: 59px;
    display: block;
    overflow: hidden;
    background: url(../images/information_footer_bg.jpg) repeat-x bottom center;
    text-align: center;
    font-size: 12px;
    line-height: 59px;
    color: #fff;
}
</pre>
<p>Now notice that the body color is set to <strong>#696969</strong> with white as the background color and a horizontally repeating background image <strong>bg.jpg</strong> font size is set to <strong>12px</strong>, line height to <strong>17px</strong>, font set to <strong>Verdana</strong> with zero padding. Then the links text decoration is set to none so that the links aren&#8217;t underlined in normal link state. Now the header height is set to <strong>101px</strong> with overflow hidden to hide extra content. Now look at the header style and see that it has a top padding of <strong>30px</strong> to maintain a space between header and slide show content, height is set to <strong>475px</strong>, with overflow set to hidden and a background image <strong>message_bg.png</strong> aligned horizontally to center and vertically at <strong>348px</strong>. You&#8217;ll notice that there&#8217;s no style for the services section and that&#8217;s because it doesn&#8217;t have any special styles to be that will be applied. Now let&#8217;s look at information style, notice that the width is set to <strong>100% </strong>to fill browsers horizontal space, with a fixed height, overflow set to hidden and a horizontally repeating background image.</p>
<p>Finally, the footer section is going to be styled here entirely and that&#8217;s because it has only one copyright sentence. The width is set to <strong>100%</strong> to fill browsers horizontal space, with <strong>59px</strong> height, hidden overflow, a background image with the same settings as we used in the information section the only change is that its aligned to bottom, text is aligned to center, with <strong>12px</strong> font size, white font color and <strong>59px</strong> line height similar to footer height value so that the text is aligned vertically to center. The result should be the same as the image below.</p>
<p><a href="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/02/step-1.jpg"><img class="aligncenter size-full wp-image-41002" title="step-1" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/02/step-3.jpg" alt="" width="690" /></a></p>
<h2>Step 4 – Adding Logo and Menu Items to Header</h2>
<p>Now we need to add the logo and menu items, here&#8217;s the HTML for the header section.</p>
<pre class="brush: php; title: ; notranslate">
    &lt;div class=&quot;header container_12&quot;&gt;
        &lt;div class=&quot;grid_4&quot;&gt;
            &lt;h1&gt;
                &lt;a href=&quot;#&quot; title=&quot;DesignFolio&quot;&gt;DezignFolio&lt;/a&gt;
            &lt;/h1&gt;
        &lt;/div&gt;
        &lt;div class=&quot;grid_8&quot;&gt;
            &lt;a href=&quot;#&quot; title=&quot;Home&quot; class=&quot;home active&quot;&gt;Home&lt;/a&gt;
            &lt;a href=&quot;#&quot; title=&quot;About Us&quot; class=&quot;about&quot;&gt;About Us&lt;/a&gt;
            &lt;a href=&quot;#&quot; title=&quot;Services&quot; class=&quot;services&quot;&gt;Services&lt;/a&gt;
            &lt;a href=&quot;#&quot; title=&quot;Blog&quot; class=&quot;blog&quot;&gt;Blog&lt;/a&gt;
            &lt;a href=&quot;#&quot; title=&quot;Contact&quot; class=&quot;contact&quot;&gt;Contact&lt;/a&gt;
        &lt;/div&gt;
    &lt;/div&gt;
</pre>
<p>Notice that we added two divisions with a <strong>&#8220;grid_4&#8243;</strong> and <strong>&#8220;grid_8&#8243;</strong> classes, inside the <strong>&#8220;grid_4&#8243;</strong> division I added the logo content and an <strong>&lt;h1&gt;</strong> with a link inside it. Next I added links for the menu items each with a unique class name which will help us in styling each menu item inside the <strong>&#8220;grid_8&#8243;</strong> division. Now lets add the CSS for the header content.</p>
<pre class="brush: php; title: ; notranslate">
.header {
    height: 101px;
    overflow: hidden;
}

    .header .grid_4 h1 a {
        text-indent: -10000px;
        display: block;
        width: 234px;
        height: 45px;
        background: url(../images/logo_menu_bg.png) no-repeat;
        background-position: 0 -38px;
        margin: 36px 0 0 0;
    }

    .header .grid_8 a {
        text-indent: -10000px;
        display: block;
        height: 36px;
        background: url(../images/logo_menu_bg.png) no-repeat;
        margin: 33px 30px 0 0;
        float: left;
    }

        .header .grid_8 a.home {
            background-position: -264px -11px;
            width: 35px;
            margin-left: 250px;
        }

            .header .grid_8 a.home:hover, .header .grid_8 a.home.active {
                background-position: -264px -56px;
            }

        .header .grid_8 a.about {
            background-position: -329px -11px;
            width: 63px;
        }

            .header .grid_8 a.about:hover, .header .grid_8 a.about.active {
                background-position: -329px -56px;
            }

        .header .grid_8 a.services {
            background-position: -422px -11px;
            width: 61px;
        }

            .header .grid_8 a.services:hover, .header .grid_8 a.services.active {
                background-position: -422px -56px;
            }

        .header .grid_8 a.blog {
            background-position: -513px -11px;
            width: 33px;
        }

            .header .grid_8 a.blog:hover, .header .grid_8 a.blog.active {
                background-position: -513px -56px;
            }

        .header .grid_8 a.contact {
            background-position: -572px -11px;
            width: 57px;
            margin-right: 0px;
        }

            .header .grid_8 a.contact:hover, .header .grid_8 a.contact.active {
                background-position: -572px -56px;
            }
</pre>
<p>Now in styling our header content we are going to use a single image that will contain both the logo image and menu items normal state, hover and active state images. We are using a CSS technique called <a href="http://css-tricks.com/css-sprites/">CSS Sprites</a> which allows us to choose what to show from this single image using CSS background position properties, and that&#8217;s why we added a unique class name for each menu item. The image used in the CSS Sprites is <strong>&#8220;logo_menu_bg.jpg&#8221;</strong>, now I start by styling the logo link by setting text indentation to <strong>-10000px</strong> which allows the text to be available in the HTML but it is hidden when viewed in browsers and this has some SEO benefits, a fixed height and width to match the size of the logo image, a top margin of <strong>35px</strong> for a space above the logo, a background image with no repeat and then we set the background image position to <strong>0px</strong> horizontally and <strong>-38px</strong> vertically.</p>
<p>Now we move to style the menu items by setting common styles for all menu item links with a text indentation of <strong>-10000px</strong> to hide the text, a fixed height,  a top margin to make a space above menu items, a right margin to make the space between menu items, a float to left and finally use the same background image for all menu items with no repeat. After we set the common styles for menu items we take each unique class name and style the normal, hover and active states of the link with background position, fixed width. Finally, you should only notice that the first menu item <strong>&#8220;.home&#8221;</strong> with a left margin of <strong>250px</strong> to make the distance between the logo and the menu items. The result should be as the image below.</p>
<p><a href="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/02/step-4.jpg"><img class="aligncenter size-full wp-image-41062" title="step-4" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/02/step-4.jpg" alt="" width="690" /></a></p>
<h2>Step 5 &#8211; Adding Slide Show Content, Style and Javascript</h2>
<p>Now, we are going to use an already implemented solution for the slide show script, the script is <a href="http://flowplayer.org/tools/scrollable/index.html">jQuery Scrollable</a>. I modified it to match what we need here as for style and layout, unfortunately I can&#8217;t walk you through every bit of the process for modifying the script and the styles because I would need a full tutorial for this part alone. I am going to tell you what to include in order to make this work. First, here&#8217;s the HTML for the slide show content.</p>
<pre class="brush: php; title: ; notranslate">

&lt;div class=&quot;&lt;span class=&quot;&gt;slideshow&quot;&gt;&lt;/div&gt;
        &lt;!-- root element for everything --&gt;
        &lt;div id=&quot;scroll&quot;&gt;
            &lt;!-- &lt;span class=&quot;hiddenSpellError&quot; pre=&quot;&quot;&gt;scrollable&lt;/span&gt; items --&gt;

&lt;div style=&quot;left: &lt;span class=;&quot;&gt;-1920px;&quot; id=&quot;tools&quot;&gt;&lt;/div&gt;
                &lt;div class=&quot;tool&quot;&gt;
                    &lt;div class=&quot;details&quot;&gt;
                        &lt;h2&gt;
                            Usce ac nunc eros, ac suscipit mi.
                        &lt;p&gt;
                            Vivamus malesuada convallis fringilla. Sed quam ligula, mattis aliquet vehicula
                            nec, dapibus eu lectus. Nunc mattis egestas arcu, vel ullamcorper enim cursus et.
                            Cum sociis natoque penatibus
                    &lt;/div&gt;
                    &lt;img src=&quot;images/slideshow_image.png&quot; alt=&quot;&quot; /&gt;
                &lt;/div&gt;
                &lt;div class=&quot;tool&quot;&gt;
                    &lt;div class=&quot;details&quot;&gt;
                        &lt;h2&gt;
                            Usce ac nunc eros, ac suscipit mi.
                        &lt;p&gt;
                            Vivamus malesuada convallis fringilla. Sed quam ligula, mattis aliquet vehicula
                            nec, dapibus eu lectus. Nunc mattis egestas arcu, vel ullamcorper enim cursus et.
                            Cum sociis natoque penatibus
                    &lt;/div&gt;
                    &lt;img src=&quot;images/slideshow_image.png&quot; alt=&quot;&quot; /&gt;
                &lt;/div&gt;
                &lt;div class=&quot;tool&quot;&gt;
                    &lt;div class=&quot;details&quot;&gt;
                        &lt;h2&gt;
                            Usce ac nunc eros, ac suscipit mi.
                        &lt;p&gt;
                            Vivamus malesuada convallis fringilla. Sed quam ligula, mattis aliquet vehicula
                            nec, dapibus eu lectus. Nunc mattis egestas arcu, vel ullamcorper enim cursus et.
                            Cum sociis natoque penatibus
                    &lt;/div&gt;
                    &lt;img src=&quot;images/slideshow_image.png&quot; alt=&quot;&quot; /&gt;
                &lt;/div&gt;
                &lt;div class=&quot;tool&quot;&gt;
                    &lt;div class=&quot;details&quot;&gt;
                        &lt;h2&gt;
                            Usce ac nunc eros, ac suscipit mi.
                        &lt;p&gt;
                            Vivamus malesuada convallis fringilla. Sed quam ligula, mattis aliquet vehicula
                            nec, dapibus eu lectus. Nunc mattis egestas arcu, vel ullamcorper enim cursus et.
                            Cum sociis natoque penatibus
                    &lt;/div&gt;
                    &lt;img src=&quot;images/slideshow_image.png&quot; alt=&quot;&quot; /&gt;
                &lt;/div&gt;
                &lt;div class=&quot;tool&quot;&gt;
                    &lt;div class=&quot;details&quot;&gt;
                        &lt;h2&gt;
                            Usce ac nunc eros, ac suscipit mi.
                        &lt;p&gt;
                            Vivamus malesuada convallis fringilla. Sed quam ligula, mattis aliquet vehicula
                            nec, dapibus eu lectus. Nunc mattis egestas arcu, vel ullamcorper enim cursus et.
                            Cum sociis natoque penatibus
                    &lt;/div&gt;
                    &lt;img src=&quot;images/slideshow_image.png&quot; alt=&quot;&quot; /&gt;
                &lt;/div&gt;
            &lt;/div&gt;
            &lt;!-- required for IE6/IE7 --&gt;
            &lt;br clear=&quot;all&quot; /&gt;
            &lt;!-- thumbnails --&gt;
            &lt;div id=&quot;thumbs&quot; class=&quot;t&quot;&gt;
                &lt;a id=&quot;&lt;span class=&quot;&gt;t0&quot; class=&quot;active&quot;&gt;Nunc vulputate&lt;/a&gt;
                    &lt;br /&gt;
                    tristique nisl quis conse
                &lt;!-- &lt;span class=&quot;hiddenSpellError&quot; pre=&quot;&quot;&gt;scrollable&lt;/span&gt; navigator root element --&gt;
                &lt;div class=&quot;navi&quot;&gt;
                    &lt;a style=&quot;display: none;&quot;&gt;&lt;/a&gt;&lt;a id=&quot;&lt;span class=&quot;&gt;t1&quot;&gt;Class aptent&lt;/a&gt;
                        &lt;br /&gt;
                        Vestibulum tempus orc &lt;a id=&quot;&lt;span class=&quot;&gt;t2&quot;&gt;Lorem ipsum&lt;/a&gt;
                            &lt;br /&gt;
                            Curabitur pretium vehicula &lt;a id=&quot;t3&quot;&gt;Cum sociis nat&lt;/a&gt;
                                &lt;br /&gt;
                                Aenean nec libero &lt;a id=&quot;t4&quot;&gt;Maecenas pulvinar dignissim&lt;/a&gt;
                                    &lt;br /&gt;
                                    Vestibulum posuere varius magna
                &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class=&quot;navigation_buttons&quot;&gt;
                &lt;a class=&quot;prev&quot;&gt;Previous&lt;/a&gt; &lt;a class=&quot;next&quot;&gt;Next&lt;/a&gt;
            &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class=&quot;message container_12&quot;&gt;
            &lt;div class=&quot;grid_12&quot;&gt;
                &lt;div&gt;
                    Hi we are Dezign Folio, orbi pulvinar, velit vel pulvinar vehicula, nisl purus iaculis orci, condimentum pharetra ligula libero ac sem.
                &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
</pre>
<p>You&#8217;ll notice a division with an ID parameter <strong>&#8220;scroll&#8221;</strong> this will hold all sliding content, inside it is three main divisions a division with ID parameter <strong>&#8220;tools&#8221;</strong>, a division with ID parameter <strong>&#8220;thumbs&#8221;</strong> and a third division with a class name <strong>&#8220;navigation_buttons&#8221;</strong>. The first division holds the slides as divisions with class name <strong>&#8220;tool&#8221;</strong> each with the content you want inside it, the thumbs division holds the thumbnails or tabs for the slides and it should equal the number of slides and the last division holds the content for the next and previous buttons or links.</p>
<p>After the slide show slides, I added an extra division which will hold the site welcome message with a class name <strong>&#8220;message container_12&#8243;</strong> with a single division inside it that has the message text. Now let&#8217;s add the CSS style for the slide show content and script.</p>
<pre class="brush: php; title: ; notranslate">
.slideshow {
    padding: 30px 0 0 0;
    height: 475px;
    overflow: hidden;
    background: url(../images/message_bg.png) no-repeat;
    background-position: center 348px;
}

    .slideshow .message {
        color: #fff;
        font-size: 18px;
        line-height: 24px;
        text-align: center;
        text-shadow: 0px -1px 0 #000;
        margin-top: 30px;
    }

        .slideshow .message .grid_12 div {
            padding: 0 78px 0 78px;
        }

            .slideshow .message .grid_12 div span {
                color: #f3ff00;
            }

/*------ SlideShow Script Styles ------*/
#scroll {
    position: relative;
	height: 316px;
	overflow: hidden;
	border: 0px none;
    width: 960px;
	padding: 0;
    margin: 0 auto;
    background: url(../images/slideshow_bg.jpg) repeat-x top center;
}

#tools {
	width: 9999em;
	position: absolute;
	height: 258px;
}

.tool {
	float: left;
	width: 960px;
	height: 258px;
	text-align: left;
    overflow: hidden;
}

    .tool img {
        float: right;
    }

.details {
	float: left;
    color: #252525;
    width: 350px;
    margin: 33px 0 0 70px
}

    .details h2 {
        font-family: Verdana;
        font-size: 24px;
        line-height: 28px;
        font-weight: normal;
        margin: 0 0 40px 0;
    }

    .details p {
        font-family: Verdana;
        font-size: 12px;
        line-height: 18px;
        font-weight: normal;
    }

#thumbs {
	height: 60px;
	position: absolute;
	top: 258px;
	width: 960px;
	left: 0px;
    overflow: hidden;
    background: url(../images/thumbs_bg.jpg) repeat-x top center;
}

.navi {
    width: 960px;
    height: 58px;
}

.t {
	padding: 0 !important;
}

    .t a {
	    display: block;
	    float: left;
	    height: 34px;
	    cursor: pointer;
        border-left: 1px solid #b9b9b9;
        border-right: 1px solid #fff;
        border-top: 1px solid #b9b9b9;
        border-bottom: 1px solid #b9b9b9;
        font-family: Arial;
        font-size: 18px;
        line-height: 20px;
        padding: 8px 15px 14px 10px;
        color: #252525;
    }

        .t a span {
            font-size: 12px;
            line-height: 14px;
        }

    .t a.active {
	    cursor: default !important;
        background: url(../images/thumbs_bg_h.jpg) repeat-x top center;
        color: #fff;
        border-left: 1px solid #2d2d2d;
        border-right: 1px solid #2d2d2d;
        border-top: 1px solid #2d2d2d;
        border-bottom: 1px solid #2d2d2d;
    }

    t. a:hover {
        background: url(../images/thumbs_bg_h.jpg) repeat-x top center;
        color: #fff;
        border-left: 1px solid #2d2d2d;
        border-right: 1px solid #2d2d2d;
        border-top: 1px solid #2d2d2d;
        border-bottom: 1px solid #2d2d2d;
    }

#t0 	{ width: 145px; }

#t1		{ width: 145px; }

#t2		{ width: 145px; }

#t3		{ width: 145px; }

#t4		{ width: 245px; }

.navigation_buttons {
    width: 960px;
    height: 75px;
    position: absolute;
    top: 102px;
}

    .navigation_buttons .prev {
        float: left;
        background: url(../images/prev.png) no-repeat center center;
        height: 75px;
        width: 36px;
        border: 0px none;
        text-indent: -10000px;
        cursor: pointer;
    }

    .navigation_buttons .next {
        float: right;
        background: url(../images/next.png) no-repeat center center;
        height: 75px;
        width: 36px;
        border: 0px none;
        text-indent: -10000px;
        cursor: pointer;
        margin: 0 -1px 0 0;
    }
/*------ End of SlideShow Script Styles ------*/
</pre>
<p>The CSS styles included in the comments is the original styles from the slider script, I did however modify it a bit by changing some values such as width, height, padding, margin and background images to make it match our layout design. The message division style has a white text color, <strong>18px</strong> font size, <strong>24px</strong> line height, center aligned text, a text shadow and a top margin. The inner division has a left and right padding values with the <strong>&lt;span&gt;</strong> element having a yellow text color.</p>
<p>Now let&#8217;s add the required jQuery script in the header. You can find the script file in this tutorial source file or from the jQuery Scrollable script page. The HTML head section should be like this.</p>
<pre class="brush: php; title: ; notranslate">
&lt;head&gt;
    &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
    &lt;title&gt;DezignFolio&lt;/title&gt;
    &lt;link type=&quot;text/css&quot; href=&quot;styles/reset.css&quot; rel=&quot;stylesheet&quot; media=&quot;all&quot; /&gt;
    &lt;link type=&quot;text/css&quot; href=&quot;styles/text.css&quot; rel=&quot;stylesheet&quot; media=&quot;all&quot; /&gt;
    &lt;link type=&quot;text/css&quot; href=&quot;styles/960.css&quot; rel=&quot;stylesheet&quot; media=&quot;all&quot; /&gt;
    &lt;link type=&quot;text/css&quot; href=&quot;styles/tut_style.css&quot; rel=&quot;stylesheet&quot; media=&quot;all&quot; /&gt;
    &lt;script type=&quot;text/&lt;span class=&quot;&gt;&lt;!--mce:0--&gt;&lt;/script&gt;
&lt;/head&gt;
</pre>
<p>Finally, we need to add the Javascript code that will allow the slide show to work on our layout. You should add this script just before the closing tag of the body. Here&#8217;s the Javascript.</p>
<pre class="brush: php; title: ; notranslate">
    &lt;script type=&quot;text/javascript&quot;&gt;
        // initialize scrollable and return the programming API
        var api = $(&quot;#scroll&quot;).scrollable({
            items: '#tools'

            // use the navigator plugin
        }).navigator().data(&quot;scrollable&quot;);

        // this callback does the special handling of our &quot;intro page&quot;
        api.onBeforeSeek(function (e, i) {

            // when on the first item: hide the intro
            if (i) {
                $(&quot;#intro&quot;).fadeOut(&quot;slow&quot;);

                // dirty hack for IE7-. cannot explain
                if ($.browser.msie &amp;&amp; $.browser.version &lt; 8) {
                    $(&quot;#intro&quot;).hide();
                }

                // otherwise show the intro
            } else {
                $(&quot;#intro&quot;).fadeIn(1000);
            }

            // toggle activity for the intro thumbnail
            $(&quot;#t0&quot;).toggleClass(&quot;active&quot;, i == 0);
        });

        // a dedicated click event for the intro thumbnail
        $(&quot;#t0&quot;).click(function () {

            // seek to the beginning (the hidden first item)
            $(&quot;#scroll&quot;).scrollable().begin();

        });

    &lt;/script&gt;
</pre>
<p>Now our layout should look like this.</p>
<p><a href="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/02/step-5.jpg"><img class="aligncenter size-full wp-image-41064" title="step-5" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/02/step-5.jpg" alt="" width="690" /></a></p>
<h2>Step 6 &#8211; Adding Services Content</h2>
<p>Now let&#8217;s add the Services section content. Here&#8217;s the HTML content.</p>
<pre class="brush: php; title: ; notranslate">
    &lt;div class=&quot;services container_12&quot;&gt;
        &lt;div class=&quot;grid_4&quot;&gt;
            &lt;h2&gt;
                &lt;img src=&quot;images/service_icon_1.png&quot; alt=&quot;&quot; /&gt;
                &lt;strong&gt;Vivamus&lt;/strong&gt; venenatis?
                &lt;br /&gt;
                Cras sed ipsum quis nisi pellentesque
            &lt;/h2&gt;
            &lt;p&gt;
                Nulla facilisi. Vestibulum metus massa, egestas et porttitor et, venenatis sed felis. Donec elit dolor, placerat eget interdum ac, euismod sit amet tellus. Morbi sit amet hendre- rit ante.
            &lt;/p&gt;
        &lt;/div&gt;
        &lt;div class=&quot;grid_4&quot;&gt;
            &lt;h2&gt;
                &lt;img src=&quot;images/service_icon_2.png&quot; alt=&quot;&quot; /&gt;
                &lt;strong&gt;Phasellus&lt;/strong&gt; consectetur?
                &lt;br /&gt;
                &lt;span&gt;Maecenas pretium diam venenatis&lt;/span&gt;
            &lt;/h2&gt;
            &lt;p&gt;
                Sed consequat, nisi nec tincidunt feugiat, turpis diam dapibus magna, eget pulvinar lorem nulla nec magna. ed fermentum massa quis nisl condimentum.
            &lt;/p&gt;
        &lt;/div&gt;
        &lt;div class=&quot;grid_4&quot;&gt;
            &lt;h2&gt;
                &lt;img src=&quot;images/service_icon_3.png&quot; alt=&quot;&quot; /&gt;
                &lt;strong&gt;Lorem&lt;/strong&gt; ipsum dolor?
                &lt;br /&gt;
                &lt;span&gt;Sed fermentum massa quis commodo&lt;/span&gt;
            &lt;/h2&gt;
            &lt;p&gt;
                Vestibulum commodo aliquam condimen- tum. In a libero luctus purus ornare laoreet. Etiam libero nulla, sodales quis tempus posuere, dictum in eros. Nulla facilisi. Vivamus lacinia lacinia lacinia. Nullam vel blandit odio.
            &lt;/p&gt;
        &lt;/div&gt;
        &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
    &lt;/div&gt;
</pre>
<p>Notice that we have three equal sections which means that we need to use three <strong>&#8220;grid_4&#8243;</strong> divisions. Each division has an <strong>&lt;h2&gt;</strong> tag that includes an image, a title text and text included in a <strong>&lt;span&gt;</strong> tag and a paragraph as service description. Finally, there&#8217;s a division with <strong>&#8220;clear&#8221;</strong> class attribute to clear all floated elements. Now let&#8217;s add the CSS style for services section.</p>
<pre class="brush: php; title: ; notranslate">
    .services h2 {
        font-family: Myriad Pro;
        font-size: 23px;
        font-weight: normal;
        line-height: 30px;
        color: #0b070b;
        margin: 0 0 30px 0;
    }

    .services h2 img {
        float: left;
        display: block;
        width: 50px;
        height: 50px;
        overflow: hidden;
        margin: 0 12px 0 0;
    }

    .services h2 span {
        font-size: 14px;
        line-height: 16px;
    }

    .services .grid_4 p {
        text-align: justify;
        text-indent: 38px;
        margin: 0 0 56px 0;
    }
</pre>
<p>We styled the header element by setting font family to <strong>Myriad Pro</strong>, font size to <strong>23px</strong>, normal font weight, line height to <strong>30px</strong>, font color to <strong>#0b070b</strong> and a bottom margin to <strong>30px</strong> to make a space between the header and the paragraphs. Now we style the image inside the header or the service icon by setting float to left, a fixed height and width to match icon dimensions, overflow to hidden and a right margin of <strong>12px</strong> for the space between image and text. Then I styled the <strong>&lt;span&gt;</strong> element inside the header tag to have a smaller font size and line height. Finally, I styled the paragraph and set text alignment to <strong>justify</strong>, text indent to <strong>38px</strong> to make the first line indentation and a bottom margin of <strong>56px</strong> to represent the space under the paragraphs. Now our layout should look like this.</p>
<p><a href="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/02/step-6.jpg"><img class="aligncenter size-full wp-image-41067" title="step-6" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/02/step-6.jpg" alt="" width="690" /></a></p>
<h2>Step 7 &#8211; Adding Information Content</h2>
<p>Now let&#8217;s add the HTML content for the Information section.</p>
<pre class="brush: php; title: ; notranslate">
    &lt;div class=&quot;information&quot;&gt;
        &lt;div class=&quot;container_12&quot;&gt;
            &lt;div class=&quot;grid_4&quot;&gt;

&lt;h2&gt;Donec posuere mi eget justo&lt;/h2&gt;
                &lt;p&gt;
                    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla id auctor mauris. Pellentesque at quam non massa lobortis sagittis. Donec nisl sapien, eleifend ut bibendum nec, tristique sit amet tortor.
                &lt;/p&gt;
                &lt;p&gt;
                    Etiam a quam metus. Fusce luctus adipiscing mauris, id varius metus feugiat quis. Sed mi nisl, euismod eget facilisis id, pulvinar tincidunt lacus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent vel faucibus ligula. Etiam
                &lt;/p&gt;
            &lt;/div&gt;
            &lt;div class=&quot;grid_4&quot;&gt;

&lt;h2&gt;Curabitur porttitor volutpat&lt;/h2&gt;
                &lt;p&gt;
                    Morbi rutrum, risus et iaculis feugiat, urna est mollis nulla, ut ullamcorper lacus mauris et purus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras mi tortor, consectetur at interdum vel, viverra eget orci. In at elementum eros.
                &lt;/p&gt;
            &lt;/div&gt;
            &lt;div class=&quot;grid_4&quot;&gt;

&lt;h2&gt;Maecenas luctus pharetra&lt;/h2&gt;
                &lt;div class=&quot;subscribe&quot;&gt;
                    &lt;input type=&quot;text&quot; /&gt;
                    &lt;input type=&quot;submit&quot; /&gt;
                &lt;/div&gt;
                &lt;p&gt;
                    Curabitur adipiscing, velit nec fermentum tempus, lorem sem aliquam ligula, id dignissim metus lectus a magna.
                &lt;/p&gt;
            &lt;/div&gt;
            &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
</pre>
<p>In the information section we are using three<strong>&#8220;grid_4&#8243;</strong> divisions the same as we used in the services section. Now each division contains a <strong>&lt;h2&gt;</strong> and paragraphs with the exception of the third and last divisions which includes also division with a <strong>&#8220;subscribe&#8221;</strong> class name which includes two input tags with type <strong>&#8220;text&#8221;</strong> and <strong>&#8220;submit&#8221;</strong>. Now let&#8217;s add the CSS styles for Information section.</p>
<pre class="brush: php; title: ; notranslate">
.information {
    width: 100%;
    height: 318px;
    display: block;
    overflow: hidden;
    background: url(../images/information_footer_bg.jpg) repeat-x top center;
}

    .information .container_12 {
        padding: 36px 0 30px 0;
    }

    .information .grid_4 h2 {
        font-family: Myriad Pro;
        font-size: 18px;
        font-weight: normal;
        line-height: 20px;
        color: #0b070b;
        margin: 0 0 30px 0;
    }

    .information .grid_4 p {
        text-align: justify;
        text-indent: 38px;
    }

    .information .grid_4 .subscribe {
        display: block;
        height: 37px;
        width: 299px;
        background: url(../images/subscribe.png) no-repeat top center;
        overflow: hidden;
        margin: 0 0 15px 0;
    }

        .information .grid_4 .subscribe input[type=text] {
            background: transparent;
            border: 0px none;
            line-height: 30px;
            height: 30px;
            width: 210px;
            margin: 5px 0 0 5px;
            float: left;
        }

        .information .grid_4 .subscribe input[type=submit] {
            background: transparent;
            border: 0px none;
            text-indent: -10000px;
            height: 31px;
            width: 60px;
            float: right;
            cursor: pointer;
            padding: 0px;
            margin: 0 11px 0 0;
        }
</pre>
<p>First we style <strong>&#8220;container_12&#8243;</strong> to have a fixed top and bottom padding, then we style <strong>h2</strong> with <strong>Myriad Pro</strong> as font family, <strong>18px</strong> font size, normal font weight, <strong>20px</strong> line height, text color of <strong>#0b070b</strong> and a bottom margin to make space between <strong>h2</strong> and paragraphs under it. Now we style the paragraphs with a justified text alignment  and first line indentation of <strong>38px</strong>.</p>
<p>Finally, we move to style the subscribe text field and button. The subscribe division has a fixed height and width, a background image with no repeat which has the image for the text field and the button, overflow set to hidden and a bottom margin of <strong>15px</strong>. Now we style the text field by using this <strong>&#8220;.information .grid_4 .subscribe input[type=text]&#8221; </strong>and set background to transparent because all text field have a white background by default, no border, a line height equal to height so that text is aligned to center vertically, a fixed width, float to left and a top and left margin. Now we style the button by using &#8220;.information .grid_4 .subscribe input[type=submit]&#8221; and set background to transparent, no border,  and a text indentation of <strong>-10000px</strong> to hide button text, a fixed height and width, a float to the right, set cursor to <strong>pointer</strong> because submit buttons has a normal pointer by default, zero padding and a right margin of <strong>11px</strong>.</p>
<p>If you followed this tutorial correctly then you should have a full  working          HTML/CSS layout from a PSD that looks exactly like  this.</p>
<p><a href="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/02/dezignfolio_final.jpg"><img class="aligncenter size-full wp-image-41000" title="Full Tutorial Demo" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2011/02/dezignfolio_final.jpg" alt="Full Tutorial Demo" width="690" /></a></p>
<h2>Conclusion</h2>
<p>So that’s it. In this tutorial you learned how to convert a layout  from PSD to          a fully working HTML/CSS website, don’t forget to validate  and check for browser          compatibility (the layout will not  validate because of Javascript &amp; CSS3 styles, remove both to  validate properly). If there was a part of this tutorial you didn&#8217;t understand,  or you have a          better technique, please be  kind and say something in the comments below.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.1stwebdesigner.com/css/convert-dezign-folio-from-psd-to-html/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>40+ Free High Quality CSS/HTML Templates from 2010</title>
		<link>http://www.1stwebdesigner.com/freebies/free-css-html-templates/</link>
		<comments>http://www.1stwebdesigner.com/freebies/free-css-html-templates/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 21:00:01 +0000</pubDate>
		<dc:creator>Jane Bernardo</dc:creator>
				<category><![CDATA[Freebies]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[Resources]]></category>
		<category><![CDATA[Roundup]]></category>
		<category><![CDATA[templates]]></category>

		<guid isPermaLink="false">http://www.1stwebdesigner.com/?p=32516</guid>
		<description><![CDATA[Stylish, elegant, interactive and most of all it&#8217;s free. Free CSS/HTML templates that will put a great design on your website.  If you are creating your own website, you can consider using these free templates. There&#8217;s always that will suit your style, personality, work and the website you will be working on. I&#8217;ll be presenting [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.1stwebdesigner.com/resources/free-css-html-templates/"><img class="alignleft size-full wp-image-32517" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template.jpg" alt="" width="150" height="150" /></a>Stylish, elegant, interactive and most of all it&#8217;s free. Free CSS/HTML templates that will put a great design on your website.  If you are creating your own website, you can consider using these free templates. There&#8217;s always that will suit your style, personality, work and the website you will be working on.</p>
<p>I&#8217;ll be presenting free CSS/HTML templates that you want to consider in your next project but be sure to read terms.<span id="more-32516"></span></p>
<h2><a href="http://chocotemplates.com/portfolio-free-css-template/blue-jeans/">1. Blue Jeans</a></h2>
<p>Stand out from the crowd with this cool, free template for a portfolio website based on blue jeans texture.</p>
<p><a href="http://chocotemplates.com/portfolio-free-css-template/blue-jeans/ "><img class="alignbottom size-full wp-image-32518" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template1.jpg" alt="" width="570" height="400" /></a><br />
( <a href="http://chocotemplates.com/demo/?template=blue-jeans">Demo </a>| <a href="http://chocotemplates.com/download/?d=ZG93bmxvYWRzLzIwMTAvMTEvMTEvMTI4OTQ3NTk4NjU4NzItOWItODRmMzU1LTU1LWJsdWUtamVhbnMtZnJlZS1zdGFuZGFyZC56aXA=&amp;t=217">Download</a> )</p>
<h2><a href="http://www.cssheaven.org/css_templates/portfolio/">2. Portfolio</a></h2>
<p>CSS Heaven Portfolio is yet another free HTML 5 and CSS based website template suitable for businesses. This template has a jQuery slide show in the home page header for displaying your latest work, featured contents or can also be used to tell your visitor what your web site is all about. All the fonts used for the template are included in a folder.</p>
<p><a href="http://www.cssheaven.org/css_templates/portfolio/"><img class="alignbottom size-full wp-image-32520" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template2.jpg" alt="" width="570" height="400" /></a><br />
( <a href="http://www.cssheaven.org/preview/portfolio/">Demo </a>| <a href="http://www.cssheaven.org/css_templates/portfolio/">Download</a> )</p>
<h2><a href="http://www.cssheaven.org/css_templates/high-five/">3. High Five</a></h2>
<p>The style elements are in the CSS including styles for Blog, Comment Templates etc.</p>
<p><a href="http://www.cssheaven.org/css_templates/high-five/ "><img class="alignbottom size-full wp-image-32521" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template3.jpg" alt="" width="570" height="400" /></a><br />
( <a href="http://www.cssheaven.org/preview/highfive/">Demo </a>| <a href="http://www.cssheaven.org/css_templates/high-five/">Download</a> )</p>
<h2><a href="http://www.cssheaven.org/css_templates/rs-18/">4. RS 18</a></h2>
<p>This is designed mainly for business because of the blue color that looks professional.</p>
<p><a href="http://www.cssheaven.org/css_templates/rs-18/"><img class="alignbottom size-full wp-image-32523" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template4.jpg" alt="" width="570" height="400" /></a><br />
( <a href="http://www.cssheaven.org/preview/rs18/">Demo</a>| <a href="http://www.cssheaven.org/css_templates/rs-18/">Download</a> )</p>
<h2><a href="http://tokokoo.com/themes/free-dangdoot">5. Dandoot</a></h2>
<p>DangDoot is a WordPress e-commerce theme that it is suitable mostly for major/indie music recording companies, bands, musicians, music products affiliates, music event organizers or simply online music stores.</p>
<p><a href="http://tokokoo.com/themes/free-dangdoot"><img class="alignbottom size-full wp-image-32525" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template5.jpg" alt="" width="570" height="400" /></a><br />
( <a href="http://www.tokokoo.com/demo/dangdoot/">Demo </a>| <a href="http://tokokoo.com/themes/free-dangdoot">Download</a> )</p>
<h2><a href="http://www.cssheaven.org/css_templates/bamboo/">6. Bamboo</a></h2>
<p>Bamboo is a free CSS Template suitable for small business websites and blogs.</p>
<p><a href="http://www.cssheaven.org/css_templates/bamboo/"><img class="alignbottom size-full wp-image-32526" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template6.jpg" alt="" width="570" height="400" /></a><br />
( <a href="http://www.cssheaven.org/preview/bamboo/">Demo</a>| <a href="http://www.cssheaven.org/css_templates/bamboo/">Download</a> )</p>
<h2><a href="http://csstemplatesmarket.com/freecsstemplates/acallia/">7. Acallia</a></h2>
<p>If your into art, photography or anything related to designs it will fit on you.</p>
<p><img class="alignbottom size-full wp-image-32527" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template7.jpg" alt="" width="570" height="400" /><br />
( <a href="http://csstemplatesmarket.com/freecsstemplates/acallia/index.html">Demo </a>| <a href="http://csstemplatesmarket.com/freecsstemplates/acallia/">Download</a> )</p>
<h2><a href="http://www.cssheaven.org/css_templates/reinvent/">8.Reinvent</a></h2>
<p>One column layout that has ac lean and cool  typography with minimal image design.</p>
<p><a href="http://www.cssheaven.org/css_templates/reinvent/"><img class="alignbottom size-full wp-image-32529" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template8.jpg" alt="" width="570" height="400" /></a><br />
( <a href="http://www.cssheaven.org/preview/reinvent/">Demo </a>| <a href="http://www.cssheaven.org/css_templates/reinvent/">Download</a> )</p>
<h2><a href="http://csstemplatesmarket.com/freecsstemplates/alexx_c/">9. Alexx C</a></h2>
<p>Elegant and professional looking design that match with cool icons.</p>
<p><a href="http://csstemplatesmarket.com/freecsstemplates/alexx_c/"><img class="alignbottom size-full wp-image-32536" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template9.jpg" alt="" width="570" height="400" /></a><br />
( <a href="http://csstemplatesmarket.com/freecsstemplates/alexx_c/index.html">Demo </a>| <a href="http://csstemplatesmarket.com/freecsstemplates/alexx_c/">Download</a> )</p>
<h2><a href="http://www.cssheaven.org/css_templates/real-one/">10. RealOne</a></h2>
<p>Real 1 is a free CSS Template suitable for Real Estate Templates.</p>
<p><a href="http://www.cssheaven.org/css_templates/real-one/"><img class="alignbottom size-full wp-image-32537" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template10.jpg" alt="" width="570" height="400" /></a><br />
( <a href="http://www.cssheaven.org/preview/realone/">Demo </a>| <a href="http://www.cssheaven.org/css_templates/real-one/">Download</a> )</p>
<h2><a href="http://csstemplatesmarket.com/freecsstemplates/the_radio_station/">11.The Radio Station</a></h2>
<p>It is really for radio station website.</p>
<p><a href="http://csstemplatesmarket.com/freecsstemplates/the_radio_station/"><img class="alignbottom size-full wp-image-32538" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template11.jpg" alt="" width="570" height="400" /></a><br />
( <a href="http://csstemplatesmarket.com/freecsstemplates/the_radio_station/index.html">Demo </a>| <a href="http://csstemplatesmarket.com/freecsstemplates/the_radio_station/">Download</a> )</p>
<h2><a href="http://www.cssheaven.org/css_templates/css-heaven-1-2/">12. CSS Heaven 1</a></h2>
<p>A contemporary look that is suited for design and style business.</p>
<p><a href="http://www.cssheaven.org/css_templates/css-heaven-1-2/"><img class="alignbottom size-full wp-image-32539" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template12.jpg" alt="" width="570" height="400" /></a><br />
( <a href="http://www.cssheaven.org/preview/cssh-1/">Demo </a>| <a href="http://www.cssheaven.org/css_templates/css-heaven-1-2/">Download</a> )</p>
<h2><a href="http://csstemplatesmarket.com/freecsstemplates/turrion/">13. Turrion</a></h2>
<p>Business looking template that will lead your visitor to a right track.</p>
<p><a href="http://csstemplatesmarket.com/freecsstemplates/turrion/"><img class="alignbottom size-full wp-image-32540" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template13.jpg" alt="" width="570" height="400" /></a><br />
( <a href="http://csstemplatesmarket.com/freecsstemplates/turrion/index.html">Demo </a>| <a href="http://csstemplatesmarket.com/freecsstemplates/turrion/">Download</a> )</p>
<h2><a href="http://www.cssheaven.org/css_templates/zen-design/">14. Zen Design</a></h2>
<p>It is a good template for article, blog or site that has a every now and then updates.</p>
<p><a href="http://www.cssheaven.org/css_templates/zen-design/"><img class="alignbottom size-full wp-image-32541" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template14.jpg" alt="" width="570" height="400" /></a><br />
( <a href="http://www.cssheaven.org/preview/zendesign/">Demo </a>| <a href="http://www.cssheaven.org/css_templates/zen-design/">Download</a> )</p>
<h2><a href="http://chocotemplates.com/ecommerce-free-css-template/wind-the-air/">15. Urban Gear</a></h2>
<p>Great free html template for on-line shop dedicated to the urban fashion industry. Easily replace the slides or just remove the slider area and use this template as a start point for your on line business.</p>
<p><a href="http://chocotemplates.com/ecommerce-free-css-template/wind-the-air/ "><img class="alignbottom size-full wp-image-32542" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template15.jpg" alt="" width="570" height="400" /></a><br />
( <a href="http://chocotemplates.com/demo/?template=wind-the-air">Demo </a>| <a href="http://chocotemplates.com/ecommerce-free-css-template/wind-the-air/">Download</a> )</p>
<h2><a href="http://csstemplatesmarket.com/freecsstemplates/ubly/">16. ubly</a></h2>
<p>Colorful, cheek style suited for blog sites.</p>
<p><a href="http://csstemplatesmarket.com/freecsstemplates/ubly/"><img class="alignbottom size-full wp-image-32543" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template16.jpg" alt="" width="570" height="400" /></a><br />
( <a href="http://csstemplatesmarket.com/freecsstemplates/ubly/">Demo </a>| <a href="http://csstemplatesmarket.com/freewordpressthemes/">Download</a> )</p>
<h2><a href="http://chocotemplates.com/corporate-free-css-template/besmart/">17. beSMART</a></h2>
<p>Simple corporate CSS/XHTML template ready to meet wide range of requirements for effective on line performance.</p>
<p><a href="http://chocotemplates.com/corporate-free-css-template/besmart/"><img class="alignbottom size-full wp-image-32544" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template17.jpg" alt="" width="570" height="400" /></a><br />
( <a href="http://chocotemplates.com/demo/?template=besmart">Demo </a>| <a href="http://chocotemplates.com/corporate-free-css-template/besmart/">Download</a> )</p>
<h2><a href="http://www.cssheaven.org/css_templates/cssheaven-2/">18. CSS Heaven 2</a></h2>
<p>Suitable for business site.</p>
<p><a href="http://www.cssheaven.org/css_templates/cssheaven-2/ "><img class="alignbottom size-full wp-image-32545" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template18.jpg" alt="" width="570" height="400" /></a><br />
( <a href=" http://www.cssheaven.org/preview/cssh-2/">Demo </a>| <a href="http://www.cssheaven.org/css_templates/cssheaven-2/">Download</a> )</p>
<h2><a href="http://www.csstemplateheaven.com/simple-templates/easy-slide/">19. Easy Slide</a></h2>
<p>Easy Slide is a simple but cool css template based on the famous Coda Slider.</p>
<p><a href="http://www.csstemplateheaven.com/simple-templates/easy-slide/"><img class="alignbottom size-full wp-image-32546" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template19.jpg" alt="" width="570" height="400" /></a><br />
( <a href="http://www.csstemplateheaven.com/demo/easy-slide/">Demo </a>| <a href="http://www.csstemplateheaven.com/simple-templates/easy-slide/">Download</a> )</p>
<h2><a href="http://freepsdtheme.com/2010/04/06/studioclick-html/">20. StudioClick</a></h2>
<p>Studio Click is a simple, well-structured portfolio theme that focuses on one thing: gorgeous photos, screenshots, and content.</p>
<p><a href="http://freepsdtheme.com/2010/04/06/studioclick-html/"><img class="alignbottom size-full wp-image-32547" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template20.jpg" alt="" width="570" height="400" /></a><br />
( <a href="http://freepsdtheme.com/freebie/livepreview/studioclick/">Demo </a>| <a href="http://freepsdtheme.com/2010/04/06/studioclick-html/">Download </a>)</p>
<h2><a href="http://chocotemplates.com/corporate-free-css-template/bizgroup/">21. BizGroup </a></h2>
<p>Simple corporate CSS/XHTML template ready to meet wide range of requirements for effective on line performance especially for solution business.</p>
<p><a href="http://chocotemplates.com/corporate-free-css-template/bizgroup/"><img class="alignbottom size-full wp-image-32726" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template21.jpg" alt="" width="570" height="400" /></a><br />
( <a href="http://chocotemplates.com/demo/?template=bizgroup">Demo </a>| <a href="http://chocotemplates.com/corporate-free-css-template/bizgroup/">Download </a>)</p>
<h2><a href="http://www.csstemplateheaven.com/simple-templates/photo-pro-css-template/">22. Photo Pro css</a></h2>
<p>Photo Pro is a simple css template for portfolios and photo sites and it’s very easy to edit.</p>
<p><a href="http://www.csstemplateheaven.com/simple-templates/photo-pro-css-template/ "><img class="alignbottom size-full wp-image-32728" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template22.jpg" alt="" width="570" height="350" /></a></p>
<p>( <a href="http://www.csstemplateheaven.com/simple-templates/photo-pro-css-template/">Demo </a>| <a href="http://www.csstemplateheaven.com/simple-templates/photo-pro-css-template/">Download </a>)</p>
<h2><a href="http://csstemplatesmarket.com/freecsstemplates/treasure_hunters/">23. Treasure Hunter</a></h2>
<p>This treasure hunting template is suited for photo galleries and blogs.</p>
<p><a href="http://csstemplatesmarket.com/freecsstemplates/treasure_hunters/"><img class="size-full wp-image-32729 alignbottom " title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template23.jpg" alt="" width="570" height="350" /></a></p>
<p>( <a href="http://csstemplatesmarket.com/freecsstemplates/treasure_hunters/index.html">Demo </a>| <a href="http://csstemplatesmarket.com/freecsstemplates/treasure_hunters/">Download </a>)</p>
<h2><a href="http://chocotemplates.com/ecommerce-free-css-template/shop-around/">24. Shop Around</a></h2>
<p>Great free html template for on-line shop. Use it as a start point for your on line business. The template can be easily implemented in many open source eCommerce platforms.</p>
<p><a href="http://chocotemplates.com/ecommerce-free-css-template/shop-around/"><img class="alignbottom size-full wp-image-32730" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template24.jpg" alt="" width="570" height="350" /></a></p>
<p>( <a href="http://chocotemplates.com/demo/?template=shop-around">Demo </a>| <a href="http://chocotemplates.com/ecommerce-free-css-template/shop-around/">Download </a>)</p>
<h2><a href="http://freepsdtheme.com/2010/04/06/nova-html/">25.  Free Nova Studio</a></h2>
<p>Nova Studio is a multi-purpose portfolio theme featuring a rich home page with a slider, a “From the Blog” widget, and multiple ways to beautifully display your work. A intuitive, unique design will make your site stand out from the crowd and solid markup will make it easy to edit.</p>
<p><a href="http://freepsdtheme.com/2010/04/06/nova-html/"><img class="alignbottom size-full wp-image-32731" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template25.jpg" alt="" width="570" height="350" /></a></p>
<p>( <a href="http://freepsdtheme.com/freebie/livepreview/nova/blue/">Demo </a>| <a href="http://freepsdtheme.com/2010/04/06/nova-html/">Download </a>)</p>
<h2><a href="http://chocotemplates.com/corporate-free-css-template/mondays/">26. Mondays</a></h2>
<p>Simple corporate CSS/XHTML template ready to meet wide range of requirements for effective on line performance.</p>
<p><a href="http://chocotemplates.com/corporate-free-css-template/mondays/"><img class="alignbottom size-full wp-image-32732" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template26.jpg" alt="" width="570" height="350" /></a></p>
<p>( <a href="http://chocotemplates.com/demo/?template=mondays">Demo </a>| <a href="http://chocotemplates.com/corporate-free-css-template/mondays/">Download </a>)</p>
<h2><a href="http://www.owmx.com/">27. OWMX 1</a></h2>
<p>Stylish and cool in the eyes. Great for professional businesses.</p>
<p><a href="http://www.owmx.com/templates/"><img class="alignbottom size-full wp-image-32733" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template27.jpg" alt="" width="570" height="350" /></a></p>
<p>( <a href="http://www.owmx.com/templates/owmx-1.html">Demo </a>| <a href="http://www.owmx.com/templates/owmx-1.html">Download </a>)</p>
<h2><a href="http://chocotemplates.com/corporate-free-css-template/simple-solution/">28. Simple Solution</a></h2>
<p>Clean and stylish that suits for businesses.</p>
<p><a href="http://chocotemplates.com/corporate-free-css-template/simple-solution/"><img class="alignbottom size-full wp-image-32734" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template28.jpg" alt="" width="570" height="350" /></a><br />
( <a href="http://chocotemplates.com/demo/?template=simple-solution">Demo </a>| <a href="http://chocotemplates.com/corporate-free-css-template/simple-solution/">Download </a>)</p>
<h2><a href="http://sixrevisions.com/freebies/web-page-templates/free-xhtml-template-pack-luxury-classic/">29. Classic Luxury</a></h2>
<p>Classic Luxury is great for portfolios and personal photo sites, and can be converted easily to a CMS theme as needed (such as Drupal or WordPress).</p>
<p><a href="http://sixrevisions.com/freebies/web-page-templates/free-xhtml-template-pack-luxury-classic/"><img class="alignbottom size-full wp-image-32735" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template29.jpg" alt="" width="570" height="350" /></a><br />
( <a href="http://www.csstemplateheaven.com/demo/classic_luxury_demo/index.html">Demo </a>| <a href="http://sixrevisions.com/freebies/web-page-templates/free-xhtml-template-pack-luxury-classic/">Download </a>)</p>
<h2><a href="http://chocotemplates.com/corporate-free-css-template/outliers/">30. Outliers</a></h2>
<p>Dark corporate CSS/XHTML template ready to showcase your ideas.</p>
<p><a href="http://chocotemplates.com/corporate-free-css-template/outliers/ "><img class="alignbottom size-full wp-image-32736" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template30.jpg" alt="" width="570" height="350" /></a><br />
( <a href="http://chocotemplates.com/demo/?template=outliers">Demo </a>| <a href="http://chocotemplates.com/corporate-free-css-template/outliers/">Download </a>)</p>
<h2><a href="http://www.csstemplateheaven.com/simple-templates/portfolio-template/">31. Portfolio Template</a></h2>
<p>This is a clean and professional looking template for small portfolios or business sites. Very easy to edit if you have a basic understanding of html and css.</p>
<p><a href="http://www.csstemplateheaven.com/simple-templates/portfolio-template/"><img class="alignbottom size-full wp-image-32737" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template31.jpg" alt="" width="570" height="350" /></a><br />
( <a href="http://www.csstemplateheaven.com/simple-templates/portfolio-template/">Demo </a>| <a href="http://www.csstemplateheaven.com/simple-templates/portfolio-template/">Download</a> )</p>
<h2><a href="http://chocotemplates.com/corporate-free-css-template/market-leader/">32. Market  Leader</a></h2>
<p>Light corporate CSS/XHTML template ready suits to showcase ideas to your clients.</p>
<p><a href="http://chocotemplates.com/corporate-free-css-template/market-leader/"><img class="alignbottom size-full wp-image-32738" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template32.jpg" alt="" width="570" height="350" /></a><br />
( <a href="http://chocotemplates.com/demo/?template=market-leader">Demo </a>| <a href="http://chocotemplates.com/corporate-free-css-template/market-leader/">Download </a>)</p>
<h2><a href="http://www.csstemplateheaven.com/simple-templates/clean-white-css-template/">33. Clean-White</a></h2>
<p>This is a simple but beautiful css template with lots of whitespace and a professional look. Perfect as a frontpage for small businesses or photographers.</p>
<p><a href="http://www.csstemplateheaven.com/simple-templates/clean-white-css-template/"><img class="alignbottom size-full wp-image-32739" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template33.jpg" alt="" width="570" height="350" /></a><br />
( <a href="http://www.csstemplateheaven.com/demo/clean-white-demo/">Demo </a>| <a href="http://www.csstemplateheaven.com/simple-templates/clean-white-css-template/">Download </a>)</p>
<h2><a href="http://chocotemplates.com/portfolio-free-css-template/ninja-assassin/">34. Ninja Assasin</a></h2>
<p>Impress visitors to your site with a high-quality one-page portfolio site inspired by the Japanese ninja culture. The template is ready to use and will showcase your work in a unique fashion.</p>
<p><a href="http://chocotemplates.com/portfolio-free-css-template/ninja-assassin/"><img class="alignbottom size-full wp-image-32740" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template34.jpg" alt="" width="570" height="350" /></a><br />
( <a href="http://chocotemplates.com/demo/?template=ninja-assassin">Demo </a>| <a href="http://chocotemplates.com/portfolio-free-css-template/ninja-assassin/">Download </a>)</p>
<h2><a href="http://tokokoo.com/themes/free-kelontong">35. Kelontong</a></h2>
<p>Kelontong WordPress e-commerce theme is on board to simplify your life for our own online store now.</p>
<p><a href="http://tokokoo.com/themes/free-kelontong"><img class="alignbottom size-full wp-image-32741" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template35.jpg" alt="" width="570" height="350" /></a><br />
( <a href="http://www.tokokoo.com/demo/kelontong/">Demo </a>| <a href="http://tokokoo.com/themes/free-kelontong">Download </a>)</p>
<h2><a href="http://www.cssheaven.org/css_templates/small-business/">36.  Small Business</a></h2>
<p>This is suitable for small scale business websites that don’t need a lot of pages.</p>
<p><a href="http://www.cssheaven.org/css_templates/small-business/"><img class="alignbottom size-full wp-image-32742" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template36.jpg" alt="" width="570" height="350" /></a><br />
( <a href="http://www.cssheaven.org/preview/smallbusiness/">Demo </a>| <a href="http://www.cssheaven.org/css_templates/small-business/">Download </a>)</p>
<h2><a href="http://ramblingsoul.com/blog/free-css-templates/free-css-template-rs19/">37. RS 19</a></h2>
<p>Stylish template with the combination of white and colorful taste.  It uses box shadows and text shadows techniques.</p>
<p><a href="http://ramblingsoul.com/blog/free-css-templates/free-css-template-rs19/"><img class="alignbottom size-full wp-image-32744" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template37.jpg" alt="" width="570" height="350" /></a><br />
( <a href="http://ramblingsoul.com/preview/rs19/">Demo </a>| <a href="http://ramblingsoul.com/blog/free-css-templates/free-css-template-rs19/">Download </a>)</p>
<h2><a href="http://www.templatemo.com/templates/templatemo_238_fruit_mix/">38. Fruit Mix</a></h2>
<p>As what the title suggest, good for healthy lifestyle website.</p>
<p><a href="http://www.templatemo.com/templates/templatemo_238_fruit_mix/index.html"><img class="alignbottom size-full wp-image-32747" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template38.jpg" alt="" width="570" height="350" /></a><br />
( <a href="http://www.templatemo.com/templates/templatemo_238_fruit_mix/index.html">Demo </a>| <a href="http://www.templatemo.com/preview/templatemo_238_fruit_mix">Download </a>)</p>
<h2><a href="http://www.free-css.com/free-css-templates/page115/school-education.php#bookmarks">39. School Education Template</a></h2>
<p>Great for your school website. Publish school activities and announcements.</p>
<p><a href="http://www.free-css.com/free-css-templates/page115/school-education.php#bookmarks"><img class="alignbottom size-full wp-image-32748" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template39.jpg" alt="" width="570" height="350" /></a><br />
( <a href="http://www.free-css.com/assets/files/free-css-templates/preview/page115/school-education/">Demo </a>| <a href="http://www.free-css.com/free-css-templates/page115/school-education.php#bookmarks">Download </a>)</p>
<h2><a href="http://www.solucija.com/template/lawyerattorney">40. Law Attorney</a></h2>
<p>If you have a law firm, this is well suited for you.</p>
<p><a href="http://www.solucija.com/template/lawyerattorney"><img class="alignbottom size-full wp-image-32750" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template40.jpg" alt="" width="570" height="350" /></a><br />
( <a href="http://www.solucija.com/template/lawyerattorney">Demo </a>| <a href="http://www.solucija.com/template/lawyerattorney">Download </a>)</p>
<h2><a href="http://opensourcetemplates.org/preview/film-blog-website-template/">41. Film Blog</a></h2>
<p>For film lover, this is a great template that will let you post your videos.</p>
<p><a href="http://opensourcetemplates.org/preview/film-blog-website-template/"><img class="alignbottom size-full wp-image-32751" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template41.jpg" alt="" width="570" height="350" /></a><br />
( <a href="http://opensourcetemplates.org/preview/film-blog-website-template/">Demo </a>| <a href="http://opensourcetemplates.org/preview/film-blog-website-template/">Download </a>)</p>
<h2><a href="http://www.stylishtemplate.com/demos/electronics-web-template-2/">42. Electronics</a></h2>
<p>Cool coffee color that match on your electronics or appliances website.</p>
<p><a href="http://www.stylishtemplate.com/demos/electronics-web-template-2/"><img class="alignbottom size-full wp-image-32752" title="css_html_template" src="http://cdn1.1stwebdesigner.com/wp-content/uploads/2010/11/css_html_template42.jpg" alt="" width="570" height="350" /></a><br />
( <a href="http://www.stylishtemplate.com/demos/electronics-web-template-2/">Demo </a>| <a href="http://www.stylishtemplate.com/website-templates/personal-web-templates/electronics-web-template-2/">Download </a>)</p>
<p>Free CSS/ HTML are really good to work on especially when you are about to start your new website and need to find something that will suit your business. Just try to explore more and learn about the free templates so that you can maximize the use of it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.1stwebdesigner.com/freebies/free-css-html-templates/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
	</channel>
</rss>

