<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Web Tutorials</title>
	<atom:link href="http://tutodz.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://tutodz.wordpress.com</link>
	<description>tutorials for web</description>
	<lastBuildDate>Wed, 30 Dec 2009 20:52:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='tutodz.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Web Tutorials</title>
		<link>http://tutodz.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://tutodz.wordpress.com/osd.xml" title="Web Tutorials" />
	<atom:link rel='hub' href='http://tutodz.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Mastering CSS Coding: Getting Started</title>
		<link>http://tutodz.wordpress.com/2009/12/30/mastering-css-coding-getting-started/</link>
		<comments>http://tutodz.wordpress.com/2009/12/30/mastering-css-coding-getting-started/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 20:49:28 +0000</pubDate>
		<dc:creator>tutodz</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[css tutorials]]></category>
		<category><![CDATA[Mastering CSS]]></category>

		<guid isPermaLink="false">http://tutodz.wordpress.com/?p=10</guid>
		<description><![CDATA[CSS has become the standard for building websites in today’s industry. Whether you are a hardcore developer or designer, you should be familiar with it. CSS is the bridge between programming and design, and any Web professional must have some general knowledge of it. If you are getting your feet wet with CSS, this is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tutodz.wordpress.com&amp;blog=10383833&amp;post=10&amp;subd=tutodz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>CSS has become the standard for building websites in today’s industry. Whether you are a hardcore developer or designer, you should be familiar with it. CSS is the bridge between programming and design, and any Web professional must have some general knowledge of it. If you are getting your feet wet with CSS, this is the perfect time to fire up your favorite text editor and follow along in this tutorial as we cover the most common and practical uses of CSS.</p>
<h4>Overview: What We Will Cover Today</h4>
<p>We’ll start with what you could call the <strong>fundamental</strong> properties and capabilities of CSS, ones that we commonly use to build CSS-based websites:</p>
<ol>
<li><a href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#CSS-Basics1">Padding vs. margin</a></li>
<li><a href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#CSS-Basics2">Floats</a></li>
<li><a href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#CSS-Basics3">Center alignment</a></li>
<li><a href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#CSS-Basics4">Ordered vs. unordered lists</a></li>
<li><a href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#CSS-Basics5">Styling headings</a></li>
<li><a href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#CSS-Basics6">Overflow</a></li>
<li><a href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#CSS-Basics7">Position</a></li>
</ol>
<p>Once you are comfortable with the basics, we will kick it up a notch with some neat tricks to build your CSS website from scratch and make some <strong>enhancements</strong> to it.</p>
<ol>
<li><a href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#CSS-Basics8">Background images</a></li>
<li><a href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#CSS-Basics9">Image enhancement</a></li>
<li><a href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#CSS-Basics10">PSD to XHTML</a></li>
</ol>
<h3 id="CSS-Basics1">1. Padding vs. Margin</h3>
<p>Most beginners get <a href="http://www.w3schools.com/css/css_padding.asp">padding</a> and <a href="http://www.w3schools.com/CSS/css_margin.asp">margins</a> mixed up and use them incorrectly. Practices such as using the <code>height</code> to create padding or margins also lead to bugs and inconsistencies. Understanding padding and margins is fundamental to using CSS.</p>
<h4>What Is Padding and Margin?</h4>
<p>Padding is the <strong>inner</strong> space of an element, and margin is the <strong>outer</strong> space of an element.</p>
<p>The difference becomes clear once you apply backgrounds and borders to an element. Unlike padding, margins are not covered by either the background or border because they are the space outside of the actual element.</p>
<p>Take a look at the visual below:</p>
<p><img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/1_a.gif" alt="1 A in Mastering CSS Coding: Getting Started" /></p>
<p><img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/1_c.gif" alt="1 C in Mastering CSS Coding: Getting Started" /><br />
<em>Margin and padding values are set clockwise, starting from the top.</em></p>
<p><strong>Practical example</strong>: Here is an <code>&lt;h2&gt;</code> heading between two paragraphs. As you can see, the margin creates white space between the paragraphs, and the padding (where you see the background gray color) gives it some breathing room.</p>
<p><img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/1_b.gif" alt="1 B in Mastering CSS Coding: Getting Started" /></p>
<h4>Margin and Padding Values</h4>
<p>In the above example of the heading, the values for the margin and padding would be:</p>
<div id="highlighter_31494">
<div>
<div><a title="view source" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#viewSource">view source</a></p>
<p><a title="print" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#printSource">print</a><a title="?" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#about">?</a></p>
</div>
</div>
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>margin</code><code>: </code><code>15px</code> <code>0</code> <code>15px</code> <code>0</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>padding</code><code>: </code><code>15px</code> <code>15px</code> <code>15px</code> <code>15px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>To optimize this line of code further, we use an optimization technique called “<a href="http://www.smashingmagazine.com/2008/08/18/7-principles-of-clean-and-optimized-css-code/">shorthand</a>,” which cuts down on repetitive code. Applying the shorthand technique would slim the code down to this:</p>
<div id="highlighter_792660">
<div>
<div><a title="view source" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#viewSource">view source</a></p>
<p><a title="print" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#printSource">print</a><a title="?" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#about">?</a></p>
</div>
</div>
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>margin</code><code>: </code><code>15px</code> <code>0</code><code>; </code><code>/*--top and bottom = 15px | right and left = 0 --*/</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>padding</code><code>: </code><code>15px</code><code>; </code><code>/*--top, right, bottom and left = 15px --*/</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>Here is what the <strong>complete CSS</strong> would look like for this heading:</p>
<div id="highlighter_25405">
<div>
<div><a title="view source" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#viewSource">view source</a></p>
<p><a title="print" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#printSource">print</a><a title="?" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#about">?</a></p>
</div>
</div>
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>h</code><code>2</code> <code>{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>background</code><code>: </code><code>#f0f0f0</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>border</code><code>: </code><code>1px</code> <code>solid</code> <code>#ddd</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>margin</code><code>: </code><code>15px</code> <code>0</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>5</code></td>
<td><code>padding</code><code>: </code><code>15px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>6</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<h4>Quick Tip</h4>
<p>Keep in mind that padding <strong>adds to the total width</strong> of your element. For example, if you had specified that the element should be 100 pixels wide, and you had a left and right padding of 10 pixels, then you would end up with 120 pixels in total.</p>
<p>100px (content) + 10px (left padding) + 10px (right padding) = 120px (total width of element)</p>
<p>Margin, however, expands the box model but does not directly affect the element itself. This tip is especially handy when lining up columns in a layout!</p>
<p>Additional resources:</p>
<ul>
<li><a href="http://www.w3.org/TR/CSS2/box.html">Box Model</a></li>
<li><a href="http://htmldog.com/guides/cssbeginner/margins/">Margins and Padding</a></li>
<li><a href="http://www.smashingmagazine.com/2009/07/27/the-definitive-guide-to-using-negative-margins/">The Definitive Guide to Using Negative Margins</a></li>
<li><a href="http://www.dustindiaz.com/css-shorthand/">CSS Shorthand Guide</a></li>
<li><a href="http://www.tizag.com/cssT/margin.php">CSS Margin</a></li>
<li><a href="http://www.tizag.com/cssT/padding.php">CSS Padding</a></li>
</ul>
<h3 id="CSS-Basics2">2. Floats</h3>
<p>Floats are a fundamental element in building CSS-based websites and can be used to align images and build layouts and columns. If you recall how to align elements left and right in HTML, floating works in a similar way.</p>
<p>According to <a href="http://htmldog.com/reference/cssproperties/float/">HTML Dog</a>, the <code>float</code> property “specifies whether a fixed-width box should float, shifting it to the right or left, with surrounding content flowing around it.”</p>
<p><img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/2_a.jpg" alt="2 A in Mastering CSS Coding: Getting Started" /></p>
<p>The <code>float: left</code> value aligns elements to the left and can also be used as a solid container to create layouts and columns. Let’s look at a practical situation in which you can use <code>float: left</code>.</p>
<p><img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/2_b.jpg" alt="2 B in Mastering CSS Coding: Getting Started" /></p>
<p>The <code>float: right</code> value aligns elements to the right, with surrounding elements flowing to the left.</p>
<p><strong>Quick tip:</strong> Because block elements typically span 100% of their parent container’s width, floating an element <strong>to the right</strong> knocks it down to the next line. This also applies to plain text that runs next to it because the floated element cannot squeeze in the same line.</p>
<p><img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/2_c.gif" alt="2 C in Mastering CSS Coding: Getting Started" /></p>
<p>You can correct this issue in one of two ways:</p>
<ol>
<li><strong>Reverse the order of the HTML markup</strong> so that you call the floated element first, and the neighboring element second.<br />
<img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/2_c1.gif" alt="2 C1 in Mastering CSS Coding: Getting Started" /></li>
<li><strong>Specify an exact width for the neighboring element</strong> so that when the two elements sit side by side, their combined width is less than or equal to the width of their parent container.<br />
<img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/2_c2.gif" alt="2 C2 in Mastering CSS Coding: Getting Started" /></li>
</ol>
<p>Internet Explorer 6 (IE6) has been known to <strong>double</strong> a floated element’s margin. So, what you originally specified as a 5-pixel margin becomes 10 pixels in IE6.</p>
<p><img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/10/upd_2_d.gif" alt="Upd 2 D in Mastering CSS Coding: Getting Started" /></p>
<p>A simple trick to get around this bug is to add <code>display: inline</code> to your floated element, like so:</p>
<div id="highlighter_240572">
<div>
<div><a title="view source" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#viewSource">view source</a></p>
<p><a title="print" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#printSource">print</a><a title="?" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#about">?</a></p>
</div>
</div>
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>.floated_element {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>float</code><code>: </code><code>left</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>width</code><code>: </code><code>200px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>margin</code><code>: </code><code>5px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>5</code></td>
<td><code>display</code><code>: </code><code>inline</code><code>; </code><code>/*--IE6 workaround--*/</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>6</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>Additional resources:</p>
<ul>
<li><a href="http://css.maxdesign.com.au/floatutorial/">Floatutorial</a></li>
<li><a href="http://www.quirksmode.org/css/clearing.html">Clearing Floats</a></li>
<li><a href="http://www.smashingmagazine.com/2007/05/01/css-float-theory-things-you-should-know/">CSS Float Theory: Things You Should Know</a></li>
<li><a href="http://css-tricks.com/all-about-floats/">CSS-Tricks: All About Floats</a></li>
<li><a href="http://www.complexspiral.com/publications/containing-floats/">Containing Floats</a></li>
<li><a href="http://www.w3schools.com/Css/pr_class_clear.asp">W3Schools: Clear</a></li>
<li><a href="http://www.w3schools.com/css/pr_class_float.asp">W3Schools: Float</a></li>
</ul>
<h3 id="CSS-Basics3">3. Center Alignment</h3>
<p>The days of using the <code>&lt;center&gt;</code> HTML tag are long gone. Let’s look at the various ways of center-aligning an element.</p>
<h4>Horizontal Alignment</h4>
<p>You can horizontally align text elements using the <a href="http://www.w3schools.com/CSS/pr_text_text-align.asp"><code>text-align</code></a> property. This is quite simple to do, but keep in mind when center-aligning <a href="http://en.wikipedia.org/wiki/HTML_element#Inline_elements">inline</a> <a href="http://htmlhelp.com/reference/html40/inline.html">elements</a> that you must add <code>display: block</code>. This allows the browser to determine the boundaries on which to base its alignment of your element.</p>
<div id="highlighter_839156">
<div>
<div><a title="view source" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#viewSource">view source</a></p>
<p><a title="print" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#printSource">print</a><a title="?" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#about">?</a></p>
</div>
</div>
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>.</code><code>center</code> <code>{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>text-align</code><code>: </code><code>center</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>display</code><code>: </code><code>block</code><code>; </code><code>/*--For inline elements only--*/</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>To horizontally align non-textual elements, use the <a href="http://www.w3schools.com/CSS/css_margin.asp"><code>margin</code></a> property.</p>
<p>The <a href="http://www.w3.org/TR/CSS21/visudet.html#blockwidth">W3C</a> says, “If both <code>margin-left</code> and <code>margin-right</code> are <code>auto</code>, their used values are equal. This horizontally centers the element with respect to the edges of the containing block.”</p>
<p>Horizontal alignment can be achieved, then, by setting the left and right margins to <code>auto</code>. This is an ideal method of horizontally aligning non-text-based elements; for example, layouts and images. But when center-aligning a layout or element without a specified width, you must specify a width in order for this to work.</p>
<p>To center-align a layout:</p>
<div id="highlighter_416071">
<div>
<div><a title="view source" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#viewSource">view source</a></p>
<p><a title="print" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#printSource">print</a><a title="?" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#about">?</a></p>
</div>
</div>
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>.layout_container {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>margin</code><code>: </code><code>0</code> <code>auto</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>width</code><code>: </code><code>960px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>To center-align an image:</p>
<div id="highlighter_21727">
<div>
<div><a title="view source" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#viewSource">view source</a></p>
<p><a title="print" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#printSource">print</a><a title="?" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#about">?</a></p>
</div>
</div>
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>img.</code><code>center</code> <code>{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>margin</code><code>: </code><code>0</code> <code>auto</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>display</code><code>: </code><code>block</code><code>; </code><code>/*--Since IMG is an inline element--*/</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<h4>Vertical Alignment</h4>
<p>You can vertically align text-based elements using the <a href="http://www.w3schools.com/css/pr_dim_line-height.asp"><code>line-height</code></a> property, which specifies the amount of vertical space between lines of text. This is ideal for vertically aligning headings and other text-based elements. Simply match the <code>line-height</code> with the height of the element.</p>
<p><img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/3_a.jpg" alt="3 A in Mastering CSS Coding: Getting Started" /></p>
<div id="highlighter_450623">
<div>
<div><a title="view source" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#viewSource">view source</a></p>
<p><a title="print" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#printSource">print</a><a title="?" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#about">?</a></p>
</div>
</div>
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>h</code><code>1</code> <code>{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>font-size</code><code>: </code><code>3em</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>height</code><code>: </code><code>100px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>line-height</code><code>: </code><code>100px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>5</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>To vertically align non-textual elements, use <a href="http://www.w3schools.com/Css/pr_class_position.asp">absolute positioning</a>.</p>
<p>The trick with this technique is that you must specify the exact height and width of the centered element.</p>
<p>With the <code>position: absolute</code> property, an element is positioned according to its base position (<strong>0,0</strong>: the top-left corner). In the image below, the red point indicates the 0,0 base of the element, before a negative margin is applied.</p>
<p>By applying negative top and left margins, we can now perfectly align this element both vertically and horizontally.</p>
<p><img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/10/upd3_b.gif" alt="Upd3 B in Mastering CSS Coding: Getting Started" /></p>
<p>Here is the complete CSS for horizontal and vertical alignment:</p>
<div id="highlighter_899005">
<div>
<div><a title="view source" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#viewSource">view source</a></p>
<p><a title="print" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#printSource">print</a><a title="?" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#about">?</a></p>
</div>
</div>
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>.vertical {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>width</code><code>: </code><code>600px</code><code>; </code><code>/*--Specify Width--*/</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>height</code><code>: </code><code>300px</code><code>; </code><code>/*--Specify Height--*/</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>position</code><code>: </code><code>absolute</code><code>; </code><code>/*--Set positioning to absolute--*/</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>5</code></td>
<td><code>top</code><code>: </code><code>50%</code><code>; </code><code>/*--Set top coordinate to 50%--*/</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>6</code></td>
<td><code>left</code><code>: </code><code>50%</code><code>; </code><code>/*--Set left coordinate to 50%--*/</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>7</code></td>
<td><code>margin</code><code>: </code><code>-150px</code> <code>0</code> <code>0</code> <code>-300px</code><code>; </code><code>/*--Set negative top/left margin--*/</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>8</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>Related articles:</p>
<ul>
<li><a href="http://en.support.wordpress.com/affiliate-links/">Vertical Centering With CSS</a></li>
<li><a href="http://www.w3.org/Style/Examples/007/center">Centering Things</a></li>
<li><a href="http://simplebits.com/notebook/2004/09/08/centering.html">CSS Centering 101</a></li>
<li><a href="http://www.maxdesign.com.au/presentation/center/">CSS Centering: Fun for All! </a></li>
<li><a href="http://www.sohtanaka.com/web-design/vertical-alignment-css/">Two Simple Ways to Vertically Align with CSS</a></li>
</ul>
<h3 id="CSS-Basics4">4. Ordered vs. Unordered Lists</h3>
<p>An ordered list, <code>&lt;ol&gt;</code>, is a list whose items are marked with numbers.</p>
<p>An unordered list, <code>&lt;ul&gt;</code>, is a list whose items are marked with bullets.</p>
<p>By default, both of these list item styles are plain and simple. But with the help of CSS, you can easily customize them.</p>
<p>To keep the code semantic, lists should be used only for content that is itemized in a list-like fashion. But they can be extended to create multiple columns and navigation menus.</p>
<h4>Customizing Unordered Lists</h4>
<p>Plain bullets are dull and may not draw enough attention to the content they accompany. You can fix this with a simple yet effective technique: remove the default bullets and apply a background image to each list item.</p>
<p>Here is the CSS for custom bullets:</p>
<div id="highlighter_989525">
<div>
<div><a title="view source" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#viewSource">view source</a></p>
<p><a title="print" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#printSource">print</a><a title="?" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#about">?</a></p>
</div>
</div>
<div>
<div>
<table>
<tbody>
<tr>
<td><code>01</code></td>
<td><code>ul.product_checklist {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>02</code></td>
<td><code>list-style</code><code>: </code><code>none</code><code>; </code><code>/*--Takes out the default bullets--*/</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>03</code></td>
<td><code>margin</code><code>: </code><code>0</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>04</code></td>
<td><code>padding</code><code>: </code><code>0</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>05</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>06</code></td>
<td><code>ul.product_checklist li {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>07</code></td>
<td><code>padding</code><code>: </code><code>5px</code> <code>5px</code> <code>5px</code> <code>25px</code><code>; </code><code>/*--Adds padding around each item--*/</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>08</code></td>
<td><code>margin</code><code>: </code><code>0</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>09</code></td>
<td><code>background</code><code>: </code><code>url</code><code>(icon_checklist.gif) </code><code>no-repeat</code> <code>left</code> <code>center</code><code>; </code><code>/*--Adds a bullet icon as a background image--*/</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>10</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p><img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/4_a.gif" alt="4 A in Mastering CSS Coding: Getting Started" /></p>
<p>Resources for list items:</p>
<ul>
<li><a href="http://www.noupe.com/css/css-styled-lists-20-demos-tutorials-and-best-of.html">CSS-Styled Lists: 20+ Demos, Tutorials and Best Practices</a></li>
<li><a href="http://www.webdesignerwall.com/tutorials/style-your-ordered-list/">Style Your Ordered List</a></li>
<li><a href="http://www.alistapart.com/articles/taminglists/">CSS Design: Taming Lists</a></li>
</ul>
<h4>Using Unordered Lists for Navigation</h4>
<p>Most CSS-based navigation menus are now built as lists. Here is a breakdown of how to turn an ordinary list into a horizontal navigation menu.</p>
<p><strong>HTML:</strong> begin with a simple unordered list, with links for each list item.</p>
<div id="highlighter_482902">
<div>
<div><a title="view source" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#viewSource">view source</a></p>
<p><a title="print" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#printSource">print</a><a title="?" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#about">?</a></p>
</div>
</div>
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>&lt;ul id=</code><code>"topnav"</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>&lt;li&gt;&lt;a href=</code><code>"#"</code><code>&gt;Home&lt;/a&gt;&lt;/li&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>&lt;li&gt;&lt;a href=</code><code>"#"</code><code>&gt;Services&lt;/a&gt;&lt;/li&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>&lt;li&gt;&lt;a href=</code><code>"#"</code><code>&gt;Portfolio&lt;/a&gt;&lt;/li&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>5</code></td>
<td><code>&lt;li&gt;&lt;a href=</code><code>"#"</code><code>&gt;About&lt;/a&gt;&lt;/li&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>6</code></td>
<td><code>&lt;li&gt;&lt;a href=</code><code>"#"</code><code>&gt;Contact&lt;/a&gt;&lt;/li&gt;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>7</code></td>
<td><code>&lt;/ul&gt;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p><strong>CSS:</strong> we remove the default bullets (as we did when we made custom bullets) by specifying <code>list-style: none</code>. Then, we float each list item to the left so that the navigation menu appears horizontal, flowing from left to right.</p>
<div id="highlighter_378021">
<div>
<div><a title="view source" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#viewSource">view source</a></p>
<p><a title="print" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#printSource">print</a><a title="?" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#about">?</a></p>
</div>
</div>
<div>
<div>
<table>
<tbody>
<tr>
<td><code>01</code></td>
<td><code>ul#topnav {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>02</code></td>
<td><code>list-style</code><code>: </code><code>none</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>03</code></td>
<td><code>float</code><code>: </code><code>left</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>04</code></td>
<td><code>width</code><code>: </code><code>960px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>05</code></td>
<td><code>margin</code><code>: </code><code>0</code><code>; </code><code>padding</code><code>: </code><code>0</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>06</code></td>
<td><code>background</code><code>: </code><code>#f0f0f0</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>07</code></td>
<td><code>border</code><code>: </code><code>1px</code> <code>solid</code> <code>#ddd</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>08</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>09</code></td>
<td><code>ul#topnav li {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>10</code></td>
<td><code>float</code><code>: </code><code>left</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>11</code></td>
<td><code>margin</code><code>: </code><code>0</code><code>; </code><code>padding</code><code>: </code><code>0</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>12</code></td>
<td><code>border-right</code><code>: </code><code>1px</code> <code>solid</code> <code>#ddd</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>13</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>14</code></td>
<td><code>ul#topnav li a {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>15</code></td>
<td><code>float</code><code>: </code><code>left</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>16</code></td>
<td><code>display</code><code>: </code><code>block</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>17</code></td>
<td><code>padding</code><code>: </code><code>10px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>18</code></td>
<td><code>color</code><code>: </code><code>#333</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>19</code></td>
<td><code>text-decoration</code><code>: </code><code>none</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>20</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>21</code></td>
<td><code>ul#topnav li a:hover {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>22</code></td>
<td><code>background</code><code>: </code><code>#fff</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>23</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>Additional resources:</p>
<ul>
<li><a href="http://www.smashingmagazine.com/2007/03/14/css-based-navigation-menus-modern-solutions/">CSS-Based Navigation Menus: Modern Solutions</a></li>
<li><a href="http://sixrevisions.com/css/30-exceptional-css-navigation-techniques/">30 Exceptional CSS Navigation Techniques</a></li>
<li><a href="http://mirificampress.com/permalink/the_amazing_li">Using CSS and Unordered List Items to Do Just About Anything</a></li>
<li><a href="http://www.sitepoint.com/article/navigation-using-css/">Nifty Navigation Tricks Using CSS</a></li>
<li><a href="http://css-tricks.com/centering-list-items-horizontally-slightly-trickier-than-you-might-think/">Centering List Items Horizontally</a></li>
<li><a href="http://woork.blogspot.com/2008/01/digg-like-navigation-bar-using-css.html">Digg-Like Navigation Bar Using CSS</a></li>
</ul>
<h3 id="CSS-Basics5">5. Styling Headings</h3>
<p>The heading HTML tag is important for SEO. But regular headings can look dull. Why not spice them up with CSS and enjoy the best of both worlds?</p>
<p>Once you have the main styling properties set for your headings, you can now <strong>nest inline elements</strong> to target specific text for extra styling.</p>
<p><img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/5_a.gif" alt="5 A in Mastering CSS Coding: Getting Started" /></p>
<p>Your HTML would look like this:</p>
<div id="highlighter_473882">
<div>
<div><a title="view source" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#viewSource">view source</a></p>
<p><a title="print" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#printSource">print</a><a title="?" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#about">?</a></p>
</div>
</div>
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>&lt;h</code><code>1</code><code>&gt;&lt;span&gt;CSS&lt;/span&gt; Back to Basics &lt;</code><code>small</code><code>&gt;Tips, Tricks, &amp;amp; Practical Uses of CSS&lt;/</code><code>small</code><code>&gt;&lt;/h</code><code>1</code><code>&gt;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>And your CSS would look like this:</p>
<div id="highlighter_373189">
<div>
<div><a title="view source" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#viewSource">view source</a></p>
<p><a title="print" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#printSource">print</a><a title="?" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#about">?</a></p>
</div>
</div>
<div>
<div>
<table>
<tbody>
<tr>
<td><code>01</code></td>
<td><code>h</code><code>1</code> <code>{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>02</code></td>
<td><code>font</code><code>: </code><code>normal</code> <code>5.2em</code> <code>Georgia, </code><code>"Times New Roman"</code><code>, Times, </code><code>serif</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>03</code></td>
<td><code>margin</code><code>: </code><code>0</code> <code>0</code> <code>20px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>04</code></td>
<td><code>padding</code><code>: </code><code>10px</code> <code>0</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>05</code></td>
<td><code>font-weight</code><code>: </code><code>normal</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>06</code></td>
<td><code>text-align</code><code>: </code><code>center</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>07</code></td>
<td><code>text-shadow</code><code>: </code><code>1px</code> <code>1px</code> <code>1px</code> <code>#ccc</code><code>; </code><code>/*--Not supported by IE--*/</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>08</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>09</code></td>
<td><code>h</code><code>1</code> <code>span {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>10</code></td>
<td><code>color</code><code>: </code><code>#cc0000</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>11</code></td>
<td><code>font-weight</code><code>: </code><code>bold</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>12</code></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>13</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>14</code></td>
<td><code>h</code><code>1</code> <code>small</code> <code>{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>15</code></td>
<td><code>font-size</code><code>: </code><code>0.35em</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>16</code></td>
<td><code>text-transform</code><code>: </code><code>uppercase</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>17</code></td>
<td><code>color</code><code>: </code><code>#999</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>18</code></td>
<td><code>font-family</code><code>: </code><code>Arial</code><code>, </code><code>Helvetica</code><code>, </code><code>sans-serif</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>19</code></td>
<td><code>text-shadow</code><code>: </code><code>none</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>20</code></td>
<td><code>display</code><code>: </code><code>block</code><code>; </code><code>/*--Keeps the small tag on its own line--*/</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>21</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>Additional typography-related resources:</p>
<ul>
<li><a href="http://www.3point7designs.com/blog/2008/06/02/10-examples-of-beautiful-css-typography-and-how-they-did-it/">10 Examples of Beautiful CSS Typography, and How They Did It</a></li>
<li><a href="http://webdesignledger.com/resources/12-css-tools-and-tutorials-for-beautiful-web-typography">12 CSS Tools and Tutorials for Beautiful Web Typography</a></li>
<li><a href="http://www.webdesignerwall.com/tutorials/css-gradient-text-effect/">CSS Gradient Text Effect</a></li>
<li><a href="http://www.smashingmagazine.com/2009/01/27/css-typographic-tools-and-techniques/">50 Useful Design Tools For Beautiful Web Typography</a></li>
<li><a href="http://net.tutsplus.com/tutorials/html-css-techniques/six-ways-to-improve-your-web-typography/">6 Ways to Improve Your Web Typography</a></li>
<li><a href="http://www.noupe.com/css/css-typography-contrast-techniques-tutorials-and-best-practices.html">CSS Typography: Contrast Techniques, Tutorials and Best Practices</a></li>
<li><a href="http://www.aisleone.net/2009/design/8-ways-to-improve-your-typography/">8 Simple Ways to Improve Typography in Your Designs</a></li>
<li><a href="http://www.alistapart.com/articles/howtosizetextincss/">How to Size Text in CSS</a></li>
</ul>
<h3 id="CSS-Basics6">6. Overflow</h3>
<p>The <code>overflow</code> property can be used in various ways and is one of the most useful properties in the CSS arsenal.</p>
<h4>What Is Overflow?</h4>
<p>According to <a href="http://www.w3schools.com/Css/pr_pos_overflow.asp">W3Schools.com</a>, “the overflow property specifies what happens if content overflows an element’s box.”</p>
<p>Take a look at the following examples to see how this works.</p>
<p><a href="http://www.sohtanaka.com/web-design/examples/css-back-to-basics/overflow.htm"><img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/6_a.jpg" alt="6 A in Mastering CSS Coding: Getting Started" /></a></p>
<p>Visually, <code>overflow: auto</code> looks like an iframe but is much more useful and SEO-friendly. It automatically adds a scroll bar (horizontal, vertical or both) when the content within an element exceeds the element’s box or boundary.</p>
<p>The <code>overflow: scroll</code> property works the same but forces a scroll bar to appear regardless of whether or not the content exceeds the element’s boundary.</p>
<p>And the <code>overflow: hidden</code> property masks or hides an element’s content if it exceeds the element’s boundary.</p>
<p>Quick tip: have you ever had a parent element that did not fully wrap around its child element? You can fix this by making the parent container a floated element.</p>
<p>In some cases, though, floating left or right is not a workable solution — for example, if you want to center-align the container or do not want to specify an exact width. In this case, use <code>overflow: hidden</code> on your parent container to completely wrap any floated child elements within it.</p>
<p><a href="http://www.sohtanaka.com/web-design/examples/css-back-to-basics/overflow-hidden-trick.htm"><img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/6_b.jpg" alt="6 B in Mastering CSS Coding: Getting Started" /></a></p>
<p>Additional resources:</p>
<ul>
<li><a href="http://htmldog.com/reference/cssproperties/overflow/">HTML Dog: Overflow</a></li>
<li><a href="http://www.w3schools.com/Css/pr_pos_overflow.asp">W3Schools: Overflow</a></li>
<li><a href="http://cssglobe.com/post/1305/create-resizing-thumbnails-using-overflow-property">CSS Globe: Create Resizing Thumbnails</a></li>
<li><a href="http://css-tricks.com/the-css-overflow-property/">CSS-Tricks: CSS Overflow Breakdown</a></li>
</ul>
<h3 id="CSS-Basics7">7. Position</h3>
<p>Positioning (relative, absolute and fixed) is one of the most powerful properties in CSS. It allows you to position an element using exact coordinates, giving you the freedom and creativity to design out of the box.</p>
<p>You have to do three basic things when using positioning:</p>
<ol>
<li><strong>Set the coordinates</strong> (i.e. define the positioning of the x and y coordinates).</li>
<li><strong>Choose the right value for the situation</strong>: relative, absolute, fixed or static.</li>
<li><strong>Set a value for the <a href="http://www.w3schools.com/Css/pr_pos_z-index.asp">z-index</a> property: </strong> to layer elements (optional).</li>
</ol>
<p>With <code>position: relative</code>, an element is placed in its natural position. For example, if a relatively positioned element sits to the left of an image, setting the top and left coordinates to <code>10px</code> would move the element just 10 pixels from the top and 10 pixels from the left of that exact spot.</p>
<p>Relative positioning is also commonly used <strong>to define the new point of origin (the x and y coordinates)</strong> of absolutely positioned nested elements. By default, the base position of every element is the top-left corner (0,0) of the browser’s view port. When you give an element relative positioning, then the base position of any child elements with absolute positioning will be positioned relative to their parent element — i.e. 0,0 is now the top-left corner of the parent element, not the browser’s view port.</p>
<p><img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/7_a.gif" alt="7 A in Mastering CSS Coding: Getting Started" /></p>
<p>An element with a value of <code>position: absolute</code> can be placed anywhere using x and y coordinates. By default, its base position (0,0) is the top-left corner of the browser’s view port. It ignores all natural flow rules and is not affected by surrounding elements.</p>
<p>The base position of an element with a <code>position: fixed</code> value is also the top-left corner of the browser’s view port. The difference with fixed positioning is that <strong>the element will be fixed to its location and remain in view even when the user scrolls up or down.</strong></p>
<p>The <a href="http://www.w3schools.com/Css/pr_pos_z-index.asp"><code>z-index</code></a> property specifies the stack order of an element. The higher the value, the higher the element will appear.</p>
<p>Think of z-index stacking as layering. Check out the image below for an example:</p>
<p><img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/7_b.gif" alt="7 B in Mastering CSS Coding: Getting Started" /></p>
<p>Additional resources:</p>
<ul>
<li><a href="http://www.w3schools.com/Css/css_positioning.asp">W3Schools: CSS Positioning</a></li>
<li><a href="http://css-tricks.com/absolute-relative-fixed-positioining-how-do-they-differ/">CSS-Tricks: Absolute, Relative, Fixed Positioning</a></li>
<li><a href="http://thecssblog.com/tutorials/stopping-the-css-positioning-panic-part-1/">Stopping the CSS Positioning Panic</a></li>
<li><a href="http://www.barelyfitz.com/screencast/html-training/css/positioning/">Learn CSS Positioning in Ten Steps</a></li>
<li><a href="http://www.onextrapixel.com/2009/05/29/an-indepth-coverage-on-css-layers-z-index-relative-and-absolute-positioning/">In-Depth Coverage of CSS Layers, Z-Index, Relative and Absolute Positioning</a></li>
</ul>
<h3>Adding Flavor With CSS</h3>
<p>Now that you understand the basics, step up your game by adding a bit of flavor to your CSS. Below are some common techniques for enhancing and polishing your layout and images. We’ll also challenge you to create your own website from scratch using pure CSS.</p>
<h3 id="CSS-Basics8">9. Background Images</h3>
<p>Background images come in handy for many visual effects. Whether you add a repeating background image to cover a large area or add stylish icons to your navigation, the property makes your page come to life.</p>
<p>Note, though, that the default print setting excludes the background property. When creating printable pages, be mindful of which elements have background images and include image tags.</p>
<h4>Using Large Backgrounds</h4>
<p>With monitor sizes getting bigger and bigger, large background images for websites have become quite popular.</p>
<p>Check out this detailed tutorial by <a href="http://www.ndesign-studio.com/">Nick La</a> of <a href="http://www.webdesignerwall.com/">WebDesigner Wall</a> on how to achieve this effect:</p>
<p><a href="http://www.webdesignerwall.com/tutorials/how-to-css-large-background/"><img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/8_a.jpg" alt="8 A in Mastering CSS Coding: Getting Started" /></a></p>
<p>Also be sure to read the article on Webdesigner Depot about the “<a href="http://www.webdesignerdepot.com/2008/11/dos-and-donts-of-large-website-backgrounds/">Do’s and Don’ts of Large Website Backgrounds</a>.”</p>
<h4>Text Replacement</h4>
<p>You may be aware that not all standard browsers yet support custom fonts embedded on a website. But you can replace text with an image in <a href="http://www.mezzoblue.com/tests/revised-image-replacement/">various ways</a>. One rather simple technique is to use the <code><a href="http://www.w3schools.com/Css/pr_text_text-indent.asp">text-indent</a></code> property.</p>
<p>Most commonly seen with headings, this technique replaces structured HTML text with an image.</p>
<div id="highlighter_761641">
<div>
<div><a title="view source" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#viewSource">view source</a></p>
<p><a title="print" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#printSource">print</a><a title="?" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#about">?</a></p>
</div>
</div>
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>h</code><code>1</code> <code>{</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>background</code><code>: </code><code>url</code><code>(home_h</code><code>1</code><code>.gif) </code><code>no-repeat</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>text-indent</code><code>: </code><code>-99999px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>You may sometimes need to specify a width and height (as well as <code>display: block</code> if the element is inline).</p>
<div id="highlighter_512662">
<div>
<div><a title="view source" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#viewSource">view source</a></p>
<p><a title="print" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#printSource">print</a><a title="?" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#about">?</a></p>
</div>
</div>
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>.replacethis {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>background</code><code>: </code><code>url</code><code>(home_h</code><code>1</code><code>.gif) </code><code>no-repeat</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>text-indent</code><code>: </code><code>-99999px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>width</code><code>: </code><code>100%</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>5</code></td>
<td><code>height</code><code>: </code><code>60px</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>6</code></td>
<td><code>display</code><code>: </code><code>block</code><code>; </code><code>/*--Needed only for inline elements--*/</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>7</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>Articles on text replacement:</p>
<ul>
<li><a href="http://css-tricks.com/css-image-replacement/">Nine Techniques for CSS Image Replacement</a></li>
<li><a href="http://stopdesign.com/archive/2003/03/07/replace-text.html">Using background-image to Replace Text</a></li>
<li><a href="http://www.tjkdesign.com/articles/tip.asp">Image Placement vs. Image Replacement</a></li>
<li><a href="http://www.mezzoblue.com/tests/revised-image-replacement/">Revised Image Replacement</a></li>
</ul>
<h4>CSS Sprites</h4>
<p><a href="http://www.smashingmagazine.com/2009/04/27/the-mystery-of-css-sprites-techniques-tools-and-tutorials/">CSS Sprites</a> is a technique in which you use background positioning to show only a small area of a larger single background image (the larger image being actually multiple images laid out in a grid and merged into one file).</p>
<p><a href="http://www.smashingmagazine.com/2009/04/27/the-mystery-of-css-sprites-techniques-tools-and-tutorials/"><img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/8_c.gif" alt="8 C in Mastering CSS Coding: Getting Started" /></a></p>
<p>CSS Sprites are commonly used with icons and the hover and active states of images that have replaced links and navigation items.</p>
<p><a href="http://www.smashingmagazine.com/2009/04/27/the-mystery-of-css-sprites-techniques-tools-and-tutorials/"><img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/8_d.gif" alt="8 D in Mastering CSS Coding: Getting Started" /></a></p>
<p><strong>Why use CSS Sprites?</strong> CSS Sprites save loading time and cut down on CSS and and HTTP requests. To learn more about CSS Sprites, check out the resources below!</p>
<p>Articles on CSS Sprites:</p>
<ul>
<li><a href="http://www.smashingmagazine.com/2009/04/27/the-mystery-of-css-sprites-techniques-tools-and-tutorials/">The Mystery Of CSS Sprites: Techniques, Tools and Tutorials</a></li>
<li><a href="http://www.webdesignerwall.com/tutorials/advanced-css-menu/">Advanced CSS Menu</a></li>
<li><a href="http://www.ehousestudio.com/blog/2008/06/27/css-sprite-navigation-tutorial/">CSS Sprite Navigation Tutorial</a></li>
<li><a href="http://cssglobe.com/post/3028/creating-easy-and-useful-css-sprites">Creating Easy and Useful CSS Sprites</a></li>
<li><a href="http://www.tutorial9.net/web-tutorials/building-faster-websites-with-css-sprites/">Building Faster Websites with CSS Sprites</a></li>
<li><a href="http://www.alistapart.com/articles/sprites">CSS Sprites: Image Slicing’s Kiss of Death</a></li>
<li><a href="http://www.websiteoptimization.com/speed/tweak/css-sprites/">CSS Sprites: How Yahoo.com and AOL.com Improve Web Performance</a></li>
<li><a href="http://www.peachpit.com/articles/article.aspx?p=447210">What Are CSS Sprites?</a></li>
</ul>
<h3 id="CSS-Basics9">10. Image Enhancement</h3>
<p>You can style images with CSS in various ways, and some designers have made a lot of effort to create very stylish image templates.</p>
<p>One simple trick is the double-border technique, which does not require any additional images and is pure CSS.</p>
<p><img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/9_b.jpg" alt="9 B in Mastering CSS Coding: Getting Started" /></p>
<p>Your HTML would look like this:</p>
<div id="highlighter_259515">
<div>
<div><a title="view source" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#viewSource">view source</a></p>
<p><a title="print" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#printSource">print</a><a title="?" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#about">?</a></p>
</div>
</div>
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>&lt;img class=</code><code>"double_border"</code> <code>src=</code><code>"sample.jpg"</code> <code>alt=</code><code>""</code> <code>/&gt;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>And your CSS would look like this:</p>
<div id="highlighter_489158">
<div>
<div><a title="view source" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#viewSource">view source</a></p>
<p><a title="print" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#printSource">print</a><a title="?" href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#about">?</a></p>
</div>
</div>
<div>
<div>
<table>
<tbody>
<tr>
<td><code>1</code></td>
<td><code>img.double_border {</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>border</code><code>: </code><code>1px</code> <code>solid</code> <code>#bbb</code><code>;</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>3</code></td>
<td><code>padding</code><code>: </code><code>5px</code><code>; </code><code>/*Inner border size*/</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>4</code></td>
<td><code>background</code><code>: </code><code>#ddd</code><code>; </code><code>/*Inner border color*/</code></td>
</tr>
</tbody>
</table>
</div>
<div>
<table>
<tbody>
<tr>
<td><code>5</code></td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>Nick La of WebDesigner Wall has <a href="http://www.webdesignerwall.com/tutorials/css-decorative-gallery/">a great tutorial</a> on clever tricks to enhance your images. Do check it out!</p>
<p><a href="http://www.webdesignerwall.com/tutorials/css-decorative-gallery/"><img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/9_a.gif" alt="9 A in Mastering CSS Coding: Getting Started" /></a></p>
<h3 id="CSS-Basics10">11. PSD to HTML</h3>
<p>Now that you have learned the fundamentals of CSS, it’s time to test your skill and build your own website from scratch! Below are some hand-picked tutorials from the best of the Web.</p>
<ul>
<li><a href="http://net.tutsplus.com/videos/screencasts/slice-and-dice-that-psd/">Slice and Dice that PSD</a><a href="http://net.tutsplus.com/videos/screencasts/slice-and-dice-that-psd/"><img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/10_a.jpg" alt="10 A in Mastering CSS Coding: Getting Started" /></a></li>
<li><a href="http://net.tutsplus.com/videos/screencasts/converting-a-design-from-psd-to-html/">Converting a Design from PSD to HTML</a><a href="http://net.tutsplus.com/videos/screencasts/converting-a-design-from-psd-to-html/"><img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/10_b.jpg" alt="10 B in Mastering CSS Coding: Getting Started" /></a></li>
<li><a href="http://net.tutsplus.com/site-builds/from-psd-to-html-building-a-set-of-website-designs-step-by-step/">From PSD to HTML, Building a Set of Website Designs Step by Step</a><a href="http://net.tutsplus.com/site-builds/from-psd-to-html-building-a-set-of-website-designs-step-by-step/"><img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/10_c.jpg" alt="10 C in Mastering CSS Coding: Getting Started" /></a></li>
<li><a href="http://sixrevisions.com/tutorials/web-development-tutorials/coding-a-clean-illustrative-web-design-from-scratch/">Coding a Clean and Illustrative Web Design from Scratch</a><a href="http://sixrevisions.com/tutorials/web-development-tutorials/coding-a-clean-illustrative-web-design-from-scratch/"><img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/10_d.jpg" alt="10 D in Mastering CSS Coding: Getting Started" /></a></li>
<li><a href="http://net.tutsplus.com/tutorials/site-builds/build-a-sleek-portfolio-site-from-scratch/">Build a Sleek Portfolio Site from Scratch</a><a href="http://net.tutsplus.com/tutorials/site-builds/build-a-sleek-portfolio-site-from-scratch/"><img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/10_e.jpg" alt="10 E in Mastering CSS Coding: Getting Started" /></a></li>
<li><a href="http://www.blog.spoongraphics.co.uk/tutorials/how-to-build-your-own-single-page-portfolio-website">How To Build Your Own Single Page Portfolio Website</a><a href="http://www.blog.spoongraphics.co.uk/tutorials/how-to-build-your-own-single-page-portfolio-website"><img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/10_f.jpg" alt="10 F in Mastering CSS Coding: Getting Started" /></a></li>
<li><a href="http://css-tricks.com/video-screencasts/12-converting-a-photoshop-mockup-part-two-episode-one/">Converting a Photoshop Mockup: Part Two, Episode One</a><a href="http://css-tricks.com/video-screencasts/12-converting-a-photoshop-mockup-part-two-episode-one/"><img src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/10_g.jpg" alt="10 G in Mastering CSS Coding: Getting Started" /></a></li>
</ul>
<h3>Conclusion</h3>
<p>Developing a strong foundation early on is critical to mastering CSS. Given how fast Web technology advances, there is no better time than now to get up to speed on the latest standards and trends.</p>
<p>Hopefully, the techniques we’ve covered here will give you a head start on becoming the ultimate CSS ninja. Good luck, stay hungry and keep learning!</p>
<p><em>(al)</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tutodz.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tutodz.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tutodz.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tutodz.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tutodz.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tutodz.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tutodz.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tutodz.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tutodz.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tutodz.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tutodz.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tutodz.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tutodz.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tutodz.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tutodz.wordpress.com&amp;blog=10383833&amp;post=10&amp;subd=tutodz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tutodz.wordpress.com/2009/12/30/mastering-css-coding-getting-started/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a57a9e01d5adf52baa588cc65e8a4819?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tutodz</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/1_a.gif" medium="image">
			<media:title type="html">1 A in Mastering CSS Coding: Getting Started</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/1_c.gif" medium="image">
			<media:title type="html">1 C in Mastering CSS Coding: Getting Started</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/1_b.gif" medium="image">
			<media:title type="html">1 B in Mastering CSS Coding: Getting Started</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/2_a.jpg" medium="image">
			<media:title type="html">2 A in Mastering CSS Coding: Getting Started</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/2_b.jpg" medium="image">
			<media:title type="html">2 B in Mastering CSS Coding: Getting Started</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/2_c.gif" medium="image">
			<media:title type="html">2 C in Mastering CSS Coding: Getting Started</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/2_c1.gif" medium="image">
			<media:title type="html">2 C1 in Mastering CSS Coding: Getting Started</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/2_c2.gif" medium="image">
			<media:title type="html">2 C2 in Mastering CSS Coding: Getting Started</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/10/upd_2_d.gif" medium="image">
			<media:title type="html">Upd 2 D in Mastering CSS Coding: Getting Started</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/3_a.jpg" medium="image">
			<media:title type="html">3 A in Mastering CSS Coding: Getting Started</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/10/upd3_b.gif" medium="image">
			<media:title type="html">Upd3 B in Mastering CSS Coding: Getting Started</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/4_a.gif" medium="image">
			<media:title type="html">4 A in Mastering CSS Coding: Getting Started</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/5_a.gif" medium="image">
			<media:title type="html">5 A in Mastering CSS Coding: Getting Started</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/6_a.jpg" medium="image">
			<media:title type="html">6 A in Mastering CSS Coding: Getting Started</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/6_b.jpg" medium="image">
			<media:title type="html">6 B in Mastering CSS Coding: Getting Started</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/7_a.gif" medium="image">
			<media:title type="html">7 A in Mastering CSS Coding: Getting Started</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/7_b.gif" medium="image">
			<media:title type="html">7 B in Mastering CSS Coding: Getting Started</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/8_a.jpg" medium="image">
			<media:title type="html">8 A in Mastering CSS Coding: Getting Started</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/8_c.gif" medium="image">
			<media:title type="html">8 C in Mastering CSS Coding: Getting Started</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/8_d.gif" medium="image">
			<media:title type="html">8 D in Mastering CSS Coding: Getting Started</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/9_b.jpg" medium="image">
			<media:title type="html">9 B in Mastering CSS Coding: Getting Started</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/9_a.gif" medium="image">
			<media:title type="html">9 A in Mastering CSS Coding: Getting Started</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/10_a.jpg" medium="image">
			<media:title type="html">10 A in Mastering CSS Coding: Getting Started</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/10_b.jpg" medium="image">
			<media:title type="html">10 B in Mastering CSS Coding: Getting Started</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/10_c.jpg" medium="image">
			<media:title type="html">10 C in Mastering CSS Coding: Getting Started</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/10_d.jpg" medium="image">
			<media:title type="html">10 D in Mastering CSS Coding: Getting Started</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/10_e.jpg" medium="image">
			<media:title type="html">10 E in Mastering CSS Coding: Getting Started</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/10_f.jpg" medium="image">
			<media:title type="html">10 F in Mastering CSS Coding: Getting Started</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/09/10_g.jpg" medium="image">
			<media:title type="html">10 G in Mastering CSS Coding: Getting Started</media:title>
		</media:content>
	</item>
		<item>
		<title>Modern CSS Layouts: The Essential Characteristics</title>
		<link>http://tutodz.wordpress.com/2009/11/10/modern-css-layouts-the-essential-characteristics/</link>
		<comments>http://tutodz.wordpress.com/2009/11/10/modern-css-layouts-the-essential-characteristics/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 12:53:51 +0000</pubDate>
		<dc:creator>tutodz</dc:creator>
				<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://tutodz.wordpress.com/?p=6</guid>
		<description><![CDATA[Now is an exciting time to be creating CSS layouts. After years of what felt like the same old techniques for the same old browsers, we’re finally seeing browsers implement CSS 3, HTML 5 and other technologies that give us cool new tools and tricks for our designs. But all of this change can be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tutodz.wordpress.com&amp;blog=10383833&amp;post=6&amp;subd=tutodz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Now is an exciting time to be creating <strong>CSS layouts</strong>. After years of what felt like the same old techniques for the same old browsers, we’re finally seeing browsers implement CSS 3, HTML 5 and other technologies that give us cool new tools and tricks for our designs.</p>
<p>But all of this change can be stressful, too. How do you keep up with all of the new techniques and make sure your Web pages look great on the increasing number of browsers and devices out there? In part 1 of this article, you’ll learn the five essential characteristics of successful modern CSS websites. In part 2 of this article, you’ll learn about the techniques and tools that you need to achieve these characteristics.</p>
<p>We won’t talk about design trends and styles that characterize modern CSS-based layouts. These styles are always changing. Instead, we’ll <strong>focus on the broad underlying concepts that you need to know to create the most successful CSS layouts</strong> using the latest techniques. For instance, separating content and presentation is still a fundamental concept of CSS Web pages. But other characteristics of modern CSS Web pages are new or more important than ever. A modern CSS-based website is: progressively enhanced, adaptive to diverse users, modular, efficient and typographically rich.</p>
<ul>
<li>Progressively enhanced,</li>
<li>Adaptive to diverse users,</li>
<li>Modular,</li>
<li>Efficient,</li>
<li>Typographically rich.</li>
</ul>
<h3>Progressive Enhancement</h3>
<p>Progressive enhancement means creating a solid page with appropriate markup for content and adding advanced styling (and perhaps scripting) to the page for browsers that can handle it. It results in web pages that are usable by all browsers but that do not look identical in all browsers. Users of newer, more advanced browsers get to see more cool visual effects and nice usability enhancements.</p>
<p>The idea of allowing a design to look different in different browsers is not new. CSS gurus have been <a href="http://dowebsitesneedtolookexactlythesameineverybrowser.com/">preaching</a> this for years because font availability and rendering, color tone, pixel calculations and other technical factors have always varied between browsers and platforms. Most Web designers avoid “pixel perfection” and have accepted the idea of their designs looking slightly different in different browsers. But progressive enhancement, which has grown in popularity over the past few years, takes it a step further. Designs that are progressively enhanced may look more than slightly different in different browsers; they might look <em>very</em> different.</p>
<p>For example, the <a href="http://tweetcc.com/">tweetCC website</a> has a number of CSS 3 properties that add attractive visual touches, like drop-shadows behind text, multiple columns of text and different-colored background “images” (without there having to be actually different images). These effects are seen to various extents in different browsers, with old browsers like IE 6 looking the “plainest.” However, even in IE 6, the text is perfectly readable, and the design is perfectly usable.</p>
<p><a href="http://tweetcc.com/"><img src="http://media.smashingmagazine.com/wp-content/uploads/2009/10/tweetcc_safari.jpg" alt="Tweetcc Safari in Modern CSS Layouts: The Essential Characteristics" width="500" height="346" /></a><br /> <em>tweetCC in Safari.</em></p>
<p><a href="http://tweetcc.com/"><img src="http://media.smashingmagazine.com/wp-content/uploads/2009/10/tweetcc_ie.jpg" alt="Tweetcc Ie in Modern CSS Layouts: The Essential Characteristics" width="500" height="366" /></a><br /> <em>tweetCC in IE 6.</em></p>
<p>In CSS 3-capable browsers like Safari (top), the <a href="http://tweetcc.com/">tweetCC</a> website shows a number of visual effects that you can’t see in IE 6 (bottom).</p>
<p>These significant differences between browsers are perfectly okay, not only because that is the built-in nature of the Web, but because progressive enhancement brings the following benefits:</p>
<ul>
<li><strong>More robust pages</strong><br /> Rather than use the graceful degradation method to create a fully functional page and then work backwards to make it function in less-capable browsers, you focus first on creating a solid “base” page that works everywhere.</li>
<li><strong>Happier users</strong><br /> You start building the page making sure the basic functionality and styling is the same for everyone. People with old browsers, mobile devices and assistive technology are happy because the pages are clean and reliable and work well. People with the latest and greatest browsers are happy because they get a rich, polished experience.</li>
<li><strong>Reduced development time</strong><br /> You don’t have to spend hours trying to get everything to look perfect and identical in all browsers. Nor do you have to spend much time reverse-engineering your pages to work in older browsers after you have completed the fully functional and styled versions (as is the case with the graceful degradation method).</li>
<li><strong>Reduced maintenance time</strong><br /> If a new browser or new technology comes out, you can add new features to what you already have, without altering and possibly breaking your existing features. You have only one base version of the page or code to update, rather than multiple versions (which is the case with graceful degradation).</li>
<li><strong>More fun</strong><br /> It’s just plain fun to be able to use cool and creative new techniques on your Web pages, and not have to wait years for old browsers to die off.</li>
</ul>
<p>Learn more about progressive enhancement:</p>
<ul>
<li><a href="http://www.smashingmagazine.com/2009/04/22/progressive-enhancement-what-it-is-and-how-to-use-it/">Progressive Enhancement: What It Is, And How To Use It?</a></li>
<li><a href="http://en.wikipedia.org/wiki/Progressive_enhancement">Progressive Enhancement on Wikipedia</a></li>
<li><a href="http://www.hesketh.com/publications/articles/progressive-enhancement-paving-the-way-for/">Progressive Enhancement: Paving the Way for Future Web Design</a></li>
</ul>
<h3>Adaptive to Diverse Users</h3>
<p>Modern CSS-based Web pages have to accommodate the diverse range of browsers, devices, screen resolutions, font sizes, assistive technologies and other factors that users bring to the table. This concept is also not new but is growing in importance as Web users become increasingly diverse. For instance, a few years ago, you could count on almost all of your users having <a href="http://www.thecounter.com/stats/2006/January/res.php">one of three screen resolutions</a>. Now, users could be viewing your pages on 10-inch netbooks, 30-inch widescreen monitors or anything in between, not to mention tiny mobile devices.</p>
<p><a href="http://www.sohtanaka.com/web-design/smart-columns-w-css-jquery/"><img src="http://media.smashingmagazine.com/wp-content/uploads/images/smartcolumnssample.gif" alt="Smartcolumnssample in Modern CSS Layouts: The Essential Characteristics" width="520" height="300" /></a><br /> <em>In his article <a href="http://www.sohtanaka.com/web-design/smart-columns-w-css-jquery/">“Smart columns with CSS and jQuery”</a> Soh Tanaka describes his techniques that adapts the layout depending on the current browser window size.</em></p>
<p>Creating Web designs that work for all users in all scenarios will never possible. But the more users you can please, the better: for them, for your clients and for you. Successful CSS layouts now have to be more flexible and adaptable than ever before to the increasing variety of ways in which users browse the Web.</p>
<p>Consider factors such as these when creating CSS layouts:</p>
<ul>
<li><strong>Browser</strong><br /> Is the design attractive and usable with the most current and popular browsers? Is it at least usable with old browsers?</li>
<li><strong>Platform</strong><br /> Does the design work on PC, Mac and Linux machines?</li>
<li><strong>Device</strong><br /> Does the design adapt to low-resolution mobile devices? How does it look on mobile devices that have full resolution (e.g. iPhones)?</li>
<li><strong>Screen resolution</strong><br /> Does the design stay together at multiple viewport (i.e. window) widths? Is it attractive and easy to read at different widths? If the design does adapt to different viewport widths, does it correct for extremely narrow or wide viewports (e.g. by using the <code>min-width</code> and <code>max-width</code> properties)?</li>
<li><strong>Font sizes</strong><br /> Does the design accommodate different default font sizes? Does the design hold together when the font size is changed on the fly? Is it attractive and easy to read at different font sizes?</li>
<li><strong>Color</strong><br /> Does the design make sense and is the content readable in black and white? Would it work if you are color blind or have poor vision or cannot detect color contrast?</li>
<li><strong>JavaScript presence</strong><br /> Does the page work without JavaScript?</li>
<li><strong>Image presence</strong><br /> Does the content make sense and is it readable without images (either background or foreground)?</li>
<li><strong>Assistive technology/disability</strong><br /> Does the page work well in screen readers? Does the page work well without a mouse?</li>
</ul>
<p>This is not a comprehensive list; and even so, you would not be able to accommodate every one of these variations in your design. But the more you can account for, the more user-friendly, robust and successful your website will be.</p>
<p>See these resources on user diversity and Web page adaptability:</p>
<ul>
<li><a href="http://marketshare.hitslink.com/">Market Share by Net Applications</a></li>
<li><a href="http://www.baekdal.com/reports/actual-browser-sizes/">Actual Browser Sizes</a></li>
<li><a href="http://www.smashingmagazine.com/2007/11/23/screen-resolutions-and-better-user-experience/">Screen Resolutions and Better User Experience</a></li>
<li><a href="http://www.smashingmagazine.com/2009/06/02/fixed-vs-fluid-vs-elastic-layout-whats-the-right-one-for-you/">Fixed vs. Fluid vs. Elastic Layout: What’s the Right One for You?</a></li>
<li><a href="http://www.smashingmagazine.com/2009/01/13/mobile-web-design-trends-2009/">Mobile Web Design Trends for 2009</a></li>
</ul>
<h3>Modular</h3>
<p>Modern websites are no longer collections of static pages. Pieces of content and design components are reused throughout a website and even shared between websites, as content management systems (CMS), RSS aggregation and user-generated content increase in popularity. Modern design components have to be able to adapt to all of the different places they will be used and the different types and amount of content they will contain.</p>
<p><a href="http://wiki.github.com/stubbornella/oocss"><img src="http://media.smashingmagazine.com/wp-content/uploads/images/oocss.jpg" alt="Oocss in Modern CSS Layouts: The Essential Characteristics" width="500" height="375" /></a><br /> <em><a href="http://wiki.github.com/stubbornella/oocss">Object Oriented CSS</a> is Nicole Sulivan’s attempt to create a framework that would allow developers to write fast, maintainable, standards-based, modular front end code.</em></p>
<p>Modular CSS, in a broad sense, is CSS that can be broken down into chunks that work independently to create design components that can themselves be reused independently. This might mean separating your style into multiple sheets, such as <em>layout.css</em>, <em>type.css</em>, and <em>color.css</em>. Or it might mean creating a collection of universal CSS classes for form layout that you can apply to any form on your website, rather than have to style each form individually. CMS’, frameworks, layout grids and other tools all help you create more modular Web pages.</p>
<p>Modular CSS offers these benefits (depending on which techniques and tools you use):</p>
<ul>
<li><strong>Smaller file sizes</strong><br /> When all of the content across your website is styled with only a handful of CSS classes, rather than an array of CSS IDs that only work on particular pieces of content on particular pages, your style sheets will have many fewer redundant lines of code.</li>
<li><strong>Reduced development time</strong><br /> Using frameworks, standard classes and other modular CSS tools keeps you from having to re-invent the wheel every time you start a new website. By using your own or other developers’ tried and true CSS classes, you spend less time testing and tweaking in different browsers.</li>
<li><strong>Reduced maintenance time</strong><br /> When your style sheets include broad, reusable classes that work anywhere on your website, you don’t have to come up with new styles when you add new content. Also, when your CSS is lean and well organized, you spend less time tracking down problems in your style sheets when browser bugs pop up.</li>
<li><strong>Easier maintenance for others</strong><br /> In addition to making maintenance less time-consuming for you, well-organized CSS and smartly named classes also make maintenance easier for developers who weren’t involved in the initial development of the style sheets. They’ll be able to find what they need and use it more easily. CMS’ and frameworks also allow people who are not as familiar with your website to update it easily, without screwing anything up.</li>
<li><strong>More design flexibility</strong><br /> Frameworks and layout grids make it easy, for instance, to switch between different types of layout on different pages or to <a href="http://24ways.org/2008/making-modular-layout-systems">plug in different types of content</a> on a single page.</li>
<li><strong>More consistent design</strong><br /> By reusing the same classes and avoiding location-specific styling, you ensure that all elements of the same type look the same throughout the website. CMS’ and frameworks provide even more insurance against design inconsistency.</li>
</ul>
<p>Learn more about modular CSS techniques:</p>
<ul>
<li><a href="http://www.stubbornella.org/content/2009/02/28/object-oriented-css-grids-on-github/">Object-Oriented CSS</a></li>
<li><a href="http://24ways.org/2008/making-modular-layout-systems">Making Modular Layout Systems</a></li>
<li><a href="http://www.w3avenue.com/2009/04/29/definitive-list-of-css-frameworks-pick-your-style/">Definitive List of CSS Frameworks: Pick Your Style</a></li>
</ul>
<h3>Efficient</h3>
<p>Modern CSS-based websites should be efficient in two ways:</p>
<ul>
<li>Efficient for you to develop,</li>
<li>Efficient for the server and browser to display to users.</li>
</ul>
<p>As Web developers, we can all agree that efficiency on the development side is a good thing. If you can save time while still producing high-quality work, then why wouldn’t you adopt more efficient CSS development practices? But creating pages that perform efficiently for users is sometimes not given enough attention. Even though connection speeds are getting faster and faster, page load times are still very important to users. In fact, as connection speeds increase, users might expect all pages to load very quickly, so making sure your website can keep up is important. Shaving just a couple of seconds off the loading time can make a big difference.</p>
<p>We’ve already discussed how modular CSS reduces development and maintenance time and makes your workflow a lot faster and more efficient. A myriad of tools are out there to help you write CSS quickly, which we’ll cover in part 2 of this article. You can also streamline your CSS development process by using many of the new effects offered by CSS 3, which cut down on your time spent creating graphics and coding usability enhancements.</p>
<p>Some CSS 3 techniques also improve performance and speed. For instance, traditional rounded-corner techniques require multiple images and DIVs for just one box. Using CSS 3 to create rounded corners requires no images, thus reducing the number of HTTP calls to the server and making the page load faster. No images also reduces the number of bytes the user has to download and speeds up page loading. CSS 3 rounded-corners also do not require multiple nested DIVs, which reduces page file size and speeds up page loading again. Simply switching to CSS 3 for rounded corners can give your website a tremendous performance boost, especially if you have many boxes with rounded corners on each page.</p>
<p>Writing clean CSS that takes advantage of shorthand properties, grouped selectors and other efficient syntax is of course just as important as ever for improving performance. Many of the more advanced tricks for making CSS-based pages load faster are also not new but are increasing in usage and importance. For instance, the <a href="http://www.smashingmagazine.com/2009/04/27/the-mystery-of-css-sprites-techniques-tools-and-tutorials/">CSS Sprites</a> technique, whereby a single file holds many small images that are each revealed using the CSS <code>background-position</code> property, was first described by <a href="http://www.alistapart.com/articles/sprites/">Dave Shea in 2004</a> but has been improved and added to a great deal since then. Many large enterprise websites now rely heavily on the technique to minimize HTTP requests. And it can improve efficiency for those of us working on smaller websites, too. CSS compression techniques are also increasingly common, and many automated tools make compressing and optimizing your CSS a breeze, as you’ll also learn in part 2 of this article.</p>
<p>Learn more about CSS efficiency:</p>
<ul>
<li><a href="http://www.smashingmagazine.com/2008/08/18/7-principles-of-clean-and-optimized-css-code/">7 Principles of Clean and Optimized CSS Code</a></li>
<li><a href="http://www.stevesouders.com/blog/2009/06/18/simplifying-css-selectors/">Simplifying CSS Selectors</a></li>
<li><a href="http://developer.yahoo.com/performance/rules.html">Best Practices for Speeding Up Your Website</a></li>
<li><a href="http://www.smashingmagazine.com/2009/04/27/the-mystery-of-css-sprites-techniques-tools-and-tutorials/">The Mystery Of CSS Sprites: Techniques, Tools And Tutorials</a></li>
<li><a href="http://www.smashingmagazine.com/2009/06/25/35-css-lifesavers-for-efficient-web-design/">35 CSS Lifesavers For Efficient Web Design</a></li>
</ul>
<h3>Rich Typography</h3>
<p>Rich typography may seem out of place with the four concepts we have just covered. But we’re not talking about any particular style of typography or fonts, but rather the broader concept of creating readable yet unique-looking text by applying tried and true typographic principles using the newest technologies. Typography is one of the most rapidly evolving areas of Web design right now. And boy, does it need to evolve! While Web designers have had few limits on what they could do graphically with their designs, their limits with typography have been glaring and frustrating.</p>
<p>Until recently, Web designers were limited to working with the fonts on their end users’ machines. Image replacement tricks and clever technologies such as <a href="http://wiki.novemberborn.net/sifr3/">sIFR</a> have opened new possibilities in the past few years, but none of these is terribly easy to work with. In the past year, we’ve finally made great strides in what is possible for type on the Web because of the growing support for CSS 3’s <code>@font-face</code> property, as well as new easy-to-use technologies and services like <a href="http://cufon.shoqolate.com/generate/">Cufón</a> and <a href="http://blog.typekit.com/">Typekit</a>.</p>
<p>The <code>@font-face</code> rule allows you to link to a font on your server, called a “Web font,” just as you link to images. So you are no longer limited to working with the fonts that most people have installed on their machines. You can now take advantage of the beautiful, unique fonts that you have been dying to use.</p>
<p><a href="http://www.teehanlax.com/labs/projects/fontface/">@font-face in action: Teehanlax.com</a></p>
<p><a href="http://www.teehanlax.com/labs/projects/fontface/"><img src="http://media.smashingmagazine.com/wp-content/uploads/2009/10/fontface_teehanlax.gif" alt="Fontface Teehanlax in Modern CSS Layouts: The Essential Characteristics" width="500" height="430" /></a></p>
<p><a href="http://www.teehanlax.com/labs/projects/fontface/">Craigmod</a></p>
<p><a href="http://craigmod.com/journal/font-face/"><img src="http://media.smashingmagazine.com/wp-content/uploads/2009/10/fontface_craigmod.gif" alt="Fontface Craigmod in Modern CSS Layouts: The Essential Characteristics" width="500" height="343" /></a></p>
<p><a href="http://nicewebtype.com/fonts/museo-and-sans/">Nicewebtype</a></p>
<p><a href="http://nicewebtype.com/fonts/museo-and-sans/"><img src="http://media.smashingmagazine.com/wp-content/uploads/2009/10/fontface_nicewebtype_museo.gif" alt="Fontface Nicewebtype Museo in Modern CSS Layouts: The Essential Characteristics" width="500" height="362" /></a></p>
<p><em>The three screenshots above are all examples of what <code>@font-face</code> can do.</em></p>
<p>The main problem with <code>@font-face</code>, aside from the ever-present issue of <a href="http://a.deveria.com/caniuse/#feat=fontface">browser compatibility</a>, is that most font licenses—even those of free fonts—do not allow you to serve the fonts over the Web. That’s where <code>@font-face</code> services such as <a href="http://blog.typekit.com/">Typekit</a>, <a href="http://fontdeck.com/">Fontdeck</a> and <a href="http://www.kernest.com/">Kernest</a> are stepping in. They work with type foundries to license select fonts for Web design on a “rental” basis. These subscription-based services let you rent fonts for your website, giving you a much wider range of fonts to work with, while avoiding licensing issues.</p>
<p><a href="http://forabeautifulweb.com/"><img src="http://media.smashingmagazine.com/wp-content/uploads/2009/10/typekit_forabeautifulweb.jpg" alt="Typekit Forabeautifulweb in Modern CSS Layouts: The Essential Characteristics" width="500" height="263" /></a><br /> <em><a href="http://forabeautifulweb.com/">For A Beautiful Web</a> uses the <a href="http://blog.typekit.com/">Typekit font embedding service</a> for the website name, introductory text and headings.</em></p>
<p><a href="http://ruleroftheinterwebs.blogspot.com/"><img src="http://media.smashingmagazine.com/wp-content/uploads/2009/10/kernest_ruleroftheinterwebs.gif" alt="Kernest Ruleroftheinterwebs in Modern CSS Layouts: The Essential Characteristics" width="500" height="268" /></a><br /> <em><a href="http://ruleroftheinterwebs.blogspot.com/">Ruler of the Interwebs</a> uses the <a href="http://www.kernest.com/">Kernest font embedding service</a> for the website name and headings.</em></p>
<p>We still have a long way to go, but the new possibilities make typography more important to Web design than ever before. To make your design truly stand out, use these modern typographic techniques, which we’ll cover in even greater detail in Part 2.</p>
<p>See these resources on current CSS typography techniques:</p>
<ul>
<li><a href="http://www.webfonts.info/wiki/index.php?title=Main_Page">Webfonts.info Wiki</a></li>
<li><a href="http://hacks.mozilla.org/2009/06/beautiful-fonts-with-font-face/">Beautiful Fonts With @font-face</a></li>
<li><a href="http://opentype.info/blog/2009/07/29/why-webfont-services-are-the-future-of-fonts-on-the-web/">Why Web Font Services Are the Future of Fonts on the Web</a></li>
<li><a href="http://paulirish.com/2009/the-direction-forward-with-web-fonts/">The Direction Forward with Web Fonts</a></li>
<li><a href="http://zomigi.com/blog/roundup-of-font-embedding-and-replacement-techniques/">Roundup of Font Embedding and Replacement Techniques</a></li>
</ul>
<h3>Summary</h3>
<p>We’ve looked at five characteristics of modern CSS websites:</p>
<ul>
<li>Progressively enhanced,</li>
<li>Adaptive to diverse users,</li>
<li>Modular,</li>
<li>Efficient,</li>
<li>Typographically rich.</li>
</ul>
<p>In part 2 of this article, coming soon, we’ll go over the techniques and tools that will help you implement these important characteristics on your CSS-based Web pages.</p>
<h4>About the author</h4>
<p>Zoe Mickley Gillenwater is a freelance Web designer specializing in CSS and accessibility. She is the author of the book <a href="http://www.flexiblewebbook.com/">Flexible Web Design: Creating Liquid and Elastic Layouts with CSS</a>, plus a <a href="http://www.communitymx.com/author.cfm?cid=2157">whole bunch of articles</a>. Find out more about her on <a href="http://www.zomigi.com/">her blog</a> and on <a href="http://twitter.com/zomigi">Twitter</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tutodz.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tutodz.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tutodz.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tutodz.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tutodz.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tutodz.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tutodz.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tutodz.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tutodz.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tutodz.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tutodz.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tutodz.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tutodz.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tutodz.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tutodz.wordpress.com&amp;blog=10383833&amp;post=6&amp;subd=tutodz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tutodz.wordpress.com/2009/11/10/modern-css-layouts-the-essential-characteristics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a57a9e01d5adf52baa588cc65e8a4819?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tutodz</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/wp-content/uploads/2009/10/tweetcc_safari.jpg" medium="image">
			<media:title type="html">Tweetcc Safari in Modern CSS Layouts: The Essential Characteristics</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/wp-content/uploads/2009/10/tweetcc_ie.jpg" medium="image">
			<media:title type="html">Tweetcc Ie in Modern CSS Layouts: The Essential Characteristics</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/wp-content/uploads/images/smartcolumnssample.gif" medium="image">
			<media:title type="html">Smartcolumnssample in Modern CSS Layouts: The Essential Characteristics</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/wp-content/uploads/images/oocss.jpg" medium="image">
			<media:title type="html">Oocss in Modern CSS Layouts: The Essential Characteristics</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/wp-content/uploads/2009/10/fontface_teehanlax.gif" medium="image">
			<media:title type="html">Fontface Teehanlax in Modern CSS Layouts: The Essential Characteristics</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/wp-content/uploads/2009/10/fontface_craigmod.gif" medium="image">
			<media:title type="html">Fontface Craigmod in Modern CSS Layouts: The Essential Characteristics</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/wp-content/uploads/2009/10/fontface_nicewebtype_museo.gif" medium="image">
			<media:title type="html">Fontface Nicewebtype Museo in Modern CSS Layouts: The Essential Characteristics</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/wp-content/uploads/2009/10/typekit_forabeautifulweb.jpg" medium="image">
			<media:title type="html">Typekit Forabeautifulweb in Modern CSS Layouts: The Essential Characteristics</media:title>
		</media:content>

		<media:content url="http://media.smashingmagazine.com/wp-content/uploads/2009/10/kernest_ruleroftheinterwebs.gif" medium="image">
			<media:title type="html">Kernest Ruleroftheinterwebs in Modern CSS Layouts: The Essential Characteristics</media:title>
		</media:content>
	</item>
	</channel>
</rss>
