<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CSS Tutorial &#187; CSS Page Layouts</title>
	<atom:link href="http://www.csstutorial.net/category/css-page-layouts/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.csstutorial.net</link>
	<description>CSS Tutorial</description>
	<lastBuildDate>Mon, 30 Jan 2012 06:00:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Centering Text with CSS</title>
		<link>http://www.csstutorial.net/2010/06/centering-text-with-css/</link>
		<comments>http://www.csstutorial.net/2010/06/centering-text-with-css/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 00:29:25 +0000</pubDate>
		<dc:creator>Andrea Barnett</dc:creator>
				<category><![CDATA[CSS Basics]]></category>
		<category><![CDATA[CSS Misc]]></category>
		<category><![CDATA[CSS Page Layouts]]></category>
		<category><![CDATA[Killer CSS Tips and Tricks]]></category>
		<category><![CDATA[centering text]]></category>

		<guid isPermaLink="false">http://www.csstutorial.net/?p=881</guid>
		<description><![CDATA[Centering text and other elements can easily be done with the CSS text-align property. It can be applied to a division, the p tag - pretty much any block-level element.]]></description>
			<content:encoded><![CDATA[<p>Centering text and other elements can easily be done with the CSS text-align property. It can be applied to a division, the p tag &#8211; pretty much any block-level element.</p>
<p>Applying this to an internal or external stylesheet:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">p <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>or this to inline styling:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;p style=&quot;text-align: center;&quot;&gt;This is centered text&lt;/p&gt;</pre></div></div>

<p style="text-align: center;">will center your text.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csstutorial.net/2010/06/centering-text-with-css/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Using the CSS z-index</title>
		<link>http://www.csstutorial.net/2010/06/using-the-css-z-index/</link>
		<comments>http://www.csstutorial.net/2010/06/using-the-css-z-index/#comments</comments>
		<pubDate>Sat, 19 Jun 2010 15:07:00 +0000</pubDate>
		<dc:creator>Andrea Barnett</dc:creator>
				<category><![CDATA[CSS Page Layouts]]></category>
		<category><![CDATA[Killer CSS Tips and Tricks]]></category>
		<category><![CDATA[stacking order of elements]]></category>
		<category><![CDATA[z-index]]></category>

		<guid isPermaLink="false">http://www.csstutorial.net/?p=799</guid>
		<description><![CDATA[By default, the elements of a website line themselves up next to or under each other automatically. However, at times, the design requires them to overlap.  When that happens, the stacking order becomes important, and the natural stacking order will need to be manipulated.]]></description>
			<content:encoded><![CDATA[<p>By default, the elements of a website line themselves up next to or under each other automatically. However, at times, the design requires them to overlap.  When that happens, the stacking order becomes important, and the natural stacking order will need to be manipulated.</p>
<p>Without applying any CSS to the elements within the wrapper on the demo page here, this code:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;wrapper&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;aqua&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;aqua.gif&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;aqua square&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;green&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;green.gif&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;green square&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h1</span>&gt;</span>The z-index and CSS -- When the Stacking Order Matters<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h1</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>All elements appear in their natural order as they are entered in the HTML<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span></pre></div></div>

<p>creates a page that looks <a href='http://www.csstutorial.net/wp-content/uploads/2010/06/z-index01.html'>like this</a>. As you see, there is no point worrying about stacking order, the elements aline themselves automatically.</p>
<p>However, when positioning is applied and they start overlapping, we can change their stacking order if we need to. When it comes to z-index and the stacking order, one must note the following:</p>
<ol>
<li>Z-index only works on relative or absolute positioned elements</li>
<li>The default z-index is zero</li>
</ol>
<p><a href='http://www.csstutorial.net/wp-content/uploads/2010/06/z-index02.html'>Here</a>, I have added an absolute position to the h1 and a relative position to the green box to move them up and down-and-left, respectively.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">h1 <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#green</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">50px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-50px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
h2 <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">50px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span> <span style="color: #808080; font-style: italic;">/*This is here to push the line below the green box */</span></pre></div></div>

<p>That means that the aqua image, which does NOT have positioning applied, sits on the default level of zero.  Adding any kind of z-index to the element is useless &#8211; it won&#8217;t budge because of the lacking positioning.  But we can move the text and the box either under (with a negative z-index) or on top (with a positive z-index) the not-positioned, zero-level aqua box.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#green</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">50px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-50px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> -<span style="color: #cc66cc;">2</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
h1 <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> -<span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>creates <a href='http://www.csstutorial.net/wp-content/uploads/2010/06/z-index03.html'>this page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csstutorial.net/2010/06/using-the-css-z-index/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multiple Background Images with CSS</title>
		<link>http://www.csstutorial.net/2010/05/multiple-background-images-with-css/</link>
		<comments>http://www.csstutorial.net/2010/05/multiple-background-images-with-css/#comments</comments>
		<pubDate>Sat, 08 May 2010 11:48:48 +0000</pubDate>
		<dc:creator>Andrea Barnett</dc:creator>
				<category><![CDATA[CSS Basics]]></category>
		<category><![CDATA[CSS Misc]]></category>
		<category><![CDATA[CSS Page Layouts]]></category>
		<category><![CDATA[Killer CSS Tips and Tricks]]></category>
		<category><![CDATA[multiple background images]]></category>

		<guid isPermaLink="false">http://www.csstutorial.net/?p=655</guid>
		<description><![CDATA[At times, it makes more sense to use background images than to insert them directly into the page.  And while each element - like your body tag - can hold only one background image, they can be applied to several elements.]]></description>
			<content:encoded><![CDATA[<p>At times, it makes more sense to use background images than to insert them directly into the page.  And while each element &#8211; like your body tag &#8211; can hold only one background image, they can be applied to several elements.</p>
<p>But pretty much every selector can hold a background image.  On <a href='http://www.csstutorial.net/wp-content/uploads/2010/05/multiple-background-images.html'>THIS PAGE</a>, I have added the image to the html tag, the body tag, and the h1 and h2 tags (these are &#8216;selectors&#8217;) &#8211; like so:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">body <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">bgimage.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-y</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
html <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">bgimage.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-y</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
h1 <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">bgimage.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
h2 <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">bgimage.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #cc00cc;">#ffc</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">250px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">150px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#wrapper</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">250px</span><span style="color: #00AA00;">;</span> 
<span style="color: #808080; font-style: italic;">/*I'm using the right and left padding of the wrapper to keep
the content off the images */</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Note that I&#8217;m a bit lazy at the moment, and am using the same image for all four selectors.  Taking a closer look at each of them, also shows a bit more how things work:</p>
<p>The html tag (image displayed on the left) repeats the flower all the way down the monitor, regardless of how much content there is.  Resize your window and see what happens.</p>
<p>The body tag, where the image is displayed to the right, only shows the image as far as the content goes.</p>
<p>The h1 tag only shows as much of the image as the space its content is taking up.</p>
<p>The h2 tag also has some height added to it (exactly 150px, the height of the background image), so it does show the entire image.  I&#8217;ve also added the background color to more clearly demonstrate the space that&#8217;s taken up by h2.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csstutorial.net/2010/05/multiple-background-images-with-css/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Styling Lists with CSS</title>
		<link>http://www.csstutorial.net/2010/04/styling-lists-with-css/</link>
		<comments>http://www.csstutorial.net/2010/04/styling-lists-with-css/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 23:50:03 +0000</pubDate>
		<dc:creator>Andrea Barnett</dc:creator>
				<category><![CDATA[CSS Basics]]></category>
		<category><![CDATA[CSS Misc]]></category>
		<category><![CDATA[CSS Page Layouts]]></category>
		<category><![CDATA[Killer CSS Tips and Tricks]]></category>
		<category><![CDATA[ordered lists]]></category>
		<category><![CDATA[styling list items]]></category>
		<category><![CDATA[unordered lists]]></category>

		<guid isPermaLink="false">http://www.csstutorial.net/?p=659</guid>
		<description><![CDATA[We've already discussed navigation lists and list bullet images, but sometimes, a list is just a list. There are two types - the ordered list and the unordered list. The ordered list counts the items; the unordered list marks the individual items with bullets or other markers. The HTML is simple.]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve already discussed navigation lists and list bullet images, but sometimes, a list is just a list. There are two types &#8211; the ordered list and the unordered list. The ordered list counts the items; the unordered list marks the individual items with bullets or other markers. The HTML is simple.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ol</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ol</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span></pre></div></div>

<p>And, without any styling applied at all, that looks <a href='http://www.csstutorial.net/wp-content/uploads/2010/04/lists01.html'>Like This</a>.</p>
<p>We can affect the list item markers with some simple CSS and the list-style-property controls those.  For unordered lists, we can chose between ul styles: disc, square, circle, or none  &#8211; <a href='http://www.csstutorial.net/wp-content/uploads/2010/04/lists02.html'>which looks like this</a>, or between ol styles: decimal, decimal-leading-zero, lower-roman, upper-roman, lower-alpha, upper-alpha, lower-greek, upper-greek, lower-latin, upper-latin, armenian, or georgian, <a href='http://www.csstutorial.net/wp-content/uploads/2010/04/lists03.html'>which looks like that</a>.</p>
<p>Other than that, we can style the ul tag and the li tag.  Anything added to the ul tag, affects the entire list, where properties applied to the li tag will affect the individual list items. So this CSS</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">ul <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ffe566</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">25px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
ol <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#828772</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">15px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
ul li <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fc6</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
ol li <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#9cc</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">35px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><a href='http://www.csstutorial.net/wp-content/uploads/2010/04/lists04.html'>will create that</a>.</p>
<p>(Note that I had to add the &#8216;ul&#8217; or &#8216;ol&#8217; in front of the &#8216;li&#8217; so I could target specifically either list&#8217;s items.  Had I just used &#8216;li&#8217;, any styling would have affected all of them regardless.) &hellip; <a href='http://www.csstutorial.net/wp-content/uploads/2010/04/lists05.html'>example: adding a larger font size to &#8216;just li&#8217;</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csstutorial.net/2010/04/styling-lists-with-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3-Column, Fixed Width Layout with CSS</title>
		<link>http://www.csstutorial.net/2010/04/3-column-layout/</link>
		<comments>http://www.csstutorial.net/2010/04/3-column-layout/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 00:06:35 +0000</pubDate>
		<dc:creator>Andrea Barnett</dc:creator>
				<category><![CDATA[CSS Basics]]></category>
		<category><![CDATA[CSS Page Layouts]]></category>
		<category><![CDATA[Killer CSS Tips and Tricks]]></category>
		<category><![CDATA[3-column layout]]></category>

		<guid isPermaLink="false">http://www.csstutorial.net/?p=602</guid>
		<description><![CDATA[The three-column layout is probably the second most common layout used for websites.  There's usually a header and a footer - and then some content, maybe a sidebar for navigation, a column in the middle with some content info, and another column with some additional stuff, whatever that may be.  What you put inside your columns doesn't matter - the way to achieve the 3-column layout stays the same.]]></description>
			<content:encoded><![CDATA[<p>The three-column layout is probably the second most common layout used for websites.  There&#8217;s usually a header and a footer &#8211; and then some content, maybe a sidebar for navigation, a column in the middle with some content info, and another column with some additional stuff, whatever that may be.  What you put inside your columns doesn&#8217;t matter &#8211; the way to achieve the 3-column layout stays the same.</p>
<p>So let&#8217;s start with our basic HTML to put all the parts on paper &#8212; or in our case, on line.  This is the basic outline of what&#8217;s between the body tags:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;wrapper&quot;</span>&gt;</span>
&nbsp;
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;header&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
&nbsp;
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;column-left&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
&nbsp;
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;column-center&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
&nbsp;
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;column-right&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
&nbsp;
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;footer&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div>

<p>For the entire HTML code &#8211; to include some filler content &#8211; see <a href='http://www.csstutorial.net/wp-content/uploads/2010/04/3-column01.html'>Basic HTML &#8211; No Styling</a>.  To see the code of the example page, just right-click and chose &#8220;View Source&#8221; from the drop-down.  Most browsers offer that feature.</p>
<p>And of course what we get, is NOT a 3-column layout.  It&#8217;s just one division on top of the next.  That&#8217;s because we haven&#8217;t gotten to the &#8216;with CSS&#8217; part of the title of this post yet.  So let&#8217;s already!!</p>
<p>First, and just to make things easier to see, I will apply the fixed width and center my page.  Here&#8217;s a post with the finer details <a href="http://www.csstutorial.net/2010/02/how-to-create-a-center-aligned-page-with-css/">Center-aligning a Website</a> right here already.  Here is the CSS that does that:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #00AA00;">*</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#wrapper</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">980px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">silver</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#header</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">white</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#column-left</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">red</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#column-center</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">yellow</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#column-right</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">purple</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#footer</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">green</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>(Please note that you should really be using hex or rbg color codes, but for the purpose of this demonstration, color names are just easier to deal with.)</p>
<p>And it looks <a href='http://www.csstutorial.net/wp-content/uploads/2010/04/3-column02.html'>Like This</a>.  Now we just have to get our columns to act like columns and line up next to each other.  There are different ways to do this, but I prefer to just float them all.  So we&#8217;ll give them all a width and add <strong>float: left;</strong> to our three columns:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#column-left</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">250px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">red</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#column-center</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">480px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">yellow</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#column-right</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">250px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">purple</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>At this point, it&#8217;s important to be aware of a special characteristic of floats &#8211; I picture them as balloons &#8211; they float above our heads, without taking up any actual space among us.  So just as you can place a box under a balloon without the two affecting each other&#8217;s space, our footer will act like the floated divisions are not even there, and line itself up neatly right under the header &#8211; where we do NOT want it to be.  So we have to give the footer a special set of instructions:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#footer</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">both</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">green</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>and now the whole thing looks <a href='http://www.csstutorial.net/wp-content/uploads/2010/04/3-column03.html'>Like This</a>.  And there you have it!</p>
<p>A few things can go wrong, and here is some easy, preliminary damage control:  If you see your columns NOT all sitting next to each other, it&#8217;s likely because the total sum of all their widths, paddings, and margins combined is GREATER THAN the width of their containing wrapper.  So put one of your columns on a diet and cut its width down some &#8211; and things should fall into place beautifully.  And if not, ask for help at the <a href="http://www.killersites.com/community/index.php?/index">Killersites Community</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csstutorial.net/2010/04/3-column-layout/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>How to Position Text around an Image with CSS</title>
		<link>http://www.csstutorial.net/2010/03/how-to-position-text-around-an-image-with-css/</link>
		<comments>http://www.csstutorial.net/2010/03/how-to-position-text-around-an-image-with-css/#comments</comments>
		<pubDate>Sat, 27 Mar 2010 13:47:57 +0000</pubDate>
		<dc:creator>Andrea Barnett</dc:creator>
				<category><![CDATA[CSS Basics]]></category>
		<category><![CDATA[CSS Misc]]></category>
		<category><![CDATA[CSS Page Layouts]]></category>
		<category><![CDATA[Killer CSS Tips and Tricks]]></category>
		<category><![CDATA[floating image; flow text around image]]></category>

		<guid isPermaLink="false">http://www.csstutorial.net/?p=585</guid>
		<description><![CDATA[It's always nice to have some pictures to go along with your text.  However, if you just use the html to insert a photo into your text flow, you'll find that it breaks up the flow of your text and just plops itself ungracefully right in the middle of your paragraph without rhyme or reason.]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s always nice to have some pictures to go along with your text.  However, if you just use the html to insert a photo into your text flow, you&#8217;ll find that it <img src="http://www.csstutorial.net/wp-content/uploads/2010/03/leia.jpg" alt="German Shepherd taking a nap"> breaks up the flow of your text and just plops itself ungracefully right in the middle of your paragraph without rhyme or reason.</p>
<p>Fortunately, a little bit of CSS positioning can help us out here. Adding this to your CSS:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">img <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>will make the same thing look <a href='http://www.csstutorial.net/wp-content/uploads/2010/03/image-float.html'>like this</a>.</p>
<p>Now all we have to do is add some margin or padding to create a bit of space around the image</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">img <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">25px</span> <span style="color: #933;">25px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><a href='http://www.csstutorial.net/wp-content/uploads/2010/03/image-float21.html'>And here you go</a>.
<p>However, if you use the image tag for your CSS, all the images in your site will float.  Since this is a Basic CSS tip, I&#8217;ve used it for demonstration purposes only.  A more practical approach would be to add a special class to the images you want to float.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;floating&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.csstutorial.net/wp-content/uploads/2010/03/leia.jpg&quot;</span></span>
<span style="color: #009900;"> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;German Shepherd taking a nap&quot;</span>&gt;</span></pre></div></div>

<p>and write the CSS like this:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">img<span style="color: #6666ff;">.floating</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">25px</span> <span style="color: #933;">25px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.csstutorial.net/2010/03/how-to-position-text-around-an-image-with-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Add a Background Image with CSS</title>
		<link>http://www.csstutorial.net/2010/03/adding-a-background-image-with-css/</link>
		<comments>http://www.csstutorial.net/2010/03/adding-a-background-image-with-css/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 11:47:16 +0000</pubDate>
		<dc:creator>Andrea Barnett</dc:creator>
				<category><![CDATA[CSS Basics]]></category>
		<category><![CDATA[CSS Misc]]></category>
		<category><![CDATA[CSS Page Layouts]]></category>
		<category><![CDATA[Killer CSS Tips and Tricks]]></category>
		<category><![CDATA[background image with CSS]]></category>

		<guid isPermaLink="false">http://www.csstutorial.net/?p=511</guid>
		<description><![CDATA[Background images, just as the name implies, are part of the BACKGROUND of a website, not part of the actual content.  The most common place to add a background image to, is the entire canvas - aka the body tag.]]></description>
			<content:encoded><![CDATA[<p>Background images, just as the name implies, are part of the BACKGROUND of a website, not part of the actual content.  The most common place to add a background image to, is the entire canvas &#8211; aka the body tag.</p>
<p>The CSS to add an image to a body tag is simple:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">body <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">bgimage.jpg</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>I&#8217;m just using a random image for demonstration purposes, and <a href='http://www.csstutorial.net/wp-content/uploads/2010/03/background01.html'>THIS</a> this is what we get. And we can note the following:</p>
<ol>
<li>It&#8217;s a very beautiful flower (grew in my house)</li>
<li>It repeats itself and covers the entire background &#8211; that is called &#8217;tiling&#8217; (think bathroom)</li>
<li>It pretty much makes it impossible to read the actual page content</li>
</ol>
<p>There are also special background images that are designed to tile unnoticeable -for example this one:<br />
<a href="http://www.csstutorial.net/wp-content/uploads/2010/03/bgimage01.jpg"><img src="http://www.csstutorial.net/wp-content/uploads/2010/03/bgimage01.jpg" alt="Background Image optimized to tile unnoticeable " title="Tiling Background Image" width="150" height="150" class="aligncenter size-full wp-image-519" /></a> which will create <a href='http://www.csstutorial.net/wp-content/uploads/2010/03/background02.html'>THIS</a>.</p>
<p>CSS also gives us the tools to direct our background image how we want it.  The default, as you can see, is that it repeats itself horizontally AND vertically to fill the entire background, regardless of size.  Sometimes we might want the image appear only horizontally or vertically &#8211; and maybe not directly on the edge of the viewing area. </p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">body <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">bgimage.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-x</span> <span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>creates a background that is <a href='http://www.csstutorial.net/wp-content/uploads/2010/03/background03.html'>repeated vertically at the bottom of the content</a>, and this background image <a href='http://www.csstutorial.net/wp-content/uploads/2010/03/background04.html'>repeated horizontally on the right</a> is created by this CSS:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">body <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">bgimage.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-y</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>There are many more ways for us to control our background.  In addition to the above, we could:</p>
<ul>
<li>Add a background color (background: url(image.jpg) #555555;)</li>
<li>Display the image only one time (no-repeat)</li>
<li>Position it more specifically (options are: top, bottom, left, right, center, x-15px, or y-20% (measurements and units are optional))</li>
<li>Keep it from scrolling (background: url(image.jpg) fixed;)</li>
<li>Any combination of any of the above</li>
</ul>
<p>A wise combination of all these techniques might actually allow us to create a decorative background that does NOT interfere with the actual content. <a href='http://www.csstutorial.net/wp-content/uploads/2010/03/background05.html'>Like This</a>.  The following CSS created this page &#8211; and please note that I also added some padding to keep the content off the image, which makes things soooo much easier to read:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">body <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">bgimage.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #cc00cc;">#f6f1b9</span> <span style="color: #993333;">fixed</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">250px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Background images can be added to pretty much any tag.  They can be added to divisions, used to create fancy navigation menus, spruce up a list, decorate h tags,&#8230;. It&#8217;s so exciting!!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csstutorial.net/2010/03/adding-a-background-image-with-css/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>How to Delete Browser Default Settings in CSS</title>
		<link>http://www.csstutorial.net/2010/03/deleting-browser-default-settings-in-css/</link>
		<comments>http://www.csstutorial.net/2010/03/deleting-browser-default-settings-in-css/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 11:47:40 +0000</pubDate>
		<dc:creator>Andrea Barnett</dc:creator>
				<category><![CDATA[CSS Basics]]></category>
		<category><![CDATA[CSS Misc]]></category>
		<category><![CDATA[CSS Page Layouts]]></category>
		<category><![CDATA[Killer CSS Tips and Tricks]]></category>
		<category><![CDATA[cross-browser compatability]]></category>
		<category><![CDATA[default settings]]></category>

		<guid isPermaLink="false">http://www.csstutorial.net/?p=504</guid>
		<description><![CDATA[Every browser has its own default settings for font size, margins and/or padding around certain elements, etc.   Webdesigners should aim to have their sites display well on all kinds of browsers, but these different default settings can easily lead to problems. ]]></description>
			<content:encoded><![CDATA[<p>Every browser has its own default settings for font size, margins and/or padding around certain elements, etc.   Webdesigners should aim to have their sites display well on all kinds of browsers, but these different default settings can easily lead to problems.  Sometimes, the differences are subtle and have no effect on the design, but they can also cause a page to totally break in one browser vs. another.</p>
<p>To demonstrate, you could look at <a href='http://www.csstutorial.net/wp-content/uploads/2010/03/browser-default.html'>THIS PAGE</a> via <a href="http://browsershots.org/">Browsershots.org</a>. (Just copy and paste &#8216;this page&#8217; URL, then go to Browsershots and play around).</p>
<p>There is a quick and easy fix so.  Start your stylesheet out with this:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #00AA00;">*</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>The &#8216;*&#8217; stands for any and all properties on your page, and this code sets them all to ZERO.  Of course, now you&#8217;ll have to add your margins, padding, and any borders back in with your CSS in the right places, but usually, you&#8217;d have to do that anyway &#8211; and this way, it&#8217;s much easier to create a cross-browser compatible site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csstutorial.net/2010/03/deleting-browser-default-settings-in-css/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Styling a Horizontal Navigation Menu with CSS</title>
		<link>http://www.csstutorial.net/2010/02/how-to-style-a-horizontal-navigation-menu-with-css/</link>
		<comments>http://www.csstutorial.net/2010/02/how-to-style-a-horizontal-navigation-menu-with-css/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 20:23:48 +0000</pubDate>
		<dc:creator>Andrea Barnett</dc:creator>
				<category><![CDATA[CSS Basics]]></category>
		<category><![CDATA[CSS Misc]]></category>
		<category><![CDATA[CSS Page Layouts]]></category>
		<category><![CDATA[Killer CSS Tips and Tricks]]></category>
		<category><![CDATA[horizontal list]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[navigation]]></category>

		<guid isPermaLink="false">http://www.csstutorial.net/?p=488</guid>
		<description><![CDATA[It's true:  Your navigation items are really a LIST.  Bread, Milk, Sugar, Coffee, Home, Contact Us, About, Cheese, Tomatoes, Sitemap.  See, it's a LIST!!  And it should be coded and styled like a list.]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s true:  Your navigation items are really a LIST.  Bread, Milk, Sugar, Coffee, Home, Contact Us, About, Cheese, Tomatoes, Sitemap.  See, it&#8217;s a LIST!!  And it should be coded and styled like a list.  It&#8217;s easy.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;navigation&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Home<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>About<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Stuff<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Other Stuff<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Contact Us<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span></pre></div></div>

<p>And it looks like <a href='http://www.csstutorial.net/wp-content/uploads/2010/02/nav-list01.html'>THIS</a>.  Note how I&#8217;ve given the ul an id. I call it &#8216;navigation&#8217;, but you can call it &#8216;hamster-parade&#8217; or whatever you chose.  However, I&#8217;ve long since discovered that using practical and meaningful names for classes, IDs, file names, and images is VERY helpful. So let&#8217;s stick with &#8216;navigation&#8217;.  The reason for this ID here is that it will allow me to apply a specific style to only the navigation list, while other lists within my site can be styled totally different.</p>
<p>But even so our navigation list is a list, most of the time, we don&#8217;t want it to look like one.  So first, let&#8217;s get rid of the bullet:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">ul<span style="color: #cc00cc;">#navigation</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>And to get our list items to line up horizontally, we add:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">ul<span style="color: #cc00cc;">#navigation</span> li <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">inline</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">white-space</span><span style="color: #00AA00;">:</span><span style="color: #993333;">nowrap</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p> The &#8216;display: inline;&#8217; line creates the horizontal line. &#8216;white-space:no-wrap&#8217; prevents our list from wrapping and turning into a 2-line list, which could possible happen when the page is viewed at lower resolutions or the font is increased beyond a certain size in the browser view. And here you go: <a href='http://www.csstutorial.net/wp-content/uploads/2010/02/nav-list02.html'>A Horizontal Navigation List without Bullets</a>.  At this point, it&#8217;s kind of ugly, but how to dress it up will be a different post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csstutorial.net/2010/02/how-to-style-a-horizontal-navigation-menu-with-css/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>2-Column, Center-aligned Fixed Width Layout with CSS</title>
		<link>http://www.csstutorial.net/2010/02/creating-a-basic-2-column-center-aligned-fixed-width-layout-with-css/</link>
		<comments>http://www.csstutorial.net/2010/02/creating-a-basic-2-column-center-aligned-fixed-width-layout-with-css/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 16:46:19 +0000</pubDate>
		<dc:creator>Andrea Barnett</dc:creator>
				<category><![CDATA[CSS Basics]]></category>
		<category><![CDATA[CSS Page Layouts]]></category>
		<category><![CDATA[Killer CSS Tips and Tricks]]></category>
		<category><![CDATA[center-aligned layout]]></category>
		<category><![CDATA[fixed width]]></category>
		<category><![CDATA[two-column layout]]></category>

		<guid isPermaLink="false">http://www.csstutorial.net/?p=463</guid>
		<description><![CDATA[How to build a simple center-aligned fixed width two-column layout.]]></description>
			<content:encoded><![CDATA[<p>This type of layout is used a lot, and for good reason.  It works. </p>
<p>So let&#8217;s start off by looking at the HTML:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot;</span>
<span style="color: #00bbdd;">&quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">http-equiv</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Content-Type&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/html; charset=iso-8859-1&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;author&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Andrea Barnett for Killersites&quot;</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>2-Column, Center-aligned Fixed Width Layout with CSS<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;header&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h1</span>&gt;</span>This is the Page Header<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h1</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;left-column&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>The Navigation<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;right-column&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>The Main Content<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;footer&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>The Page Footer Goes Here<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></div></div>

<p><a href='http://www.csstutorial.net/wp-content/uploads/2010/02/layout011.html'>Basic Layout Components</a></p>
<p>I am going to apply a different background color to each division just to make it more obvious where exactly each division is.  Colors should be indicated by hex codes &#8211; for example #FFFFFF for white or #000000 for black.  But for the purpose of this demonstration, I&#8217;ll use color names, as it makes things more obvious.  So I&#8217;m adding the following CSS code to the header:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">&lt;style type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span><span style="color: #00AA00;">&gt;</span>
&nbsp;
<span style="color: #cc00cc;">#header</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">red</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#left-column</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">yellow</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#right-column</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">teal</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#footer</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> pink<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
&lt;/style<span style="color: #00AA00;">&gt;</span></pre></div></div>

<p>To achieve the fixed width portion of the layout, I&#8217;m adding a wrapper division around the entire body html we have so far, like so:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">&lt;body<span style="color: #00AA00;">&gt;</span>
&nbsp;
&lt;div id<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;wrapper&quot;</span><span style="color: #00AA00;">&gt;</span>
&nbsp;
&lt;div id<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;header&quot;</span><span style="color: #00AA00;">&gt;</span>
...
&nbsp;
&lt;/div<span style="color: #00AA00;">&gt;</span> &lt;!-- This closes the wrapper division --<span style="color: #00AA00;">&gt;</span>
&nbsp;
&lt;/body<span style="color: #00AA00;">&gt;</span></pre></div></div>

<p>and in the CSS, I&#8217;m giving this wrapper division a background color just for demonstration purposes &#8211; and a width.  The width is based on current trends per <a href="http://www.w3schools.com/browsers/browsers_display.asp">W3Schools Browser Trends</a>.  According to this information, the vast majority of all surfers views at resolutions of 1280 or higher, so I&#8217;ll shoot for 1280px.  To allow room for the scroll bar and a bit of the (white) body background to show, I&#8217;ll set the width of my wrapper at 1200px.  The CSS that actually centers everything is a right and left margin of &#8216;auto&#8217; to the wrapper:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#wrapper</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">silver</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1200px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>And now we see <a href='http://www.csstutorial.net/wp-content/uploads/2010/02/layout02.html'>THIS</a>. Isn&#8217;t it just beautiful?  The division is centered by this line</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span></pre></div></div>

<p>The &#8217;0&#8242; tells the browser to display a margin of zero for the top and bottom of the wrapper division (that can be changed if you want a top and/or bottom margin) and to automatically calculate the right and left margin so the division will center.  But what about the 2-column thing? I&#8217;m getting to that!</p>
<p>So we&#8217;ve set our wrapper width at 1200px.  That means whatever fits inside, cannot be any larger that those 1200px.  So I&#8217;ll set my left-column division to 300px and the right-column division to 900px.  But that does not yet create the 2-column layout we&#8217;re working on.  In order to achieve that, I have to get the divisions to line up next to each other, and there are several ways to achieve that. For this example, I&#8217;ll float the left-column by adding this CSS</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#left-column</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">yellow</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">300px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#right-column</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">teal</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">900px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">300px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>and just to make everything more realistic, I&#8217;ll add a bit more content to my html, and now we see <a href='http://www.csstutorial.net/wp-content/uploads/2010/02/layout03.html'>THIS</a> &#8211; this does NOT look quite right.  So what&#8217;s happening?  That&#8217;s a topic for a whole other post, but in a nutshell:  A floated division is removed from the actual flow of things &#8211; kind of hovering over the floor like a balloon, so not affecting the actual floor space.  The non-floated divisions, however, do take up &#8216;floor space&#8217; and fall in place in their natural order.  So the footer division follows the content division, ignoring our entire &#8216;balloon&#8217;.  There&#8217;s an easy fix, so:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#footer</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> pink<span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">both</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p> and <a href='http://www.csstutorial.net/wp-content/uploads/2010/02/layout04.html'>voil&aacute;</a> &#8211; &#8216;clear: both;&#8217; told our footer division to do just that &#8211; clear any floated or non-floated divisions and get in line where it belongs.</p>
<p>And here you go &#8211; a very basic 2-column, center-aligned fixed width layout with CSS.</p>
<p> As you get rid of the ridiculous background colors and add your own styling &#8211; mainly margins and padding to the right and left column &#8211; you will probably find that your lay-out breaks. That is because any right and/or left margin and/or padding adds to the total width of your division.  Right now, the wrapper is 1200px wide, same as the total of the right (900px) and left (300px) column.  But if you add a 10px right/left padding to the right-column, it&#8217;s suddenly 920px wide and no longer fits next to the left column.  So you have to adjust the total width of right-column to 880px.  Because 10px left padding + 10px right padding plus 880px = 900px.  Simple math.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csstutorial.net/2010/02/creating-a-basic-2-column-center-aligned-fixed-width-layout-with-css/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>

