<?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>Webdevtuts &#187; css</title>
	<atom:link href="http://www.webdevtuts.net/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webdevtuts.net</link>
	<description>Making tutorials fun and easy!</description>
	<lastBuildDate>Wed, 28 Jul 2010 05:38:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Create a rollover image using css image sprites</title>
		<link>http://www.webdevtuts.net/coding/css/create-a-rollover-image-using-css-image-sprites/</link>
		<comments>http://www.webdevtuts.net/coding/css/create-a-rollover-image-using-css-image-sprites/#comments</comments>
		<pubDate>Sun, 04 Jul 2010 18:39:50 +0000</pubDate>
		<dc:creator>Marcell</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[hover effect]]></category>
		<category><![CDATA[images sprites]]></category>
		<category><![CDATA[rollover images]]></category>

		<guid isPermaLink="false">http://www.webdevtuts.net/?p=1495</guid>
		<description><![CDATA[images can only be done with javascript considering you're using a WYSIWYG editor. Well not today. In this tutorial I will teach you how you can create a css rollover image with ease. ]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re new to web design then you might think rollover images can only be done with javascript considering you&#8217;re using a WYSIWYG editor. Well not today. In this tutorial I will teach you how you can create a css rollover image with ease. After today you&#8217;ll have this technique mastered.   </p>
<blockquote>
<h2>Things you need</h2>
<ul>
<li><a href="http://www.demo.webdevtuts.net/css/css.rar" title="Css Image Sprite" target="_blank">CSS Image</a></li>
<li><a href="http://www.demo.webdevtuts.net/css/image-sprites.html" title="Css Image Sprite" target="_blank"><b>VIEW THE DEMO</b></a></li>
</ul>
</blockquote>
<h2>The HTML</h2>
<p>When creating rollover images/ css image sprites(Same things) all that is needed in the HTML are the div tags. We used the div tag to define the rollover image later in the css file. So inside of your newly open HTML document create a new div.</p>
<pre>
<code>
&lt;div id=&quot;image-sprite&quot;&gt;&lt;/div&gt;&lt;!--end image-sprite--&gt;
<!--formatted--></code>
</pre>
<h2>The CSS</h2>
<p>The CSS is the most important part of creating rollover images because this is where we tell our HTML document to look for the styling of our images. So you&#8217;ve downloaded the example image that I&#8217;ve created for you all to use while during this tutorial. So as you can see we have an image that is 336px in height x296px in width. The width doesn&#8217;t really matter considering they&#8217;re are the same. The height is what we care about. So earlier I created two separate images in Photoshop. One of the images equal 168px and height. So I created 2 images and put them together which is how we got the height of 336px(168+168=<b>336</b>).</p>
<p>So lets style of rollover images. Copy the css code below in I will explain it. </p>
<pre>
<code>
#image-sprite {
	background:url(sprite.jpg);
	width:296px;
	height:168px;
}
</code>
</pre>
<p>So above I have called the HTML div tag using css. Then I called for the css to grab the background image. The trick to the css rollover image is when you define the height you only put the height of one image. So the height of one image was 168px and the width like I said before doesn&#8217;t really matter because they&#8217;re both the same. </p>
<h3>The Rollover Effect</h3>
<p>Now it&#8217;s time to create our rollover effect. Copy the code below and I will explain it. </p>
<pre>
<code>
#image-sprite:hover {
	background:url(sprite.jpg);
	width:296px;
	height:168px;
	background-position:0 -168px;
}
</code>
</pre>
<p>So I applied a hover effect to our css file which tells the HTML document that when ever someone hovers over it to change the image. Everything is the same as our first div except I used the css tag <b>background-position:</b> to change images. The first zero in the background-position tag tells the css to move left or right and we did not want that because are images are stacked vertical. The right numeral <b>-168px</b> tells the the css to move up or down. I told the css to move down -168px which created our rollover effect. Now you&#8217;re all done. </p>
<p>There are many ways you can create css rollover images. The technique I showed you guys today is the very simple but can be used to create very<br />
complex rollover images. I hoped you learned something from this tutorial today. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdevtuts.net/coding/css/create-a-rollover-image-using-css-image-sprites/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quick Tip: How to target IE browsers using conditional stylesheets</title>
		<link>http://www.webdevtuts.net/coding/css/quick-tip-how-to-target-ie-browsers-using-conditional-stylesheets/</link>
		<comments>http://www.webdevtuts.net/coding/css/quick-tip-how-to-target-ie-browsers-using-conditional-stylesheets/#comments</comments>
		<pubDate>Mon, 31 May 2010 14:05:03 +0000</pubDate>
		<dc:creator>Marcell</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[quicktips]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[quick tip]]></category>
		<category><![CDATA[stylesheet]]></category>

		<guid isPermaLink="false">http://www.webdevtuts.net/?p=1274</guid>
		<description><![CDATA[Internet Explore (IE) can be very annoying if you're coding a website in Firefox, Opera, Chrome, or Safari. As you may all know IE has many problems when it comes to designing and creating a website.]]></description>
			<content:encoded><![CDATA[<p>Internet Explore (IE) can be very annoying if you&#8217;re coding a website in Firefox, Opera, Chrome, or Safari. As you may all know IE has many problems when it comes to designing and creating a website. In this quick tip article I will show you how you can target specific IE browsers using conditional stylesheets. After this all your IE bugs should be taken care of. </p>
<p><b>Note:</b> Please place the conditional stylesheet code inside the head tags or else they will not work. </p>
<p>The code below Targets every version of Internet Explorer </p>
<pre>
<code>
&lt;!--[if IE]&gt;&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;IE.css&quot; /&gt;&lt;![endif]--&gt;
<!--formatted--></code>
</pre>
<p>The code below Targets Internet Explorer 7 Only</p>
<pre>
<code>
&lt;!--[if IE 7]&gt;&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;IE7.css&quot;&gt;&lt;![endif]--&gt;
<!--formatted--></code>
</pre>
<p>The code below Targets Internet Explorer 8 Only</p>
<pre>
<code>
&lt;!--[if IE 8]&gt;&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;IE7.css&quot;&gt;&lt;![endif]--&gt;
<!--formatted--></code>
</pre>
<p>If you wanted to target multiple browsers but not include one you would use the code below. The code below tells whatever browsers your using to target every Internet Explorer from IE7 and down. If you wanted to target IE8 then you would simply change the 7 to 8. </p>
<pre>
<code>
&lt;!--[if IE lt 7]&gt;&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;IE7.css&quot;&gt;&lt;![endif]--&gt;
<!--formatted--></code>
</pre>
<p>So if you every run across a bug in IE feel free to use one of the conditional stylehseet methods to target and catch those bugs. I hope this tutorial was helpful to you. Now go catch some bugs!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdevtuts.net/coding/css/quick-tip-how-to-target-ie-browsers-using-conditional-stylesheets/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Create a 3 column fluid layout using HTML/CSS</title>
		<link>http://www.webdevtuts.net/coding/create-a-3-column-fluid-layout-using-htmlcss/</link>
		<comments>http://www.webdevtuts.net/coding/create-a-3-column-fluid-layout-using-htmlcss/#comments</comments>
		<pubDate>Thu, 20 May 2010 15:06:28 +0000</pubDate>
		<dc:creator>Marcell</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[developers]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[layout]]></category>

		<guid isPermaLink="false">http://www.webdevtuts.net/?p=1217</guid>
		<description><![CDATA[Hey there fellow designers and coders. Here on Webdevtuts I have been posting a lot of Photoshop tutorials and that is great for designers but what about the people who would like to learn code. Since I have not written a tutorial on code ..]]></description>
			<content:encoded><![CDATA[<p>Hey there fellow designers and coders. Here on Webdevtuts I have been posting a lot of Photoshop tutorials and that is great for designers but what about the people who would like to learn code. Since I have not written a tutorial on code I decided to open up Notepad++ and create something useful for you all. Today I will be teaching you how to create a Fluid 3 column layout using HTML &#038; CSS. </p>
<h1><a href="http://www.demo.webdevtuts.net/3%20column%20layout/index.html" target="_blank">DEMO</a></h1>
<h2>The HTML</h2>
<p>When starting  website I always start with the basic HTML tags such as the Head, Title, and Body tags. Then I&#8217;ve added some divs and gave them all a custom name. I give them all a custom name so I can later define them in the stylesheet.</p>
<ul>
<li><b>Masthead:</b> &#8211; Section will contain and hold all logo, and header information. </li>
<li><b>Container</b> &#8211; Container will contain and hold all content and columns</li>
</ul>
<p>Copy and paste the layout below into notepad or dreamweaver(whatever program you use for coding) and save it as index.html. </p>
<pre>
<code>
&lt;!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;
&lt;html dir=&quot;ltr&quot; xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;

&lt;head&gt;
&lt;title&gt;Title Goes Here&lt;/title&gt;
&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot; /&gt;
&lt;link href=&quot;style.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;div id=&quot;masthead&quot;&gt;

&lt;/div&gt;&lt;!--end masthead--&gt;

&lt;div id=&quot;container&quot;&gt;

&lt;/div&gt;&lt;!--end container--&gt;

&lt;/body&gt;

&lt;/html&gt;

<!--formatted--></code>
</pre>
<h2>More divs</h2>
<p>For the Masthead section we will insert two divs.  The first div we will enter is logo. The logo div will contain our logo. Then we will enter another div right below it and name it header. The header div will be for our header text and slogan. </p>
<p>Copy and paste the code below inside of the Masthead div. </p>
<pre>
<code>
&lt;div id=&quot;logo&quot;&gt;
&lt;/div&gt;&lt;!--end logo--&gt;

&lt;div id=&quot;header&quot;&gt;
&lt;/div&gt;&lt;!--end header--&gt;
<!--formatted--></code>
</pre>
<p>Now that we have our header section taken care of we will now insert our container divs. Create 3 divs, left_col, right_col, and page_content. </p>
<ul>
<li><b>left_col:</b> &#8211; This will contain/hold all left column text and information.</li>
<li><b>right_col:</b> &#8211; This will contain/hold all right column text and information.</li>
<li><b>page_content:</b> &#8211; This will contain/hold all main column text and information.</li>
</ul>
<pre>
<code>
&lt;div id=&quot;left_col&quot;&gt;
&lt;/div&gt;&lt;!--end left_col--&gt;

&lt;div id=&quot;right_col&quot;&gt;
&lt;/div&gt;&lt;!--end right_col--&gt;

&lt;div id=&quot;page_content&quot;&gt;
&lt;/div&gt;&lt;!--end page_content--&gt;
<!--formatted--></code>
</pre>
<p>Our final div will be out footer div. We do not want to place the footer inside of our container tag because we would like for it to span across out entire screen. Also I always place it outside of the container so it can stay at the bottom of the page. Create a new div and call it footer. </p>
<p>copy in paste code below after the end of the container div. </p>
<pre>
<code>
&lt;div id=&quot;footer&quot;&gt;
&lt;/div&gt;&lt;!--end footer--&gt;
<!--formatted--></code>
</pre>
<p>Before we begin styling our page we will need to add some text. Google search lorem ispum and you find loads of gibberish text that you can use for this tutorial. Here is what the html looks like with the text. </p>
<pre>
<code>
&lt;!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;
&lt;html dir=&quot;ltr&quot; xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;

&lt;head&gt;
&lt;title&gt;3 Column Layout | Webdevtuts&lt;/title&gt;
&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot; /&gt;
&lt;link href=&quot;style.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;div id=&quot;masthead&quot;&gt;
	&lt;div id=&quot;logo&quot;&gt;
	&lt;h1&gt;Logo&lt;/h1&gt;
	&lt;/div&gt;&lt;!--end logo--&gt;

	&lt;div id=&quot;header&quot;&gt;
	&lt;h1&gt;This is Your Header&lt;/h1&gt;
	&lt;p&gt;This is your header&lt;/p&gt;
	&lt;/div&gt;&lt;!--end header--&gt;
&lt;/div&gt;&lt;!--end masthead--&gt;

&lt;div id=&quot;container&quot;&gt;
	&lt;div id=&quot;left_col&quot;&gt;
	&lt;h1&gt;Left Column&lt;/h1&gt;
	&lt;p&gt;
	There are many variations of passages of Lorem Ipsum available, but the majority have
	suffered alteration in some form, by injected humour, or randomised words which don&#039;t
	look even slightly believable. If you are going to use a passage of Lorem Ipsum, you
	need to be sure there isn&#039;t anything embarrassing hidden in the middle of text. All the
	Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary,
	making this the first true generator on the Internet. It uses a dictionary of over 200
	Latin words, combined with a handful of model sentence structures, to generate Lorem
	Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from
	repetition, injected humour, or non-characteristic words etc.
	&lt;/p&gt;
	&lt;/div&gt;&lt;!--end left_col--&gt;

	&lt;div id=&quot;right_col&quot;&gt;
	&lt;h1&gt;Right Column&lt;/h1&gt;
	&lt;p&gt;
	There are many variations of passages of Lorem Ipsum available, but the majority have
	suffered alteration in some form, by injected humour, or randomised words which don&#039;t
	look even slightly believable. If you are going to use a passage of Lorem Ipsum, you
	need to be sure there isn&#039;t anything embarrassing hidden in the middle of text. All the
	Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary,
	making this the first true generator on the Internet. It uses a dictionary of over 200
	Latin words, combined with a handful of model sentence structures, to generate Lorem
	Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from
	repetition, injected humour, or non-characteristic words etc.
	&lt;/p&gt;
	&lt;/div&gt;&lt;!--end right_col--&gt;

	&lt;div id=&quot;page_content&quot;&gt;
	&lt;h1&gt;Main Column&lt;/h1&gt;
	&lt;p&gt;
	Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of
	classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin
	professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words,
	consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature,
	discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of &quot;de Finibus Bonorum
	et Malorum&quot; (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the
	theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, &quot;Lorem ipsum dolor
	sit amet..&quot;, comes from a line in section 1.10.32.
	&lt;/p&gt;

	&lt;p&gt;
	Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of
	classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin
	professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words,
	consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature,
	discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of &quot;de Finibus Bonorum
	et Malorum&quot; (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the
	theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, &quot;Lorem ipsum dolor
	sit amet..&quot;, comes from a line in section 1.10.32.
	&lt;/p&gt;

	&lt;p&gt;
	Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of
	classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin
	professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words,
	consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature,
	discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of &quot;de Finibus Bonorum
	et Malorum&quot; (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the
	theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, &quot;Lorem ipsum dolor
	sit amet..&quot;, comes from a line in section 1.10.32.
	&lt;/p&gt;
	&lt;/div&gt;&lt;!--end page_content--&gt;
&lt;/div&gt;&lt;!--end container--&gt;

&lt;div id=&quot;footer&quot;&gt;
&lt;p&gt;&amp;copy; 2010 to Webdevtuts. All rights reserved.&lt;/p&gt;
&lt;/div&gt;&lt;!--end footer--&gt;

&lt;/body&gt;

&lt;/html&gt;

<!--formatted--></code>
</pre>
<h2>The Css</h2>
<p>Ok now that we have the html taken care of its time to do the dirty work. It is now time to style our 3 column web layout. Before we begin styling have to go over something really fast. In a normal website layout many people use fixed layouts but for this tutorial I am using a fluid layout.</p>
<ul>
<li><b>Fixed:</b> &#8211; Layout is the same width and all browsers. Majority of websites use this method</li>
<li><b>Fluid:</b> &#8211; Layout re-sizes to users screen. Not many people use this method because it is hard styling for it but in the long<br />
run it&#8217;s well worth it</li>
</ul>
<p>Copy and Paste the code below into your stylesheet. I will explain each one below.</p>
<pre>
<code>
body {
	margin: 0;
	padding: 0;
}

#masthead {
	min-width: 600px;
	background:teal;
}

#logo {
	float: left;
	width: 200px;
	background:orange;
}

#header {
	margin-left:200px;
	background:olive;
}
</code>
</pre>
<ul>
<li><b>body</b> &#8211; Body class define the entire page seen on a screen. It has a margin, and padding of zero so all presets and others styles can also be set at 0.</li>
<li><b>masthead</b> &#8211; The masthead has a min-width of 600px which means it will never get smaller then 600px. Also it has no padding, borders, or margins.</li>
<li><b>logo</b> &#8211; Logo is floated to the left side of the page and has a width of 200px</li>
<li><b>Header</b> &#8211; Since we&#8217;re using a fluid layout we will not give the header a fixed width because we want it to re-size according to the users screen size. So we&#8217;ve added a margin to the left of 200px which gives us space from the left side of the page.</li>
<li><b></b></li>
</ul>
<p>Now we will style our container and everything inside of it. Copy the css below and add it to your stylesheet.</p>
<pre>
<code>

#container {
	clear: both;
	min-width: 600px;
}

#left_col {
	float: left;
	width: 200px;
	background:grey;
}

#right_col {
	float: right;
	width: 200px;
	background:grey;
}

#page_content {
	margin-left: 200px;
	margin-right: 200px;
	background:red;
}
</code>
</pre>
<ul>
<li><b>container</b> &#8211; Container id defines the container which holds all the content and both sidebars. I has a min-width of 600px which means it will not get any smaller than 600px. It also clears all floats to the left and right. Does not hold footer</li>
<li><b>Left_col</b> &#8211; The left column is floated to the left side of the page and has a width of 200px</li>
<li><b>right_col</b> &#8211; The right column is floated to the right side of the page and has a width of 200px</li>
<li><b>page_content</b> &#8211; Since we&#8217;re using a fluid layout we will not give the page content a fixed width because we want it to re-size according to the users screen size. So we&#8217;ve added a margin to the left and right of 200px which gives us space from the left and right side of the page.</li>
<li><b></b></li>
</ul>
<h2>The Footer</h2>
<p>The footer is the last part to are 3 column layout. Copy the code below into your stylesheet and I will explain it below. </p>
<pre>
<code>
#footer {
	clear: both;
	background:teal;
}
</code>
</pre>
<ul>
<li><b>footer</b> &#8211; The footer is at the bottom of the page and has no width nor height applied to it because it usually is just a line of text. It has a style of clear both which mean to clear both the left and right and then pushes the footer down to the bottom of the page.</li>
</ul>
<p>There you go. You should now have a 3 column layout that adjusts to all screen sizes. I hope this tutorial has helped you understand how to create a fluid 3 column layout. Thanks for following this tutorial. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdevtuts.net/coding/create-a-3-column-fluid-layout-using-htmlcss/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Understanding the fundamental of typography for the web: Part 1</title>
		<link>http://www.webdevtuts.net/articles/understanding-the-fundamental-of-typography-for-the-web-part-1/</link>
		<comments>http://www.webdevtuts.net/articles/understanding-the-fundamental-of-typography-for-the-web-part-1/#comments</comments>
		<pubDate>Wed, 05 May 2010 00:51:14 +0000</pubDate>
		<dc:creator>Marcell</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[line height]]></category>
		<category><![CDATA[part 1]]></category>
		<category><![CDATA[spacing]]></category>
		<category><![CDATA[typography]]></category>

		<guid isPermaLink="false">http://www.webdevtuts.net/?p=1139</guid>
		<description><![CDATA[Typography is a very hard thing to accomplish when designing or coding for the web. In this article I will hopefully give you a better understanding of how to use typography and how you can avoid clutters paragraphs and unaligned text.]]></description>
			<content:encoded><![CDATA[<p>Typography is a very hard thing to accomplish when designing or coding for the web. In this article I will hopefully give you a better understanding of how to use typography and how you can avoid clutters paragraphs and unaligned text.</p>
<h2>Mixing Fonts</h2>
<p>When I first begin designing and coding for the web I would always mix my typography. For example I would use a serif font(Georgia) with a sans-serif(Arial) font. If you are just starting off you might think that those fonts can be used together but they cannot. Serif fonts are different from sans-serif fonts. </p>
<p><img class="aligncenter" src="/wp-content/uploads/2010/05/font1.jpg"> </p>
<h3>What fonts can I mix?</h3>
<p>I bet you&#8217;re wondering what fonts you can use for your next design or web project. There are 3 main types of font categories</p>
<ul>
<li>serif</li>
<li>sans-serif</li>
<li>monospace</li>
</ul>
<p>Serif fonts are commonly used by publishing companies or if you have ever been to a news site or magazine site you will often find that they are using one of the serif fonts.<br />
<a href="http://ilovetypography.com/" target="_blank"><img class="aligncenter" src="/wp-content/uploads/2010/05/serif.jpg" alt="Serif" /></a></p>
<blockquote>
<h2>Serif</h2>
<ul>
<li style="font-family:Georgia, serif">Georgia</li>
<li style="font-family:Palatino Linotype, serif">Palatino Linotype</li>
<li style="font-family:Times New Roman, serif">Times New Roman</li>
<li style="font-family:Book Antiqua, serif">Book Antiqua</li>
</ul>
</blockquote>
<p>Sans-serif fonts are mostly used by all types of websites. I usually use San-serifs fonts for most of my projects.<br />
<a href="http://www.smashingmagazine.com/" target="_blank"><img class="aligncenter" src="/wp-content/uploads/2010/05/sans-serif.jpg" alt="Sans-serif" /></a></p>
<blockquote>
<h2>sans-serif</h2>
<ul>
<li style="font-family:Arial, sans-serif">Arial</li>
<li style="font-family:Helvetica, sans-serif">Helvetica</li>
<li style="font-family:Helvetica, sans-serif">Arial Black</li>
<li style="font-family:impact, sans-serif">Impact</li>
<li style="font-family:lucida sans unicode, sans-serif">Lucida Sans Unicode</li>
<li style="font-family:Lucida Grande, sans-serif">Lucida Grande</li>
<li style="font-family:Tahoma, sans-serif">Tahoma</li>
<li style="font-family:Veranda, sans-serif">Veranda</p>
</li>
<li style="font-family:Geneva, sans-serif">Geneva</li>
</ul>
</blockquote>
<p>Monospace fonts are not used as often as Serifs, and sans-serif fonts but they are used.</p>
<blockquote>
<h2>monospace</h2>
<ul>
<li style="font-family:Courier New, monospace">Courier New</li>
<li style="font-family:Lucida Console, monospace">Lucida Console</li>
<li style="font-family:Monaco, monospace">Monaco</li>
<li style="font-family:Courier, monospace">Courier</li>
</ul>
</blockquote>
<h2>Line height</h2>
<p><img class="alignleft" src="/wp-content/uploads/2010/05/lineheight.jpg" alt="line height" />Line height is very important when it comes to making your text look neat and clean. Often if you just leave a text as is then it will look cluttered, and tight. When I first began working with text I never really understood how to change the line height of a text and what it actually did. To give you a better understanding of line height I will give  some examples below so you could better understand what I am talking about.</p>
<p>There is no line-height below just the default text. So I applied 12px line height to the paragraph below and as you can see the text looks cluttered and not very attractive. </p>
<blockquote>
<h3>Arial Font(line-height) BAD</h3>
<p style="font-family:Arial, sans-serif; line-height:12px;">Marcell went to the skate park to train for an up and coming skate competition. He knew he had to practice considering there were many talented kids entering the contest.</p>
</blockquote>
<p>There is a line-height of 24px applied the paragraph below. </p>
<blockquote>
<h3>Arial Font(line-height) GOOD</h3>
<p style="font-family:Arial, sans-serif;">Marcell went to the skate park to train for an up and coming skate competition. He knew he had to practice considering there were many talented kids entering the contest.</p>
</blockquote>
<p>Think of the line height as the lines on a normal sheet of paper. If you were to write paragraphs but not on the lines then it wouldn&#8217;t look so good. Now let&#8217;s say you wrote on the lines(as you would usually do). If someone were to read your paper(Teacher) then they find it very easy to read.</p>
<h2>Letter Spacing</h2>
<p>Letter spacing is something that should not be overlooked. Many times when creating different types of paragraphs we might like to have some spacing in between words or letters. </p>
<p>There is no letter spacing in the paragraph below. </p>
<blockquote>
<h3>Arial Font(<small>spacing</small>) BAD</h3>
<p style="font-family:Arial, sans-serif;">Marcell went to the skate park to train for an up and coming skate competition. He knew he had to practice considering there were many talented kids entering the contest.</p>
</blockquote>
<p>There is a letter spacing of 1px in the paragraph below.</p>
<blockquote>
<h3>Arial Font(<small>spacing</small>) GOOD</h3>
<p style="font-family:Arial, sans-serif; letter-spacing:1px;">Marcell went to the skate park to train for an up and coming skate competition. He knew he had to practice considering there were many talented kids entering the contest.</p>
</blockquote>
<p>So as you can see typography is very important when coding for the web. I have covers just the basics in this article but will teach you more in the other series. If you have a question just leave a comment below and i will help you there. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdevtuts.net/articles/understanding-the-fundamental-of-typography-for-the-web-part-1/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Create a speaking block navigation menu using pure css</title>
		<link>http://www.webdevtuts.net/coding/css/create-a-speaking-block-navigation-menu-using-pure-css/</link>
		<comments>http://www.webdevtuts.net/coding/css/create-a-speaking-block-navigation-menu-using-pure-css/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 03:58:21 +0000</pubDate>
		<dc:creator>Marcell</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[navigation]]></category>

		<guid isPermaLink="false">http://www.webdevtuts.net/?p=1053</guid>
		<description><![CDATA[Many people have been emailing me or asking me how I have created the Webdevtuts navigation menu. Well today I decided I was going to write a tutorial to show you guys how...]]></description>
			<content:encoded><![CDATA[<p>Many people have been emailing me or asking me how I have created the Webdevtuts navigation menu. Well today I decided I was going to write a tutorial to show you guys how I manage to create a &#8220;speaking&#8221; block navigation menu using just css. A navigation menu&#8217;s like Webdevtuts are using done using css sprites but we&#8217;re going to accomplish this a new way today. Hopefully you can use this technique for your next project. enjoy</p>
<h1 align="center"><a href="http://www.demo.webdevtuts.net/Talking%20Navigation%20Menu%28Webdevtuts%29/" target="_blank">DEMO</a></h1>
<p>Before we begin this tutorial it would be best if you create a New folder and inside of the new folder create a <b>index.html</b> file and a <b>style.css</b> file.</p>
<h2>The Markup Lanuage/HTML</h2>
<p>Open up your text editor </p>
<p><b>Note:</b>Before you write HTML it is always good to have the basic HTML tags already written. Place the basic HTML tags below into your <b>index.html</b> file.</p>
<pre>
<code>
&lt;!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;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;

&lt;head&gt;
&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot; /&gt;
&lt;title&gt;Webdevtuts(Speaking Navigation Menu)&lt;/title&gt;
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;style.css&quot;/&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;/body&gt;

&lt;/html&gt;
<!--formatted--></code>
</pre>
<p>Now we&#8217;re going to start writing the markup for our navigation menu. Let&#8217;s create our nav menu outline. I&#8217;ll explain each div later in this tutorial when we start writing the css. Copy the code below into your <b>index.html</b> file inside of the body tags.</p>
<pre>
<code>
&lt;div id=&quot;menu&quot;&gt;
	&lt;div id=&quot;menu-wrap&quot;&gt;
		&lt;ul id=&quot;navigation-main&quot;&gt;
		&lt;/ul&gt;&lt;!--end navigation-main--&gt;
	&lt;/div&gt;&lt;!--end menu-wrap--&gt;
&lt;/div&gt;&lt;!--end menu--&gt;
<!--formatted--></code>
</pre>
<p>Now were going to add our menu links. Ok you might get confuse with the markup below but do not worry I will explain it. Ok so we first had just our nav outline then we added are lists(li) which holds are navigation links. Inside of the list items are span tags which hold are so call tags for that specific link. For example Home is a list and inside of the home list we have the href tags which is use to link an item. Outside of the href tag are span tags with an assign class that we will later edit using css. Inside of the span tags are little description tags that I&#8217;ve added.<br />
,</p>
<pre>
<code>
&lt;div id=&quot;menu&quot;&gt;
	&lt;div id=&quot;menu-wrap&quot;&gt;
		&lt;ul id=&quot;navigation-main&quot;&gt;
			&lt;li&gt;&lt;a href=&quot;&quot;&gt;Home&lt;/a&gt;&lt;span class=&quot;nav-sec&quot;&gt;The Beginning&lt;/span&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;&quot;&gt;Articles&lt;/a&gt;&lt;span class=&quot;nav-sec&quot;&gt;Tips, Tricks, Advice&lt;/span&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;&quot;&gt;Tutorials&lt;/a&gt;&lt;span class=&quot;nav-sec&quot;&gt;Photoshop Techniques&lt;/span&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;&quot;&gt;Resources&lt;/a&gt;&lt;span class=&quot;nav-sec&quot;&gt;Fonts, freebies, wallpapers&lt;/span&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;&quot;&gt;Anything&lt;/a&gt;&lt;span class=&quot;nav-sec&quot;&gt;Description&lt;/span&gt;
			&lt;li&gt;&lt;a href=&quot;&quot;&gt;Anything&lt;/a&gt;&lt;span class=&quot;nav-sec&quot;&gt;Description&lt;/span&gt;
		&lt;/ul&gt;&lt;!--end navigation-menu--&gt;
	&lt;/div&gt;&lt;!--end menu-wrap--&gt;
&lt;/div&gt;&lt;!--end menu--&gt;
<!--formatted--></code>
</pre>
<h2>The Css</h2>
<p>Ok so now we&#8217;re going to style our navigation menu using css. </p>
<p><b>Note:</b> Before css is inserted, insert Eric Meyers css reset. Work good with this nav tutorial. </p>
<pre>
<code>
#menu{
	background:#000;
	height:75px;
}

#menu-wrap {
	margin:0 auto;
	width:960px;
}

#navigation-main {
	padding:15px;
	color:#fff;
	font-size:24px;
	font-weight:bold;
	margin-bottom:10px;
	float:left;
}

#navigation-main li {
	float:left;
	margin-right:20px;
}

#navigation-main li a {
	display:block;
	color:#fff;
}

#navigation-main li ul  {
	display:none;
	z-index:80;
}

#top-nav-info {
	background:#dddddd;
	float:left;
	width:1000px;
}

#top-nav-sec li a {
	padding:15px;
	display:inline;
	height:42px;
	color:#a19f9f;
}

#top-nav-sec li a:hover {
	color:#1F1E1E;
}

.nav-sec {
	display:block;
	font-size:12px;
	font-family: lucida sans unicode;
	font-weight:normal;
	text-align:center;
}
</code>
</pre>
<p>You should now have a speaking block navigation menu using pure css. I did not explain it much because I know many people do not want to read a very long sententce and the best way to earn is to experiment with things. Mess around with the code and you will be fine. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdevtuts.net/coding/css/create-a-speaking-block-navigation-menu-using-pure-css/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Create a awsesome images gallery using css3 and jquery</title>
		<link>http://www.webdevtuts.net/coding/css/create-a-awsesome-images-gallery-using-css3-and-jquery/</link>
		<comments>http://www.webdevtuts.net/coding/css/create-a-awsesome-images-gallery-using-css3-and-jquery/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 03:25:49 +0000</pubDate>
		<dc:creator>Marcell</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.webdevtuts.net/?p=809</guid>
		<description><![CDATA[Today we will be creating a very simple but great looking css3 image gallery using jquery and css3. If you're a beginner, GREAT! Follow this tutorial and you will have no problem adding jquery plugins to your website]]></description>
			<content:encoded><![CDATA[<p>Today we will be creating a very simple but great looking css3 image gallery using jquery and css3. The image gallery will be tited to the side and on hover will move. Whenever you click on the image a lightbox will pop out. So lets begin.</p>
<p><a href="http://www.demo.webdevtuts.net/css3-jquery/"/>Demo</a></p>
<h2>Folder Structure</h2>
<p>In the folder of your for your image gallery you should have 3 folders and 2 files. </p>
<ul>
<li><strong>Css</strong> -Contains the jquery css </li>
<li><strong>Images</strong> &#8211; Contains images</li>
<li><strong>Js</strong> &#8211; Contains the javascript</li>
<li>index.html</li>
<li>style</li>
</ul>
<p><img class="aligncenter" src="http://www.webdevtuts.net/wp-content/uploads/2010/01/files.jpg" alt="file structure"/></p>
<h2>The HTML Structure</h2>
<p>For the image gallery I simply wrapped the gallery in a div and added the images. Every 4 image has two different classed assigned to them. For example the first 4 images has a class name of thumb-small and for the other 4 images they have a class name of thumb-bottom. </p>
<pre>
<div id="gallery">
<code>&lt;a href=&quot;images/skate1.jpg&quot; title=&quot;You can write anything in here&quot;&gt;&lt;img class=&quot;thumb-top&quot; src=&quot;images/skate1.jpg&quot; alt=&quot;skateboarder&quot; title=&quot;skateboarder&quot;/&gt;&lt;/a&gt;
&lt;a href=&quot;images/skate1.jpg&quot; title=&quot;You can write anything in here&quot;&gt;&lt;img class=&quot;thumb-top&quot; src=&quot;images/skate1.jpg&quot; alt=&quot;skateboarder&quot; title=&quot;skateboarder&quot;/&gt;&lt;/a&gt;
&lt;a href=&quot;images/skate1.jpg&quot; title=&quot;You can write anything in here&quot;&gt;&lt;img class=&quot;thumb-top&quot; src=&quot;images/skate1.jpg&quot; alt=&quot;skateboarder&quot; title=&quot;skateboarder&quot;/&gt;&lt;/a&gt;
&lt;a href=&quot;images/skate1.jpg&quot; title=&quot;You can write anything in here&quot;&gt;&lt;img class=&quot;thumb-top&quot; src=&quot;images/skate1.jpg&quot; alt=&quot;skateboarder&quot; title=&quot;skateboarder&quot;/&gt;&lt;/a&gt;
&lt;a href=&quot;images/skate1.jpg&quot; title=&quot;You can write anything in here&quot;&gt;&lt;img class=&quot;thumb-bottom&quot; src=&quot;images/skate1.jpg&quot; alt=&quot;skateboarder&quot; title=&quot;skateboarder&quot;/&gt;&lt;/a&gt;
&lt;a href=&quot;images/skate1.jpg&quot; title=&quot;You can write anything in here&quot;&gt;&lt;img class=&quot;thumb-bottom&quot; src=&quot;images/skate1.jpg&quot; alt=&quot;skateboarder&quot; title=&quot;skateboarder&quot;/&gt;&lt;/a&gt;
&lt;a href=&quot;images/skate1.jpg&quot; title=&quot;You can write anything in here&quot;&gt;&lt;img class=&quot;thumb-bottom&quot; src=&quot;images/skate1.jpg&quot; alt=&quot;skateboarder&quot; title=&quot;skateboarder&quot;/&gt;&lt;/a&gt;
&lt;a href=&quot;images/skate1.jpg&quot; title=&quot;You can write anything in here&quot;&gt;&lt;img class=&quot;thumb-bottom&quot; src=&quot;images/skate1.jpg&quot; alt=&quot;skateboarder&quot; title=&quot;skateboarder&quot;/&gt;&lt;/a&gt;<!--formatted--></code>
</div>

<!--end gallery-->
</pre>
<h2>The Css</h2>
<p>For the Css you might wonder what -webkit, and -moz-transform is. Webkit is a Css3 tag that targets the safari web browser and moz-transform is a Css3 tag that targets the Mozilla Firefox web browser. In the css </p>
<ol>
<li><strong>-webkit-transform:</strong> &#8211; Used to rotate the images</li>
<li><strong>-webkit-transition:</strong> &#8211; Used to zoom/ease in on the images</li>
</ol>
<pre>
.thumb-top{
	clear:none;
	padding:10px 10px 30px 10px;
	height:200px;
	width:200px;
	background:#fff;
	-moz-transform:rotate(-4deg);
	-webkit-transform:rotate(-4deg);
	-webkit-transition: -webkit-transform 0.1s ease-in; /* Tells webkit to make a transition of a transform */
	border:1px solid #ececec; /* This border merges with the colour of the shadow in supporting browsers
	but in non-supporting browsers the border acts as the edge of the image */
	margin-bottom:25px;
}

.thumb-bottom{
	clear:none;
	padding:10px 10px 30px 10px;
	height:200px;
	width:200px;
	background:#fff;
	-moz-transform:rotate(-4deg);
	-webkit-transform:rotate(-4deg);
	-webkit-transition: -webkit-transform 0.1s ease-in; /* Tells webkit to make a transition of a transform */
	border:1px solid #ececec; /* This border merges with the colour of the shadow in supporting browsers
	but in non-supporting browsers the border acts as the edge of the image */
	margin-bottom:25px;
}

.thumb-top:hover{
	z-index:100;
	position:relative; /* Make the z-index work in Safari */
	-moz-transform:rotate(-8deg) scale(1.2);
	-webkit-transform:rotate(-8deg) scale(1.2);
}

.thumb-bottom:hover{
	z-index:100;
	position:relative; /* Make the z-index work in Safari */
	-moz-transform:rotate(4deg) scale(1.2);
	-webkit-transform:rotate(4deg) scale(1.2);
}

#gallery {
	margin-top:20px;
}
</pre>
<h2>Inserting and activating jquery plugins</h2>
<p>First things first when activating a jquery plugin is to simply make sure we call in the jquery script. Insert the code below into the head section of your document. The code below calls in jquery, then the two jquery plugins, and finally the plugin Css. </p>
<pre>
<code>&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;css/jquery.lightbox-0.5.css&quot; media=&quot;screen&quot; /&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery.lightbox-0.5.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery-1.3.2.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery.lightbox-0.5.js&quot;&gt;&lt;/script&gt;<!--formatted--></code>
</pre>
<p>Now we want to add the script below to the body of our HTML document right before the end of the body tag.</p>
<pre>
<code>&lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function(){
$(&quot;.thumb-top,.thumb-bottom&quot;).fadeTo(&quot;slow&quot;, 0.3);
$(&quot;.thumb-top,.thumb-bottom&quot;).hover(function(){
$(this).fadeTo(&quot;slow&quot;, 1.0);
},function(){
$(this).fadeTo(&quot;slow&quot;, 0.3);
});
});

$(function() {
    $(&#039;#gallery a&#039;).lightBox();
});
&lt;/script&gt;<!--formatted--></code>
</pre>
<p>For the code below I will try to explain it the best way I can so you can better understand it. I know not everyone is good with inserting Javascript plugins or changing functions. </p>
<p>The first function inside of the script tag targets the light box plugin. The light box plugin is when you click on an image and the image enlarges without being taken to the direct image location.</p>
<p> For this <b>$(&#8220;.thumb-top,.thumb-bottom&#8221;).fadeTo(&#8220;slow&#8221;, 0.3);</b>  function it just tells jquery to fade to anything with the class of thumb-top or thumb-bottom. So whenever your mouse is not on the image it will be darken.<br />
<img class="aligncenter" src="http://www.webdevtuts.net/wp-content/uploads/2010/01/dark.jpg" alt="dark"/> </p>
<p>For this <b>$(&#8220;.thumb-top,.thumb-bottom&#8221;).hover(function(){</b> function it just tells you on hover, or whenever you move over the image with your mouse that it will highlight the image.<br />
<img class="aligncenter" src="http://www.webdevtuts.net/wp-content/uploads/2010/01/highlight.jpg" alt="highlight"/></p>
<p>For the <b>$(&#8216;#gallery a&#8217;).lightBox();</b> function it just asks you what id tag would you like for it to bring up whenever you click on something with the tag of a href. For example I have the images wrapped inside of the id gallery and every image has an a href assign to it so whenever you click on it jquery knows when to call for the second lightbox function.<br />
<img class="aligncenter" src="http://www.webdevtuts.net/wp-content/uploads/2010/01/popout.jpg" alt="pop out"/><br />
<b>Note:</b> Rotation does not work in Internet explorer browsers do to lack of support of Css3. </p>
<p>After that you should now have your very own css3/jquery image gallery. I am no jquery expert but I try to help you guys understand it and a easy way instead of using words that you guys are not familiar with. </p>
<h3>Credit</h3>
<p>Credit goes to <a class="block" href="http://csswizardry.com/css3/" target="_blank">Csswizardry</a> for the css3 image gallery.<br />
Credit goes to <a class="block" href="http://leandrovieira.com/projects/jquery/lightbox/" target_blank>Leandrovieira</a> for the lightbox plugin. </p>
<p><a title="Downloaded {title} times" href="http://www.webdevtuts.net/wp-content/uploads/2009/07/downloads/css3-jquery.rar"><img src="http://webdevtuts.net/wp-content/uploads/2009/post/download_btn.gif" alt="Download" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdevtuts.net/coding/css/create-a-awsesome-images-gallery-using-css3-and-jquery/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Highlight Current Page in an HTML Document Using Css</title>
		<link>http://www.webdevtuts.net/coding/css/highlight-current-page-in-an-html-document-using-css/</link>
		<comments>http://www.webdevtuts.net/coding/css/highlight-current-page-in-an-html-document-using-css/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 00:01:57 +0000</pubDate>
		<dc:creator>Marcell</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[current]]></category>
		<category><![CDATA[highlight]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.webdevtuts.net/?p=735</guid>
		<description><![CDATA[When designing a web page using HTML/CSS you might have notice that you cannot have an active page just by creating a new index file.]]></description>
			<content:encoded><![CDATA[<p>When designing a web page using HTML/CSS you might have notice that you cannot have an active page just by creating a new index file. In this tutorial I will teach you the simple steps to creating an active CSS state. Open your favorite WYSIWYG (Dreamweaver, coda, notepad++) editor. </p>
<h3 align="center"><a href="http://www.demo.webdevtuts.net/cssactive/" target="_blank">Click here for Demo</a></h3>
<p>Getting an active state when using css can be very frustrating if you&#8217;re not that familiar with css. Many developers that are new to css often think it is the end of the world when really the active state can be accomplish with very little code. </p>
<h2>The Body</h2>
<p>The body is of the most important roles when you&#8217;re trying to create an active page using css. The reason the body tag is very important because when its time to define what page the user is on the body tag will keep that page active. You&#8217;re probably thinking that just body tag can complete that and truth is it can but with a little bit of help from an id or class tag. to give the body a id or class name you would simply do the following.</p>
<pre>
body id="home"
or
body class="home"
</pre>
<p>Everytime you create a new index page make sure you change the body class or id name and you will later know why.</p>
<h2>The HTML</h2>
<p>For the HTML I created/ a basic navigation menu with and unique id name.  Notice every link such as home, about, etc all have different id names. The reason they all have different id names is so we can identify that certain linktag in the css file. </p>
<pre>
&lt;div id=&quot;menu-nav&quot;&gt;
	&lt;ul&gt;
		&lt;li id=&quot;home&quot;&gt;&lt;a href=&quot;index.html&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
		&lt;li id=&quot;about&quot;&gt;&lt;a href=&quot;about.html&quot;&gt;About&lt;/a&gt;&lt;/li&gt;
		&lt;li id=&quot;team&quot;&gt;&lt;a href=&quot;team.html&quot;&gt;Team&lt;/a&gt;&lt;/li&gt;
		&lt;li id=&quot;video&quot;&gt;&lt;a href=&quot;video.html&quot;&gt;Video&lt;/a&gt;&lt;/li&gt;
		&lt;li id=&quot;contact&quot;&gt;&lt;a href=&quot;contact.html&quot;&gt;Contact&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
&lt;/div&gt;&lt;!--end menu-nav--&gt;
</pre>
<h2>The CSS</h2>
<p>Ok so you now have and idea of how the menu has to be laid out using html. Now its time to define each id element from the html. If you look at the code below<br />
you will notice that every css tag has the body id, followed by the menu id with the a(active) tag and finished with the css properties. Take a look at css and compare it to the html. </p>
<pre>
body#home #home a,
body#about #about a,
body#team #team a,
body#video #video a,
body#contact #contact a{
	padding:10px;
	background:#FF0000;
	margin-right:5px;
	color:#FFFF00;
	text-decoration:none;
}
</pre>
<p>This was not a tutorial but I truly hope it helped you guys out. I know many people face this problem quite often and do not know what to do. It was a simple, fast, and sweet technique.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdevtuts.net/coding/css/highlight-current-page-in-an-html-document-using-css/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CSS Sprites: How they work, and how to use them.</title>
		<link>http://www.webdevtuts.net/coding/css/css-sprites-how-they-work-and-how-to-use-them/</link>
		<comments>http://www.webdevtuts.net/coding/css/css-sprites-how-they-work-and-how-to-use-them/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 04:43:25 +0000</pubDate>
		<dc:creator>Daan Weijers</dc:creator>
				<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.webdevtuts.net/?p=189</guid>
		<description><![CDATA[This tutorial is on css sprites. You have probably heard about them before, and you may also have tried to make them, but for many people still, css sprites are a tricky part of developing, and therefore this is often skipped.]]></description>
			<content:encoded><![CDATA[<p>This tutorial is on css sprites. You have probably heard about them before, and you may also have tried to make them, but for many people still, css sprites are a tricky part of developing, and therefore this is often skipped.</p>
<h3>So What Are They Exactly? And Why Should I Use Them?</h3>
<p>A sprite is another word for one image file, that houses numerous other images.<br />
So, instead of using for example 4 files for a few images, you can place them alltogether in one file, and fat fact comes with a few nice advantages:</p>
<ul>
<li>one bigger file takes up less harddrive/server space than for example 4 little ones.</li>
<li>a visitor&#8217;s browser visiting your site only needs to download 1 file, instead of 4. This will speed up the loading time of your website drasticly.</li>
<li>because one image is transfered instead of 4, you save precious bandwidth.</li>
</ul>
<h3>How To Make a Sprite</h3>
<p>As I said before, a sprite is an image file that houses more images. Therefore, the only thing you need to do to make a sprite, is to collect a few alike images, and then put them together in one image.<br />
A great example of how a sprite is made can be found on Apple&#8217;s website.<br />
It may not look that way, but for the navigation on the Apple site, only one image is used.. A sprite.</p>
<p><a href="http://www.webdevtuts.net/wp-content/uploads/2009/08/applesprite.png"><img class="aligncenter size-full wp-image-266" src="http://www.webdevtuts.net/wp-content/uploads/2009/08/applesprite2.png" alt="applesprite2" width="600" height="100" /></a></p>
<p>This is a great example of how sprites can be and are used in modern day webdevelopment, and it is exactly how you make a good sprite.</p>
<p>For this tutorial, I&#8217;ve prepared a few images. Their respective files can be found here , and now I want you to combine these images into one, and end up with an image that is alike to the following one.</p>
<p><img class="aligncenter size-full wp-image-267" src="http://www.webdevtuts.net/wp-content/uploads/2009/08/sprite.png" alt="sprite" width="300" height="120" /></p>
<p>That file can also be found in the zip file you can download below.</p>
<h3>Our Basic Markup</h3>
<p>To make our tutorial example look a little bit nicer than usual, I prepared the basic HTML for the tutorial.</p>
<p>[sourcecode language='css']</p>
<div id='wrap' >
<div id='nav' >
<ul id='navigation_list'>
<li><a href='#' id='link1' title='home'>Home</a></li>
<li><a href='#' id='link2' title='about'>About</a></li>
<li><a href='#' id='link3' title='contact'>Contact</a></li>
</ul></div>
<div id='main' >
<h1>Lipsum</h1>
<p>Lorum ipsum dolor sit amet, conseqtuer disciplin cit. Amor iludi brium dos no. Consectetuer dos avre dit.</p>
</p></div>
</div>
<p>[/sourcecode]</p>
<p>As you can see, we have created a navigation element, which is nested in the &#8220;wrap&#8221; div, and below that is a &#8220;main&#8221; element, which can be used to hold some content.<br />
To make this basic setup look nice, I prepared a little css as well. Don&#8217;t worry, we won&#8217;t get into the real deal yet.</p>
<p>- Tekst uit oorspronkelijke bericht weergeven -
</pre>
<p>You can place this css in a &lt;style&gt; tag in the head of your html code.</p>
<p>If you refresh your page with this markup, you'll see that there are 3 links above a big, white main piece with some content.</p>
<h3>The Tricky Parts</h3>
<p>As you may have already guessed, we need to make these regular links disappear, and replace them with the sprite.</p>
<p>[sourcecode language='css']<br />
#navigation_list li { display: inline; }<br />
#navigation_list li a {<br />
 width: 100px;<br />
 height: 40px;<br />
 float: left;<br />
 background-image: url('sprite.png');<br />
 text-indent: -10000px;<br />
}<br />
[/sourcecode]</p>
<p>If you add that to your css, you can see that our text disappears behind our background images, which are generically set to the same image; the sprite.</p>
<p>There is one problem occurring though; all links have the same image. We need to solve this -and this is where the tricky part comes in- with the css property "background-position".<br />
This means that, for each of our links (and their corresponding ID's) we need to create a few lines of special code, that changes the position of the background.<br />
The tricky part of the backgroud position is, that even you want to move the "view" to the right and/or below, you need to put in negative values. This is not a too hard trick, but many people still forget it, and therefore stop trying when developing with sprites.</p>
<p>[sourcecode language='css']<br />
a#link1 {<br />
 background-position: 0px 0px;<br />
}<br />
a#link2 {<br />
 background-position: -100px 0px;<br />
}<br />
a#link3 {<br />
 background-position: -200px 0px;<br />
}<br />
[/sourcecode]</p>
<p>As you can see, we applied our negative values in the background-position property on each of our links. If you refresh now, you'll see that every link has its own image now.</p>
<h3>Pseudo Classes</h3>
<p>Pseudo classes! These are the kindof classes that bring along a condition. When this element is hovered, <strong>do this</strong>. When this link is visited, <strong>do that</strong>. And so on.<br />
In order to apply our hovered status to our tabbed links, we will need to apply a pseudo class, and we do it like this:</p>
<p>[sourcecode language='css']<br />
a#link1:hover {}<br />
[/sourcecode]</p>
<p>As you can see, we have simply added some extra characters, but now whén you hover over, it will style the link in a different way than it would normally.</p>
<p>[sourcecode language='css']<br />
a#link1:hover {<br />
 background-position: 0px -40px;<br />
}<br />
a#link2:hover {<br />
 background-position: -100px -40px;<br />
}<br />
a#link3:hover {<br />
 background-position: -200px -40px;<br />
}<br />
[/sourcecode]</p>
<p>If you add this to your css, refresh your page, and hover over a tab, you'll see that the tab "moves" upward a little, and moves back when the cursor is gone.</p>
<h3>Active Tabs</h3>
<p>The last thing we need to do is to create an active tab. This is not able with a pseudo class, so we will just create our own class, that you need to add to the active link. Again we will need to create a seperate piece of code for each link.</p>
<p>[sourcecode language='css']<br />
a#link1.active {<br />
 background-position: 0px -80px;<br />
}<br />
a#link2.active {<br />
 background-position: -100px -80px;<br />
}<br />
a#link3.active {<br />
 background-position: -200px -80px;<br />
}<br />
[/sourcecode]</p>
<p>If you put that piece if code into your last bits of css, and edit your HTML in such way, that one tab has a class of active, we are done with the markup!</p>
<h3>Conclusion</h3>
<p>This also means the tutorial has come to an end. I hope I have taught you a way to use images in navigation, in a SEO friendly and quick way. And afterall, the trick wasn't that hard.. Was it?</p>
<p><a title="Downloaded {title} times" href="http://www.webdevtuts.net/wp-content/uploads/2009/08/sprites.zip"><img src="http://webdevtuts.net/wp-content/uploads/2009/post/download_btn.gif" alt="title" /></a></p>
<p>Cheers,<br />
Daan</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdevtuts.net/coding/css/css-sprites-how-they-work-and-how-to-use-them/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
