<?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>Dave PC Guy &#187; formatting</title>
	<atom:link href="http://www.davepcguy.com/archive/tag/formatting/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.davepcguy.com</link>
	<description>Computers and Technology</description>
	<lastBuildDate>Fri, 10 Sep 2010 15:43:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>CSS3 Lesson 3: Background Information is Essential</title>
		<link>http://www.davepcguy.com/archive/css3-lesson-3-background-information-is-essential/</link>
		<comments>http://www.davepcguy.com/archive/css3-lesson-3-background-information-is-essential/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 02:34:41 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[formatting]]></category>
		<category><![CDATA[lesson]]></category>
		<category><![CDATA[webpage]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://www.davepcguy.com/?p=969</guid>
		<description><![CDATA[Let&#8217;s have a look at backgrounds. In the previous two tutorials, I&#8217;ve covered borders and opacity. In this tutorial, we&#8217;ll cover some of the basic CSS3 additions to the background properties. If you have no idea how to deal with backgrounds in CSS, read my tutorial on backgrounds pre-CSS3. CSS3 is gaining momentum in the]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss3-lesson-3-background-information-is-essential%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss3-lesson-3-background-information-is-essential%2F&amp;source=clrkmck&amp;style=normal&amp;service_api=clrkmck%3AR_a73f58a91ed3515157df75ab6c37730f&amp;hashtags=css,Design,formatting,lesson,webpage,website" height="61" width="50" /><br />
			</a>
		</div>
<p>Let&#8217;s have a look at backgrounds. In the previous two tutorials, I&#8217;ve covered <a title="CSS3 Borders Tutorial" href="http://www.davepcguy.com/archive/css3-lesson-2-all-about-borders/">borders</a> and <a title="Border Radius and Opacity tutorial" href="http://www.davepcguy.com/archive/css-lesson-7-border-radius-and-opacity/">opacity</a>. In this tutorial, we&#8217;ll cover some of the basic CSS3 additions to the background properties. If you have no idea how to deal with backgrounds in CSS, read <a title="CSS lesson 1 text properties and backgrounds" href="http://www.davepcguy.com/archive/css-lesson-1/">my tutorial</a> on backgrounds pre-CSS3. CSS3 is gaining momentum in the Web development world and many properties are already supported by most browsers (Firefox, Konqueror, Safari, and Chrome) as well as some minor browser (Opera). If you want to stay on top of the game, you have to learn the new stuff and employ the new techniques you&#8217;re presented with.</p>
<p>In this tutorial, I&#8217;m going to cover:</p>
<ul>
<li>background sizes</li>
<li>multiple backgrounds</li>
<li>background origin/clip</li>
</ul>
<p><span id="more-969"></span><br />
I will provide illustrations as to what each property looks like and you can also view my CSS3 <a title="testing sample for CSS3 backgrounds" href="http://test.davepcguy.com/scripts/CSS3test/secondtest.html">testing sample</a> that features this tutorial&#8217;s properties (among others). The properties will be compatible with both webkit (Safari and Chrome) and the Mozilla engine. Internet Explorer, unfortunately, does not yet support most CSS3 properties. I&#8217;d like to also note that I use a Mozilla Firefox 3.5.2 (which apparently has tons of trouble using ANY of these properties) and Chrome 3.0.195.33 (which seems to render everything perfectly).</p>
<hr />
</p>
<hr />
<h1><a href="http://www.davepcguy.com/wp-content/uploads/2009/12/backgroundsize.png"><img class="size-full wp-image-974 aligncenter" title="backgroundsize" src="http://www.davepcguy.com/wp-content/uploads/2009/12/backgroundsize.png" alt="backgroundsize" width="498" height="111" /></a></h1>
<hr />The <strong>background-size </strong>property is very straight forward. You simply choose the width and the height as the values. You can use percentages, pixels, and other measurements.</p>
<p>First, why do we use this? Well, let&#8217;s say you have an image that&#8217;s too big or too small and you want to resize it without using photoshop or another tool. There are few reasons why you&#8217;d want that. Let&#8217;s say you want the same image on one website to be 400&#215;500 px while on another site, you want it to be 200&#215;250 yet you don&#8217;t want to create the extra file.</p>
<p>In my example, I have a strangely sized logo that is 474 px by 185 px. Now, I want it to be about 90 px tall, so that&#8217;s be 231 width. Here&#8217;s what the code would look like:</p>
<pre class="brush: css;">
background:url(background1.png) no-repeat center;
	-webkit-background-size: 231px 90px;
	-moz-background-size: 231px 90px;
	-o-background-size: 231px 90px;
	-khtml-background-size: 231px 90px;
background-size: 231px 90px;
</pre>
<p>This code should show up properly on the above-mentioned browsers. I&#8217;ve had no trouble with Chrome but my Firefox is being stubborn. The result should look something like this:</p>
<p style="text-align: center;">
<div id="attachment_971" class="wp-caption aligncenter" style="width: 528px"><a href="http://www.davepcguy.com/wp-content/uploads/2009/12/backgrounds1.PNG"><img class="size-full wp-image-971 " title="css3 backgrounds size" src="http://www.davepcguy.com/wp-content/uploads/2009/12/backgrounds1.PNG" alt="correctly rendered background" width="518" height="274" /></a><p class="wp-caption-text">correctly rendered background</p></div>
<p>As opposed to this:</p>
<p style="text-align: left;">
<div id="attachment_972" class="wp-caption aligncenter" style="width: 530px"><a href="http://www.davepcguy.com/wp-content/uploads/2009/12/backgrounds2.png"><img class="size-full wp-image-972 " title="Background size" src="http://www.davepcguy.com/wp-content/uploads/2009/12/backgrounds2.png" alt="incorrectly rendered background" width="520" height="186" /></a><p class="wp-caption-text">incorrectly rendered background</p></div>
<p>Note that I am creating these images as I go so whenever I add more backgrounds and use other CSS3 properties, my <a title="CSS3 testing website" href="http://test.davepcguy.com/scripts/CSS3test/secondtest.html">testing</a> site will look differently.</p>
<p style="text-align: center;">
<p style="text-align: center;"><a href="http://www.davepcguy.com/wp-content/uploads/2009/12/multiplebackgrounds.png"><img class="size-full wp-image-979 aligncenter" title="multiplebackgrounds" src="http://www.davepcguy.com/wp-content/uploads/2009/12/multiplebackgrounds.png" alt="multiplebackgrounds" width="523" height="117" /></a></p>
<hr />Ever wished you could stack multiple backgrounds without having to create multiple divs? Well, that&#8217;s what this new background extension property does. You can stack multiple backgrounds and using the rgba () value, you can even change opacity of color-based backgrounds.</p>
<p>Here&#8217;s the concept. Okay, so on my example page, I want the background to have a greyish background with a slight gradient. I&#8217;ll make a pixel wide pretty long strip that goes from white to nothingness on top of an actual grey background. On top of all that, I&#8217;d love to add some kind of a swirl on the left and a nice swirl in the right corner. Let&#8217;s see how that&#8217;ll look in code:</p>
<pre class="brush: css;">
.bgr {
background: rgba(115, 115, 115, .8);
background-image:url(gradient.png), url(swirl1.png), url(swirl2.png);
background-position: top left, top left, bottom right;
background-repeat:repeat-x, no-repeat, no-repeat;
background-attachment: fixed;
}
</pre>
<p>Easy concept. I used the original <strong>backbground</strong> property and used the new <strong>rgba()</strong> value for the background. Next I used the <strong>background-image</strong> property for the images, all separated by commas, don&#8217;t forget that. Next I declared the <strong>background-position</strong> and <strong>background-repeat</strong> the same way. The <strong>background-attachment</strong> is for fun.</p>
<p>Now since I&#8217;m really lazy and I don&#8217;t feel like creating my own swirls in illustrator, I used some wonderful free online <a title="swirls brushes" href="http://fbrushes.com/category/swirls/">brushes</a>. Also, I had a lot of trouble making this work in short-hand (ie. background: url(gradient.png) top left repeat-x, url(swirl1.png) top left no-repeat, and so on). Unfortunately, it only works with Webkit (ie Safari and Chrome) and I haven&#8217;t been able to make it work on Firefox. It should work in coming Firefox releases. Check out my testing site for a <a title="CSS3 testing website" href="http://test.davepcguy.com/scripts/CSS3test/secondtest.html">live example</a>.</p>
<p>Here&#8217;s what it should look like:</p>
<p style="text-align: left;">
<div class="mceTemp mceIEcenter">
<dl id="attachment_985" class="wp-caption aligncenter" style="width: 624px;">
<dt class="wp-caption-dt"><a href="http://www.davepcguy.com/wp-content/uploads/2009/12/multiplebackgrounds2.png"><img class="size-large wp-image-985 " title="multiple backgrounds" src="http://www.davepcguy.com/wp-content/uploads/2009/12/multiplebackgrounds2-1024x563.png" alt="multiple backgrounds" width="614" height="338" /></a></dt>
</dl>
</div>
<p style="text-align: left;">It looks pretty nice, doesn&#8217;t it? <img src='http://www.davepcguy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I like it. I&#8217;ll probably employ it in some future websites too.</p>
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: center;"><a href="http://www.davepcguy.com/wp-content/uploads/2009/12/originclip.png"><img class="aligncenter size-full wp-image-986" title="originclip" src="http://www.davepcguy.com/wp-content/uploads/2009/12/originclip.png" alt="originclip" width="498" height="111" /></a></p>
<hr />Let&#8217;s look at <strong>background-origin </strong>and <strong>background-clip</strong>. The origin comes first in the title, so it will come first in my explanation. Basically, origin tells the browser where the background image should originate. Should it start where the border ends? Should it start where padding ends? Should it start where the content ends?</p>
<p>This concerns the<a title="border padding and fonts CSS lesson 2" href="http://www.davepcguy.com/archive/css-lesson-2-fonts-padding-and-border/"> box theory</a> and adds to the complications of it. This also concerns the <strong>background-position</strong> property that I used in the previous example. CSS3 Info has a great <a title="css3 info background origin and clip" href="http://www.css3.info/preview/background-origin-and-background-clip/">article</a> that shows all of the different results you can get with clip and origin properties. It&#8217;s useful, but not the best. I&#8217;ll be using the following image to indicate all the different background origins:</p>
<p><a href="http://www.davepcguy.com/wp-content/uploads/2009/12/originclip2.png"><img class="aligncenter size-full wp-image-990" title="originclip" src="http://www.davepcguy.com/wp-content/uploads/2009/12/originclip2.png" alt="originclip" width="150" height="123" /></a>The different values you can use are <strong>border-box</strong>, <strong>padding-box</strong>, and <strong>content-box</strong>. While using this property add the &#8220;-moz-&#8221; and &#8220;-webkit-&#8221; prefixes to the properties. Once again, I&#8217;m having trouble making it work in firefox. It might work for you, but it didn&#8217;t work for me. Here&#8217;s the CSS I used:</p>
<pre class="brush: css;">
background: url(swirl3.png) no-repeat bottom right;
background-origin: padding-box;
-moz-background-origin: padding-box;
-webkit-background-origin: padding-box;
</pre>
<p>Of course, I used different positions for different divs. I added some extra borders and padding for effect but go ahead and check out my <a title="CSS3 example testing site" href="http://test.davepcguy.com/scripts/CSS3test/secondtest.html">example site</a>. If it doesn&#8217;t work, here&#8217;s a screenshot:</p>
<p style="text-align: left;"><a href="http://www.davepcguy.com/wp-content/uploads/2009/12/originclip3.png"><img class="aligncenter size-full wp-image-991" title="originclip" src="http://www.davepcguy.com/wp-content/uploads/2009/12/originclip3.png" alt="originclip" width="449" height="348" /></a>Here&#8217;s the rundown of the properties:</p>
<ol>
<li>border-box</li>
<li>padding-box</li>
<li>content-box</li>
</ol>
<p>As you can see, <strong>border-box</strong> puts the background image into the border, <strong>padding-box</strong> sits right outside the border (or at the end of the padding), <strong>content-box</strong> puts the background inside the content area.</p>
<p>Let&#8217;s look at <strong>background-clip </strong>which has two different values, <strong>border </strong>and <strong>padding</strong>. Using <strong>border</strong> will enable the background to be visible ABOVE the border area. Padding box does the same except the background will be visible above the padding area and not the border area.</p>
<p>I&#8217;ll use the following swirl to show you how this works:</p>
<p><a href="http://www.davepcguy.com/wp-content/uploads/2009/12/swirl4.png"><img class="aligncenter size-full wp-image-992" title="swirl" src="http://www.davepcguy.com/wp-content/uploads/2009/12/swirl4.png" alt="swirl" width="105" height="111" /></a>The first example with the green swirl used the <strong>padding</strong> while the next one will use the <strong>border </strong>value. You won&#8217;t see much difference in most of the swirls (ie between the green and the red) but when you look on the bottom left red swirl, you will notice that part of the swirl is visible in the dashed border. That is basically all the difference you will see between the <strong>border </strong>and <strong>padding </strong>values. Here&#8217;s a close-up picture:</p>
<p><a href="http://www.davepcguy.com/wp-content/uploads/2009/12/originclip4.png"><img class="aligncenter size-full wp-image-994" title="originclip" src="http://www.davepcguy.com/wp-content/uploads/2009/12/originclip4.png" alt="originclip" width="193" height="143" /></a>Here&#8217;s the green swirl:</p>
<p><a href="http://www.davepcguy.com/wp-content/uploads/2009/12/originclip5.png"><img class="aligncenter size-full wp-image-995" title="origin clip" src="http://www.davepcguy.com/wp-content/uploads/2009/12/originclip5.png" alt="origin clip" width="195" height="153" /></a>Once again though, this feature fails in Mozilla. Here&#8217;s the CSS for the last DIV on the page (where the advertisement is):</p>
<pre class="brush: css;">

background: url(swirl4.png) no-repeat top right;
 -webkit-background-origin: content-box;
 -moz-background-origin: content-box;
 -moz-background-clip: border;
 -webkit-background-clip: border;
background-clip: border;
</pre>
<p style="text-align: center;"><img class="size-full wp-image-997 aligncenter" title="conclusion" src="http://www.davepcguy.com/wp-content/uploads/2009/12/conclusion.png" alt="conclusion" width="498" height="111" /></p>
<hr />
Well, here&#8217;s my conclusion. I found some great use for the multiple backgrounds on my <a title="CSS3 testing website" href="http://test.davepcguy.com/scripts/CSS3test/secondtest.html">testing site</a>. Actually, all of them are pretty useful. I wish there was more support for it. I may have erred but it seems unlikely since all of the properties show up alright in Chrome. I hope you enjoyed my tutorial and look out for some more in the future!</p>
<p>Here&#8217;s the final website:</p>
<p style="text-align: center;"><img class="aligncenter size-large wp-image-1000" title="testing" src="http://www.davepcguy.com/wp-content/uploads/2009/12/testing1-1024x562.png" alt="testing" width="614" height="337" /><img class="aligncenter size-large wp-image-1001" title="testing 2" src="http://www.davepcguy.com/wp-content/uploads/2009/12/testing2-1024x272.png" alt="testing 2" width="614" height="163" /></p>




Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss3-lesson-3-background-information-is-essential%2F&amp;partner=sociable" title="Print"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss3-lesson-3-background-information-is-essential%2F&amp;title=CSS3%20Lesson%203%3A%20Background%20Information%20is%20Essential&amp;bodytext=Let%27s%20have%20a%20look%20at%20backgrounds.%20In%20the%20previous%20two%20tutorials%2C%20I%27ve%20covered%20borders%20and%20opacity.%20In%20this%20tutorial%2C%20we%27ll%20cover%20some%20of%20the%20basic%20CSS3%20additions%20to%20the%20background%20properties.%20If%20you%20have%20no%20idea%20how%20to%20deal%20with%20backgrounds%20in%20CSS%2C%20r" title="Digg"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss3-lesson-3-background-information-is-essential%2F&amp;title=CSS3%20Lesson%203%3A%20Background%20Information%20is%20Essential&amp;notes=Let%27s%20have%20a%20look%20at%20backgrounds.%20In%20the%20previous%20two%20tutorials%2C%20I%27ve%20covered%20borders%20and%20opacity.%20In%20this%20tutorial%2C%20we%27ll%20cover%20some%20of%20the%20basic%20CSS3%20additions%20to%20the%20background%20properties.%20If%20you%20have%20no%20idea%20how%20to%20deal%20with%20backgrounds%20in%20CSS%2C%20r" title="del.icio.us"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss3-lesson-3-background-information-is-essential%2F&amp;t=CSS3%20Lesson%203%3A%20Background%20Information%20is%20Essential" title="Facebook"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss3-lesson-3-background-information-is-essential%2F&amp;title=CSS3%20Lesson%203%3A%20Background%20Information%20is%20Essential&amp;annotation=Let%27s%20have%20a%20look%20at%20backgrounds.%20In%20the%20previous%20two%20tutorials%2C%20I%27ve%20covered%20borders%20and%20opacity.%20In%20this%20tutorial%2C%20we%27ll%20cover%20some%20of%20the%20basic%20CSS3%20additions%20to%20the%20background%20properties.%20If%20you%20have%20no%20idea%20how%20to%20deal%20with%20backgrounds%20in%20CSS%2C%20r" title="Google Bookmarks"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss3-lesson-3-background-information-is-essential%2F&amp;title=CSS3%20Lesson%203%3A%20Background%20Information%20is%20Essential&amp;source=Dave+PC+Guy+Computers+and+Technology&amp;summary=Let%27s%20have%20a%20look%20at%20backgrounds.%20In%20the%20previous%20two%20tutorials%2C%20I%27ve%20covered%20borders%20and%20opacity.%20In%20this%20tutorial%2C%20we%27ll%20cover%20some%20of%20the%20basic%20CSS3%20additions%20to%20the%20background%20properties.%20If%20you%20have%20no%20idea%20how%20to%20deal%20with%20backgrounds%20in%20CSS%2C%20r" title="LinkedIn"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss3-lesson-3-background-information-is-essential%2F&amp;title=CSS3%20Lesson%203%3A%20Background%20Information%20is%20Essential" title="Reddit"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss3-lesson-3-background-information-is-essential%2F&amp;t=CSS3%20Lesson%203%3A%20Background%20Information%20is%20Essential&amp;s=Let%27s%20have%20a%20look%20at%20backgrounds.%20In%20the%20previous%20two%20tutorials%2C%20I%27ve%20covered%20borders%20and%20opacity.%20In%20this%20tutorial%2C%20we%27ll%20cover%20some%20of%20the%20basic%20CSS3%20additions%20to%20the%20background%20properties.%20If%20you%20have%20no%20idea%20how%20to%20deal%20with%20backgrounds%20in%20CSS%2C%20r" title="Tumblr"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=CSS3%20Lesson%203%3A%20Background%20Information%20is%20Essential%20-%20http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss3-lesson-3-background-information-is-essential%2F" title="Twitter"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=CSS3%20Lesson%203%3A%20Background%20Information%20is%20Essential&amp;body=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss3-lesson-3-background-information-is-essential%2F" title="email"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=CSS3%20Lesson%203%3A%20Background%20Information%20is%20Essential&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss3-lesson-3-background-information-is-essential%2F" title="Slashdot"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss3-lesson-3-background-information-is-essential%2F&amp;title=CSS3%20Lesson%203%3A%20Background%20Information%20is%20Essential" title="StumbleUpon"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.davepcguy.com/archive/css3-lesson-3-background-information-is-essential/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>CSS3 Lesson 2: All About Borders</title>
		<link>http://www.davepcguy.com/archive/css3-lesson-2-all-about-borders/</link>
		<comments>http://www.davepcguy.com/archive/css3-lesson-2-all-about-borders/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 15:38:56 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[border]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[formatting]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[lesson]]></category>

		<guid isPermaLink="false">http://www.davepcguy.com/?p=936</guid>
		<description><![CDATA[Okay, I&#8217;ve noticed some REALLY cool stuff on CSS3 online, so I thought to myself, how about I make my own experiment and teach you all about how to use this stuff? Here are a couple of resources I&#8217;m using to learn about CSS3: CSS3 Info CSS3 Validator Intro to CSS3 W3 Avenue Net Tuts]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss3-lesson-2-all-about-borders%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss3-lesson-2-all-about-borders%2F&amp;source=clrkmck&amp;style=normal&amp;service_api=clrkmck%3AR_a73f58a91ed3515157df75ab6c37730f&amp;hashtags=border,css,formatting,internet,lesson" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://www.davepcguy.com/wp-content/uploads/2009/12/css.png"><img class="aligncenter size-full wp-image-963" title="CSS" src="http://www.davepcguy.com/wp-content/uploads/2009/12/css.png" alt="CSS" width="300" height="200" /></a></p>
<p>Okay, I&#8217;ve noticed some REALLY cool stuff on CSS3 online, so I thought to myself, how about I make my own experiment and teach you all about how to use this stuff?</p>
<p>Here are a couple of resources I&#8217;m using to learn about CSS3:</p>
<ul>
<li><a href="http://www.css3.info">CSS3 Info</a></li>
<li><a href="http://jigsaw.w3.org/css-validator/">CSS3 Validator</a></li>
<li><a href="http://designshack.co.uk/tutorials/introduction-to-css3-part-1-what-is-it">Intro to CSS3</a></li>
<li><a href="http://www.w3avenue.com/2009/06/22/css3-unleashed-tips-tricks-and-techniques/">W3 Avenue</a></li>
<li><a href="http://net.tutsplus.com/tutorials/html-css-techniques/html-5-and-css-3-the-techniques-youll-soon-be-using/">Net Tuts Plus tutorial</a></li>
</ul>
<p>I&#8217;ll start with the topic that everyone is concerned about. BORDERS! Okay, why are borders so important? Well, In the Web 2.0 design standard, it&#8217;s all about opacity, rounded corners, shadows, and everything else that&#8217;s just super awesome looking. I&#8217;ve already <a href="http://www.davepcguy.com/archive/css-lesson-7-border-radius-and-opacity/">explained </a>the rounded corners and opacity previously. So, I&#8217;ll skip that part. If you&#8217;re this far, you should probably learn the basics about CSS standards of <a href="http://www.davepcguy.com/archive/css-lesson-2-fonts-padding-and-border/">borders</a> and the markup.<br />
<span id="more-936"></span></p>
<h1>Border Color</h1>
<p>Okay, perhaps not necessarily &#8220;border color&#8221; but rather &#8220;border gradient&#8221; because that&#8217;s all border color is going to be used for in the future <img src='http://www.davepcguy.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> .<br />
It&#8217;s currently supported solely by Mozilla Firefox, which is rather unfortunate for all you IE, Chrome, and Safari users.<br />
What does it do? The property is &#8220;<strong>-moz-border-*side*-colors: value</strong>&#8220;, the sides are &#8220;top, bottom, left, right&#8221;. Well, the usual. The problem here is that you have to set up each side. There is no short hand as far as I&#8217;m aware (I&#8217;ve already tried a few variations but nothing worked).<br />
Here&#8217;s what you have to do:</p>
<pre class="brush: css;">
border: 4px solid;
	-moz-border-top-colors: #000099 #0033CC #0066CC #0099CC;
	-moz-border-bottom-colors: #000099 #0033CC #0066CC #0099CC;
	-moz-border-left-colors: #000099 #0033CC #0066CC #0099CC;
	-moz-border-right-colors: #000099 #0033CC #0066CC #0099CC;
</pre>
<p>You&#8217;ll have to set up the border separately, set the pixel size according to how thick you want the border to be. It&#8217;s usually safe to set the pixel width to the number of colors used. Four for each gradient color (#000099 through #0099CC). If you set the width of the border to be thicker than 4px, the last color in the set will be repeated (#0099CC).<br />
If you view my <a href="http://test.davepcguy.com/scripts/CSS3test/index.html">example</a>, you&#8217;ll notice how differently each border looks with different widths (3px 7px 10px and 4px in a clockwise manner starting with the top). If you can&#8217;t see it, here&#8217;s a screenshot:</p>
<div class="wp-caption aligncenter" style="width: 441px"><a href="http://screenshotuploader.com/screen/QWcgJOBsMS/" target="_blank"><img title="Screenshot of CSS3 example" src="http://screenshotuploader.com/img/QWcgJOBsMS.jpg" border="0" alt="" width="431" height="113" /></a><p class="wp-caption-text">Screenshot of CSS3 example</p></div>
<p>That&#8217;s it for the border-color</p>
<hr /></p>
<hr />
<h1>Border Image</h1>
<p>Border image is another border property that shows a lot of promise. Basically, it&#8217;s a property that allows you to use custom specific images that will go around a specific area. Instead of just using lines (or gradients described above), we can insert images for the border. It&#8217;s a really tricky property and there is no real documentation anywhere that explains it thoroughly.<br />
Here&#8217;s the property &#8220;<strong>-*browser*-border-image:</strong>&#8221; for *browser*, you&#8217;ll have to use both &#8220;webkit&#8221; and &#8220;moz&#8221;, and even &#8220;o&#8221; (for opera) and &#8220;khtml&#8221; (konqueror). &#8220;border-image&#8221; is a shortcut for &#8220;-*browser*-border-*side*-image-&#8221;, and *side* works the same way as before.<br />
The second part of our little CSS3 definition is the &#8220;value&#8221; which is in this order: &#8220;url(image.png) slicewidth stretch&#8221;, you also have to use the &#8220;border-width&#8221; property.</p>
<pre class="brush: css;">
#borderedcontent {
 border-width: 10px;
-webkit-border-image: url(border.png) 10 stretch;
-moz-border-image: url(border.png) 10 stretch;

}
</pre>
<p>Again, check out my <a title="example css3 test" href="http://test.davepcguy.com/scripts/CSS3test/index.html">example</a>.</p>
<p>As far as I can tell, the whole art of doing this is slicing the images right. If you have an image that is 99&#215;99 pixels, such as the one below:</p>
<p><img class="alignleft" src="http://test.davepcguy.com/scripts/CSS3test/border2.jpg" alt="" width="99" height="99" />Now, I used a 33 point cutting, so that every 33 points, the images get cut (in all different ways). Once that is done (creating 33 x 33 pixel squares), the second value defines what happens to that little squares. In this case, each square is actually a single dot. I used this image as the second example on my example page. I set the &#8220;stretch&#8221; property to &#8220;stretch round&#8221; which made the top and bottom &#8220;round&#8221; and the sides &#8220;stretch&#8221; (by sides, I mean the middle row of squares). I know this is pretty confusing and it is even for me, but soon enough, it&#8217;ll make sense to you.</p>
<p>The <strong>round</strong> property scales the &#8220;squares&#8221; or &#8220;slices&#8221; of the original image in a way to incorporate the squares in a repeating fashion but so that it only includes WHOLE slices and not parts.</p>
<p>The <strong>repeat</strong> property does just that, it repeats the element, unscaled and thus results in incomplete repetitions of some slices. <img src='http://www.davepcguy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The <strong>stretch</strong> property does its usual business, it stretches each part to fill the whole area.</p>
<p>The <strong>border-width </strong>sets the width of the border and in the case of image-border, it helps scale the slices again to fulfill the whole width of the border. You can also set the width to <strong>auto</strong> which uses the original width of the image slices as width. I used the &#8220;auto width&#8221; property on my second example (creates a pretty funky image)</p>
<p>Like I said, the trickiest part of the whole process is creating the slices. Oh, and remember that if you want to create ONLY the border images, you&#8217;ll have to create a blank middle and slice that out too.</p>
<p>Refer to the <a title="Border Image CSS3 W3 documentation" href="http://www.w3.org/TR/css3-background/#the-border-image">W3 Documentation</a>, which, unlike in other cases, actually provides a comprehensive overview of the property. Check out the different examples and see what you can find out.</p>
<p>There&#8217;s also another website that deals with slicing and other methods to use border-image <a title="border image CSS3 Ninja" href="http://www.lrbabe.com/sdoms/borderImage/index.html">here</a>.</p>
<p>And I found a great <a title="speech bubble CSS3 border image" href="http://brightchimp.com/2008/09/07/hand-drawn-speac-bubble-using-css3-border-image/">example</a> on how to use this property.</p>
<p>Here&#8217;s my last example:</p>
<p>go back  to my CSS3 <a title="CSS3 example testing site" href="http://test.davepcguy.com/scripts/CSS3test/index.html">testing page</a> and you&#8217;ll see a third example on the bottom. Here, I used the &#8220;stretch&#8221; property in combination with the right slicing. Here&#8217;s how I sliced up the image:</p>
<div id="attachment_948" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.davepcguy.com/wp-content/uploads/2009/12/borderimage.png"><img class="size-medium wp-image-948" title="sliced image" src="http://www.davepcguy.com/wp-content/uploads/2009/12/borderimage-300x299.png" alt="sliced image" width="300" height="299" /></a><p class="wp-caption-text">sliced image</p></div>
<p>And it worked! Somewhat. My border had to be about 30 px which really distorted the image. Oh, also, the slicing length is measure from the edge toward the center. ie, 40px from the right etc. Again, here are the screenshots:</p>
<div id="attachment_950" class="wp-caption aligncenter" style="width: 307px"><a href="http://www.davepcguy.com/wp-content/uploads/2009/12/borderimage2.PNG"><img class="size-medium wp-image-950" title="Border examples" src="http://www.davepcguy.com/wp-content/uploads/2009/12/borderimage2-297x300.PNG" alt="Border examples" width="297" height="300" /></a><p class="wp-caption-text">Border examples</p></div>
<h1>Box Shadow</h1>
<p>Box Shadow is the last border-like property. I guess we could classify it under backgrounds as well but I&#8217;m including it here anyways. The property is EXACTLY like the <strong>text-shadow</strong> property described in an <a title="CSS Lesson 1 text properties" href="http://www.davepcguy.com/archive/css-lesson-1/#text">earlier tutorial</a> except now, it involves a whole area.</p>
<p>Let&#8217;s look at the property a bit closer:</p>
<blockquote><p>h1 {</p>
<p>box-shadow: x-offset y-offset blur color;</p>
<p>}</p></blockquote>
<pre class="brush: css;">
h1 {
box-shadow: 2px 1px 3px #000;
}
</pre>
<p>Once again, you&#8217;ll have to add the &#8220;-*browser*-&#8221; part to the property again because it&#8217;s not a &#8220;standard&#8221; property yet. So again <strong>-moz-box-shadow</strong> and <strong>-webkit-box-shadow</strong>. In the example, you don&#8217;t necessarily have to include the color of the shadow, the default will be black.  If you look at my <a title="CSS3 testing website" href="http://test.davepcguy.com/scripts/CSS3test/index.html">example</a>, you&#8217;ll see that it&#8217;s a pretty nice property <img src='http://www.davepcguy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  For all of you who can&#8217;t view it, here&#8217;s the screenshot (*note the original example uses a green shadow):</p>
<div id="attachment_953" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.davepcguy.com/wp-content/uploads/2009/12/boxshadow.PNG"><img class="size-medium wp-image-953" title="boxshadow" src="http://www.davepcguy.com/wp-content/uploads/2009/12/boxshadow-300x85.PNG" alt="Box Shadow" width="300" height="85" /></a><p class="wp-caption-text">Box Shadow</p></div>
<p>One thing you can do in mozilla firefox, and nowhere else, is an inner shadow by adding <strong>inset</strong> to your property value:</p>
<pre class="brush: css;">
div {
-moz-box-shadow: inset 1px 3px 2px;
}
</pre>
<p>That results in the second example on my <a title="example css3 test" href="http://test.davepcguy.com/scripts/CSS3test/index.html">example page</a>.</p>
<div id="attachment_956" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.davepcguy.com/wp-content/uploads/2009/12/boxshadow2.PNG"><img class="size-medium wp-image-956" title="Inner Box Shadow" src="http://www.davepcguy.com/wp-content/uploads/2009/12/boxshadow2-300x76.PNG" alt="Inner Box Shadow" width="300" height="76" /></a><p class="wp-caption-text">Inner Box Shadow</p></div>
<h1>Conclusion</h1>
<p>CSS3 is still in works, and as you might have noticed, many of these properties require the &#8220;-*browser*-&#8221; add-on at the beginning. Once CSS3 becomes a standard, we&#8217;ll be able to use all of these freely. Also, I regret to inform you that IE does not have any quick work around yet but apparently the new<a title="IE 9 CSS3 Support" href="http://www.dave-woods.co.uk/index.php/internet-explorer-9-css3-support/"> IE9</a> should work with CSS3 properties&#8230;finally.</p>
<p>I hope you enjoyed my tutorial and I can&#8217;t wait to show you some more CSS3 stuff!</p>
<hr />
</p>
<hr />



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss3-lesson-2-all-about-borders%2F&amp;partner=sociable" title="Print"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss3-lesson-2-all-about-borders%2F&amp;title=CSS3%20Lesson%202%3A%20All%20About%20Borders&amp;bodytext=%0D%0A%0D%0AOkay%2C%20I%27ve%20noticed%20some%20REALLY%20cool%20stuff%20on%20CSS3%20online%2C%20so%20I%20thought%20to%20myself%2C%20how%20about%20I%20make%20my%20own%20experiment%20and%20teach%20you%20all%20about%20how%20to%20use%20this%20stuff%3F%0D%0A%0D%0AHere%20are%20a%20couple%20of%20resources%20I%27m%20using%20to%20learn%20about%20CSS3%3A%0D%0A%0D%0A%09CSS3%20Info%0D%0A%09C" title="Digg"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss3-lesson-2-all-about-borders%2F&amp;title=CSS3%20Lesson%202%3A%20All%20About%20Borders&amp;notes=%0D%0A%0D%0AOkay%2C%20I%27ve%20noticed%20some%20REALLY%20cool%20stuff%20on%20CSS3%20online%2C%20so%20I%20thought%20to%20myself%2C%20how%20about%20I%20make%20my%20own%20experiment%20and%20teach%20you%20all%20about%20how%20to%20use%20this%20stuff%3F%0D%0A%0D%0AHere%20are%20a%20couple%20of%20resources%20I%27m%20using%20to%20learn%20about%20CSS3%3A%0D%0A%0D%0A%09CSS3%20Info%0D%0A%09C" title="del.icio.us"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss3-lesson-2-all-about-borders%2F&amp;t=CSS3%20Lesson%202%3A%20All%20About%20Borders" title="Facebook"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss3-lesson-2-all-about-borders%2F&amp;title=CSS3%20Lesson%202%3A%20All%20About%20Borders&amp;annotation=%0D%0A%0D%0AOkay%2C%20I%27ve%20noticed%20some%20REALLY%20cool%20stuff%20on%20CSS3%20online%2C%20so%20I%20thought%20to%20myself%2C%20how%20about%20I%20make%20my%20own%20experiment%20and%20teach%20you%20all%20about%20how%20to%20use%20this%20stuff%3F%0D%0A%0D%0AHere%20are%20a%20couple%20of%20resources%20I%27m%20using%20to%20learn%20about%20CSS3%3A%0D%0A%0D%0A%09CSS3%20Info%0D%0A%09C" title="Google Bookmarks"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss3-lesson-2-all-about-borders%2F&amp;title=CSS3%20Lesson%202%3A%20All%20About%20Borders&amp;source=Dave+PC+Guy+Computers+and+Technology&amp;summary=%0D%0A%0D%0AOkay%2C%20I%27ve%20noticed%20some%20REALLY%20cool%20stuff%20on%20CSS3%20online%2C%20so%20I%20thought%20to%20myself%2C%20how%20about%20I%20make%20my%20own%20experiment%20and%20teach%20you%20all%20about%20how%20to%20use%20this%20stuff%3F%0D%0A%0D%0AHere%20are%20a%20couple%20of%20resources%20I%27m%20using%20to%20learn%20about%20CSS3%3A%0D%0A%0D%0A%09CSS3%20Info%0D%0A%09C" title="LinkedIn"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss3-lesson-2-all-about-borders%2F&amp;title=CSS3%20Lesson%202%3A%20All%20About%20Borders" title="Reddit"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss3-lesson-2-all-about-borders%2F&amp;t=CSS3%20Lesson%202%3A%20All%20About%20Borders&amp;s=%0D%0A%0D%0AOkay%2C%20I%27ve%20noticed%20some%20REALLY%20cool%20stuff%20on%20CSS3%20online%2C%20so%20I%20thought%20to%20myself%2C%20how%20about%20I%20make%20my%20own%20experiment%20and%20teach%20you%20all%20about%20how%20to%20use%20this%20stuff%3F%0D%0A%0D%0AHere%20are%20a%20couple%20of%20resources%20I%27m%20using%20to%20learn%20about%20CSS3%3A%0D%0A%0D%0A%09CSS3%20Info%0D%0A%09C" title="Tumblr"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=CSS3%20Lesson%202%3A%20All%20About%20Borders%20-%20http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss3-lesson-2-all-about-borders%2F" title="Twitter"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=CSS3%20Lesson%202%3A%20All%20About%20Borders&amp;body=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss3-lesson-2-all-about-borders%2F" title="email"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=CSS3%20Lesson%202%3A%20All%20About%20Borders&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss3-lesson-2-all-about-borders%2F" title="Slashdot"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss3-lesson-2-all-about-borders%2F&amp;title=CSS3%20Lesson%202%3A%20All%20About%20Borders" title="StumbleUpon"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.davepcguy.com/archive/css3-lesson-2-all-about-borders/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CSS Trick: Disappearing Textbox</title>
		<link>http://www.davepcguy.com/archive/css-trick-disappearing-textbox/</link>
		<comments>http://www.davepcguy.com/archive/css-trick-disappearing-textbox/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 16:21:45 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[formatting]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[web extras]]></category>
		<category><![CDATA[webpage]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://www.davepcguy.com/?p=777</guid>
		<description><![CDATA[Remember that trick to show a sub-menu using CSS in my older tutorial? Well, I had an idea for a project of mine, and with a little help from my dear friend Raphael. Last night, I launched my little website project called &#8220;A Night Story&#8221; and made some tweaks. Ignore the story, it&#8217;s just a]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-trick-disappearing-textbox%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-trick-disappearing-textbox%2F&amp;source=clrkmck&amp;style=normal&amp;service_api=clrkmck%3AR_a73f58a91ed3515157df75ab6c37730f&amp;hashtags=css,formatting,project,text,web+extras,webpage,website" height="61" width="50" /><br />
			</a>
		</div>
<p>Remember that trick to show a sub-menu using CSS in my <a title="CSS Vertical Navigation" href="http://www.davepcguy.com/archive/css-vertical-navigation/">older tutorial?</a> Well, I had an idea for a project of mine, and with a little help from my dear friend <a title="Raphael Caixeta" href="http://www.raphaelcaixeta.com">Raphael</a>. Last night, I launched my little website project called &#8220;<a title="A Night Story" href="http://test.davepcguy.com/livestory/test.html">A Night Story</a>&#8221; and made some tweaks. Ignore the story, it&#8217;s just a concept. If you hover over the word &#8220;city&#8221; in the text, you&#8217;ll see another textbox appear with more information about the word.<br />
<span id="more-777"></span><br />
The whole concept of the website is to create a story, a swift, easy-to-read story that contains more information than it seems.</p>
<div id="attachment_778" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.davepcguy.com/wp-content/uploads/2009/10/span1.png"><img class="size-medium wp-image-778" title="span1" src="http://www.davepcguy.com/wp-content/uploads/2009/10/span1-300x167.png" alt="Hover effect" width="300" height="167" /></a><p class="wp-caption-text">Hover effect</p></div>
<p>So, let me teach you how to create such a hover effect on any word in the text, and on an unlimited amount of words without much work</p>
<h1>The HTML</h1>
<p>First, we have to create an ideal HTML situation that will be easy to describe with CSS later on. First, pick the word, in my case &#8220;city&#8221; and then the text.</p>
<p>We&#8217;ll have to put the whole thing within a &#8220;span&#8221; and then create another &#8220;span&#8221; for the hover text like this:</p>
<pre class="brush: xml;">
&lt;span&gt;&lt;a href=&quot;terms/city.html&quot;&gt;city&lt;/a&gt;&lt;span&gt;the city was large, and dark. People droned on and walked aimlessly through the streets every day. The smog filtered through their lungs. No one could escape the industrialization that overtook and destroyed the greenery that had once been there, the darkness shrouded my moves. &lt;/span&gt;&lt;/span&gt;
</pre>
<p>If you don&#8217;t want to use the &lt;a&gt; tag, then use another tag that you can use as an &#8220;anchor&#8221;, ie so the browser knows its special, a good one to use could be the tag &lt;b&gt;, which will let people know that the bold text is important and hoverable. Otherwise, you can create ids for all these spans and that&#8217;s just too much work. You can try different variations of this formula and see how it works. This is what I did, and it worked out well <img src='http://www.davepcguy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
</p>
<h1>The CSS</h1>
<p>Let&#8217;s focus on the CSS. One thing, I want to do is change the word &#8220;city&#8221; so that it does not appear&#8230;like such a link. Let me show you how I customized the link so that it appears the way it does:</p>
<pre class="brush: css;">
a {
padding: 0px;
margin: 0px;
background-color: #FFFFFF;
}

a:link, a:visited
{
color: #0000CC;
text-decoration: none;
}

a:hover
{
background-color: #369;
color: #fff;
}
</pre>
<p>That creates a nice effect. The underline is gone, the tag has no special padding or a margin. I&#8217;ve also took the the liberty to make its background match the rest of the div (not necessary). Next I changed it so that the color does not change once clicked, but the color of the word will still be different than white. Once hovered, the word will change color and background as shown on my test page.</p>
<p>Let&#8217;s get down to disappearing! Believe it or not, this is so easy, you&#8217;ll be asking yourself why you hadn&#8217;t thought of it:</p>
<pre class="brush: css;">
span&gt;span{
display: none;
position: absolute;
width: 300px;
}
span:hover&gt;span {
display: block;
padding: 5px;
background-color: white;
border: 1px solid black;
}
</pre>
<p>First, I used a strange class: <strong>span&gt;span</strong> means, the span within another span will follow these properties. The text will not display, the position is absolute (so that it will cover other text once hovered over), and the width is nice 300px. You can change the width attribute, and mess around with the position if you wish to. I probably will in the final version.</p>
<p>Next, <strong>span:hover&gt;span</strong> is a pseudo weird class. The <strong>span:hover </strong>class basically is a class that takes effect only when you mouse over the original span. By adding <strong>&gt;span</strong>, we&#8217;ve created something genius. This class is a class that works only once the original span is moused over. Now, we&#8217;re using the <strong>display:block</strong> property to display the nice block of text. I used some padding and added a background color so that the other text won&#8217;t interfere. The border is there only for neatness.</p>
<p>And that&#8217;s it! With just these few steps you&#8217;ve created something that people use javascript for!</p>
<p><strong>Pros:</strong></p>
<p>The pros of using CSS:</p>
<ol>
<li>It is really easy to change the effects</li>
<li> You don&#8217;t have to learn javascript</li>
<li>It works even if the user has javascript disabled</li>
<li>It is faster than javascript because it requires no calculation or parsing</li>
</ol>
<p><strong>Cons:</strong></p>
<p>The Cons of using CSS for this particular effect:</p>
<ol>
<li>less maneuverability</li>
<li>less special effects</li>
<li>looks too simple for some websites</li>
</ol>
<p>With some experimenting and patience, you can create really beautiful drop-down textboxes with custom backgrounds. Well, the possibilities are endless! <img src='http://www.davepcguy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a title="testing site" href="http://test.davepcguy.com/livestory/test.html">Again, go check out my testing site for a demo!</a></p>




Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-trick-disappearing-textbox%2F&amp;partner=sociable" title="Print"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-trick-disappearing-textbox%2F&amp;title=CSS%20Trick%3A%20Disappearing%20Textbox&amp;bodytext=Remember%20that%20trick%20to%20show%20a%20sub-menu%20using%20CSS%20in%20my%20older%20tutorial%3F%20Well%2C%20I%20had%20an%20idea%20for%20a%20project%20of%20mine%2C%20and%20with%20a%20little%20help%20from%20my%20dear%20friend%20Raphael.%20Last%20night%2C%20I%20launched%20my%20little%20website%20project%20called%20%22A%20Night%20Story%22%20and%20made%20som" title="Digg"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-trick-disappearing-textbox%2F&amp;title=CSS%20Trick%3A%20Disappearing%20Textbox&amp;notes=Remember%20that%20trick%20to%20show%20a%20sub-menu%20using%20CSS%20in%20my%20older%20tutorial%3F%20Well%2C%20I%20had%20an%20idea%20for%20a%20project%20of%20mine%2C%20and%20with%20a%20little%20help%20from%20my%20dear%20friend%20Raphael.%20Last%20night%2C%20I%20launched%20my%20little%20website%20project%20called%20%22A%20Night%20Story%22%20and%20made%20som" title="del.icio.us"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-trick-disappearing-textbox%2F&amp;t=CSS%20Trick%3A%20Disappearing%20Textbox" title="Facebook"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-trick-disappearing-textbox%2F&amp;title=CSS%20Trick%3A%20Disappearing%20Textbox&amp;annotation=Remember%20that%20trick%20to%20show%20a%20sub-menu%20using%20CSS%20in%20my%20older%20tutorial%3F%20Well%2C%20I%20had%20an%20idea%20for%20a%20project%20of%20mine%2C%20and%20with%20a%20little%20help%20from%20my%20dear%20friend%20Raphael.%20Last%20night%2C%20I%20launched%20my%20little%20website%20project%20called%20%22A%20Night%20Story%22%20and%20made%20som" title="Google Bookmarks"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-trick-disappearing-textbox%2F&amp;title=CSS%20Trick%3A%20Disappearing%20Textbox&amp;source=Dave+PC+Guy+Computers+and+Technology&amp;summary=Remember%20that%20trick%20to%20show%20a%20sub-menu%20using%20CSS%20in%20my%20older%20tutorial%3F%20Well%2C%20I%20had%20an%20idea%20for%20a%20project%20of%20mine%2C%20and%20with%20a%20little%20help%20from%20my%20dear%20friend%20Raphael.%20Last%20night%2C%20I%20launched%20my%20little%20website%20project%20called%20%22A%20Night%20Story%22%20and%20made%20som" title="LinkedIn"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-trick-disappearing-textbox%2F&amp;title=CSS%20Trick%3A%20Disappearing%20Textbox" title="Reddit"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-trick-disappearing-textbox%2F&amp;t=CSS%20Trick%3A%20Disappearing%20Textbox&amp;s=Remember%20that%20trick%20to%20show%20a%20sub-menu%20using%20CSS%20in%20my%20older%20tutorial%3F%20Well%2C%20I%20had%20an%20idea%20for%20a%20project%20of%20mine%2C%20and%20with%20a%20little%20help%20from%20my%20dear%20friend%20Raphael.%20Last%20night%2C%20I%20launched%20my%20little%20website%20project%20called%20%22A%20Night%20Story%22%20and%20made%20som" title="Tumblr"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=CSS%20Trick%3A%20Disappearing%20Textbox%20-%20http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-trick-disappearing-textbox%2F" title="Twitter"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=CSS%20Trick%3A%20Disappearing%20Textbox&amp;body=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-trick-disappearing-textbox%2F" title="email"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=CSS%20Trick%3A%20Disappearing%20Textbox&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-trick-disappearing-textbox%2F" title="Slashdot"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-trick-disappearing-textbox%2F&amp;title=CSS%20Trick%3A%20Disappearing%20Textbox" title="StumbleUpon"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.davepcguy.com/archive/css-trick-disappearing-textbox/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>CSS Lesson 6: Intro to Divs</title>
		<link>http://www.davepcguy.com/archive/css-lesson-6-intro-to-divs/</link>
		<comments>http://www.davepcguy.com/archive/css-lesson-6-intro-to-divs/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 22:36:44 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[divs]]></category>
		<category><![CDATA[formatting]]></category>
		<category><![CDATA[lesson]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[webpage]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://www.davepcguy.com/?p=686</guid>
		<description><![CDATA[Alright, alright. So I skipped all that fuss with horizontal navbars but that stuff is easy so I&#8217;ll create a short article on it later. Let&#8217;s start with the &#60;div&#62; tag. It&#8217;s what I&#8217;ll be covering. Making use of div&#8217;s with CSS. You&#8217;ll need to know the following before we start the lesson: CSS Lesson]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-6-intro-to-divs%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-6-intro-to-divs%2F&amp;source=clrkmck&amp;style=normal&amp;service_api=clrkmck%3AR_a73f58a91ed3515157df75ab6c37730f&amp;hashtags=css,Design,divs,formatting,lesson,text,webpage,website" height="61" width="50" /><br />
			</a>
		</div>
<p>Alright, alright. So I skipped all that fuss with horizontal navbars but that stuff is easy so I&#8217;ll create a short article on it later.</p>
<p>Let&#8217;s start with the &lt;div&gt; tag. It&#8217;s what I&#8217;ll be covering. Making use of div&#8217;s with CSS. You&#8217;ll need to know the following before we start the lesson:</p>
<ul>
<li><a title="CSS Lesson 2: fonts, padding, and border" href="http://www.davepcguy.com/archive/css-lesson-2-fonts-padding-and-border/">CSS Lesson 2</a></li>
<li><a title="CSS Lesson 3: Margin, outlines, and tables" href="http://www.davepcguy.com/archive/css-lesson-3/">CSS Lesson 3</a></li>
<li>as well as basic HTML knowledge</li>
</ul>
<p>If you don&#8217;t how to add CSS to your website, check out my <a title="CSS Intro" href="http://www.davepcguy.com/archive/css-intro/">CSS Intro</a> tutorial and <a title="CSS Lesson 1" href="http://www.davepcguy.com/archive/css-lesson-1/">CSS Lesson 1</a>.<br />
<span id="more-686"></span></p>
<h1>What are &#8220;divs&#8221;?</h1>
<p>A div is basically a section, a chunk of HTML that you can apply the same CSS to. It works similarly to &lt;span&gt; but on larger areas and more complicated HTML. Also, it supports nesting.</p>
<p>A single DIVision can be used, for example, to make a header, another for the navbar. Divs are usually defined using the CSS properties: <strong>margin, padding, border, height, </strong><strong>width, </strong>and <strong>float.</strong></p>
<p>So what can you do with Divs? Well, that&#8217;s the best part. Using divs, you can create multi column websites, you can make the website aligned in the center, instead to the side. You can create rules for large chunks of stuff including text and pictures.</p>
<p>Divs largely replaced the use of tables for page layout, which is great.</p>
<h1>Recognizing Divs</h1>
<p>Now, let&#8217;s look at how divs should be structured, I&#8217;ll be re-making a template I did in PSD a while ago, you can find in <a href="http://www.davepcguy.com/exans-corner/">Exan&#8217;s Corner</a>.</p>
<div id="attachment_735" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.davepcguy.com/wp-content/uploads/2009/10/gcg2.jpg"><img class="size-medium wp-image-735" title="gcg2" src="http://www.davepcguy.com/wp-content/uploads/2009/10/gcg2-300x276.jpg" alt="Template" width="300" height="276" /></a><p class="wp-caption-text">Template</p></div>
<p>Right as I&#8217;m looking at it, I can already distinguish four different sections in the template. The first is the header that contains the words &#8220;A Chiropractic Group&#8221;. The second section is the nav bar and the third is the content on the right. The fourth would be the footer. But when you&#8217;re thinking of divs, you have to think differently. This page will contain at least five different divs, if that. I&#8217;d probably cut it up to six or seven different ones. Why? Well let me show you.</p>
<p>NOTE: These are only examples, I am not actually recreating the template above.</p>
<div id="attachment_738" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.davepcguy.com/wp-content/uploads/2009/10/div1.png"><img class="size-medium wp-image-738" title="Div illustration" src="http://www.davepcguy.com/wp-content/uploads/2009/10/div1-300x214.png" alt="Div illustration" width="300" height="214" /></a><p class="wp-caption-text">Div illustration</p></div>
<p>Way too confusing, eh? Haha, there are just so many sections. Let me break it down for you and explain why it is this way. Also note that I did not add the &#8220;footer&#8221; div which would be number 7 on the bottom. It works the same way as the top div.<br />
<br />
<strong>1. Header &#8211; </strong>Just a standard div that you&#8217;ll put at the beginning of your &lt;div&gt; tag. It will always be on top unless you set another div for absolute position. First thing you want to do while setting this division up is giving it an id or a class like this: &lt;div id=&#8221;header&#8221;&gt; &lt;/div&gt;.  	Great thing about divs is that you don&#8217;t NEED to put anything in there so let&#8217;s set up the rest of the properties.  	Second step is to set up the width and height using CSS:</p>
<pre class="brush: xml;">
&lt;div id=&quot;header&quot;&gt;&lt;/div&gt;
#header {
width: 100%;
height: 150px;
margin: 0;
background: url(header.png) repeat-x;
}
</pre>
<p>This is basically how we set up all of the divs. Using the &#8220;repeat-x&#8221;, we don&#8217;t need to slice large portions of the header (thus adding to the size of the images needed to be downloaded) and we create a continuous header that will show up the same on all web-browsers/monitors. You&#8217;ll need to separately define the classes and ids for the logo as well as the text inside the header to match the PSD template, you might also have to create another separate div for the logo and one for the text, just in case.</p>
<p><strong>2. Wrapper</strong> &#8211; I&#8217;m sure you&#8217;ve encountered that term before. Whenever you need two or more divs to show up next to each other, you need to &#8220;wrap&#8221; them in another div. In this case, it&#8217;ll be the content area, the content footer, and the sidebar that will be wrapped together. With the wrapper, we can also set it up so that the content shows up in the middle using the property &#8220;margin: 0 auto;&#8221; which will automatically center the content. Here, though, we just need to set up the background and the width of the wrapper using CSS. Once again, assign a class or an id to the div.</p>
<pre class="brush: xml;">
&lt;div id=&quot;wrapper&quot;&gt;
&lt;div id=&quot;sidebar&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;contentwrap&gt;&lt;/div&gt;
&lt;/div&gt;
#wrapper {
width: 900px;
height: 1000px;
}
</pre>
<p>It is also possible to set the height to &#8220;auto&#8221; but if we&#8217;re to do that, let&#8217;s do that as the last thing in the process.</p>
<p><strong>3. Sidebar</strong> &#8211; As you can see, I created a div for the sidebar. Now, if you wanted to create a dynamic sidebar, ie one that changes, and you wish to still use the rounded corners, you will need to include three more divs in the sidebar division. This way, the sidebar itself will serve as another wrapper inside a wrapper.</p>
<div id="attachment_739" class="wp-caption aligncenter" style="width: 160px"><a href="http://www.davepcguy.com/wp-content/uploads/2009/10/div2.png"><img class="size-medium wp-image-739" title="Sidebar div" src="http://www.davepcguy.com/wp-content/uploads/2009/10/div2-150x300.png" alt="Sidebar div" width="150" height="300" /></a><p class="wp-caption-text">Sidebar div</p></div>
<p>You&#8217;d have the top div where you would use the first five or six pixels to create the corners, the bottom div for the same purpose. Also, use only PNG because JPEG does not support transparency. The middle would use a repeating background again. Here&#8217;s how you&#8217;d set it up:</p>
<pre class="brush: xml;">
&lt;div id=&quot;sidebar&quot;&gt;
&lt;div id=&quot;sidebartop&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;sidebarmiddle&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;sidebarbottom&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
&lt;/div&gt;

#sidebar {
height: 600px;
width: 200px;
float: left;
}
#sidebartop{
height: 10px;
background: url(topside.png) no-repeat;
width: auto;
}
#sidebarmiddle {
height: auto;
background: url(sidebar.png) repeat-y;
width: auto;
}
#sidebarbottom {
height: 10px;
background: url(bottomside.png) no-repeat;
width: auto;
}
</pre>
<p>Now you&#8217;ve set up the sidebar. Do you get the idea yet? All you do with divs is set up portions of the page. The problem with this is that the sidebar height will be based on the content inside. For template-making purposes, set the height and change the CSS afterward if needed.</p>
<p>TIP: Create a special class called &#8220;clear&#8221; with these attributes: .clear { clear: both; height: 1px; } and add it at the end of every div that has the property &#8220;float&#8221;</p>
<p><strong>4. Content Wrap: </strong>Here&#8217;s another tricky part. You see how the content has two different sections? One above with articles and one below with a pseudo footer? They&#8217;re aligned together so that means, we need another wrapper. This one will how <strong>5. Content </strong>and <strong>6. Pseudo-footer</strong>. The set up is easy.</p>
<pre class="brush: xml;">
&lt;div id=&quot;contentwrap&quot;&gt;
&lt;div id=&quot;content&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;psfooter&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
&lt;/div&gt;

#contentwrap {
width: 700px;
height: auto;
float:left;
}
#content {
width: 698px;
height: auto;
}
#psfooter {
width: 698px;
height: auto;
}
</pre>
<p><strong>7. The Footer &#8211; </strong>This is the easiest part and probably the most common on all websites.</p>
<pre class="brush: xml;">
&lt;div id=&quot;footer&quot;&gt;&lt;/div&gt;

#footer {
height: 20px;
width: auto;
margin: 0 auto;
text-align: center;
}
</pre>
<p>That&#8217;s it! This is how you create a website out of a PSD template, basically. And this is how you use divs. It&#8217;s all about setting up the height, width, padding, margins. Really, there is no magic to it.</p>
<p>Altogether, here&#8217;s the basic layout in divs:</p>
<pre class="brush: xml;">
&lt;body&gt;
&lt;div id=&quot;header&quot;&gt;&lt;/div&gt;

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

 &lt;div id=&quot;sidebar&quot;&gt;
  &lt;div id=&quot;sidebartop&quot;&gt;&lt;/div&gt;
  &lt;div id=&quot;sidebarmiddle&quot;&gt;&lt;/div&gt;
  &lt;div id=&quot;sidebarbottom&quot;&gt;&lt;/div&gt;
  &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
 &lt;/div&gt;

 &lt;div id=&quot;contentwrap&quot;&gt;
  &lt;div id=&quot;content&quot;&gt;&lt;/div&gt;
  &lt;div id=&quot;psfooter&quot;&gt;&lt;/div&gt;
  &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
 &lt;/div&gt;

&lt;/div&gt;

&lt;div id=&quot;footer&quot;&gt;&lt;/div&gt;

&lt;/body&gt;
</pre>
<p>Using the CSS, you can define the rest of the properties as shown at the beginning (ie. width, height, float, margins, background, border etc).</p>
<p>In my next tutorial, I&#8217;ll be covering the correct way to slice a PSD template for HTML/CSS use. Remember to use the same measurements in photoshop as in CSS and HTML!</p>
<h1>Overview</h1>
<p>A &lt;div&gt; or division, is a section of a webpage that shares the same properties. They&#8217;re easily recognizable, there is a div for a sidebar, for the content, the header, and the footer.</p>
<p>If you want multiple divs next to each other, create a &#8220;wrapper&#8221; div that will group the multiple divs together. Next, make the divs &#8220;float:left&#8221; to ensure they&#8217;ll be next to each other. After every &#8220;float&#8221;ing div, employ the &#8220;clear&#8221; div with the properties &#8220;clear:both; height: 1px&#8221;.</p>
<p>If you want to have rounded corners on your webpage and still retain a variable height of the division, create three separate divs nested in the original. One for the top, one for the middle, and one for the bottom. The top and bottom will contain the part of the background with the rounded corners. USE PNG!</p>
<p>&lt;div&gt;s may look confusing at first but once you start working with them, you&#8217;ll appreciate the options they provide you with.</p>
<p>See you next time!<br />
</p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-6-intro-to-divs%2F&amp;partner=sociable" title="Print"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-6-intro-to-divs%2F&amp;title=CSS%20Lesson%206%3A%20Intro%20to%20Divs&amp;bodytext=Alright%2C%20alright.%20So%20I%20skipped%20all%20that%20fuss%20with%20horizontal%20navbars%20but%20that%20stuff%20is%20easy%20so%20I%27ll%20create%20a%20short%20article%20on%20it%20later.%0D%0A%0D%0ALet%27s%20start%20with%20the%20%26lt%3Bdiv%26gt%3B%20tag.%20It%27s%20what%20I%27ll%20be%20covering.%20Making%20use%20of%20div%27s%20with%20CSS.%20You%27ll%20need%20to%20" title="Digg"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-6-intro-to-divs%2F&amp;title=CSS%20Lesson%206%3A%20Intro%20to%20Divs&amp;notes=Alright%2C%20alright.%20So%20I%20skipped%20all%20that%20fuss%20with%20horizontal%20navbars%20but%20that%20stuff%20is%20easy%20so%20I%27ll%20create%20a%20short%20article%20on%20it%20later.%0D%0A%0D%0ALet%27s%20start%20with%20the%20%26lt%3Bdiv%26gt%3B%20tag.%20It%27s%20what%20I%27ll%20be%20covering.%20Making%20use%20of%20div%27s%20with%20CSS.%20You%27ll%20need%20to%20" title="del.icio.us"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-6-intro-to-divs%2F&amp;t=CSS%20Lesson%206%3A%20Intro%20to%20Divs" title="Facebook"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-6-intro-to-divs%2F&amp;title=CSS%20Lesson%206%3A%20Intro%20to%20Divs&amp;annotation=Alright%2C%20alright.%20So%20I%20skipped%20all%20that%20fuss%20with%20horizontal%20navbars%20but%20that%20stuff%20is%20easy%20so%20I%27ll%20create%20a%20short%20article%20on%20it%20later.%0D%0A%0D%0ALet%27s%20start%20with%20the%20%26lt%3Bdiv%26gt%3B%20tag.%20It%27s%20what%20I%27ll%20be%20covering.%20Making%20use%20of%20div%27s%20with%20CSS.%20You%27ll%20need%20to%20" title="Google Bookmarks"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-6-intro-to-divs%2F&amp;title=CSS%20Lesson%206%3A%20Intro%20to%20Divs&amp;source=Dave+PC+Guy+Computers+and+Technology&amp;summary=Alright%2C%20alright.%20So%20I%20skipped%20all%20that%20fuss%20with%20horizontal%20navbars%20but%20that%20stuff%20is%20easy%20so%20I%27ll%20create%20a%20short%20article%20on%20it%20later.%0D%0A%0D%0ALet%27s%20start%20with%20the%20%26lt%3Bdiv%26gt%3B%20tag.%20It%27s%20what%20I%27ll%20be%20covering.%20Making%20use%20of%20div%27s%20with%20CSS.%20You%27ll%20need%20to%20" title="LinkedIn"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-6-intro-to-divs%2F&amp;title=CSS%20Lesson%206%3A%20Intro%20to%20Divs" title="Reddit"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-6-intro-to-divs%2F&amp;t=CSS%20Lesson%206%3A%20Intro%20to%20Divs&amp;s=Alright%2C%20alright.%20So%20I%20skipped%20all%20that%20fuss%20with%20horizontal%20navbars%20but%20that%20stuff%20is%20easy%20so%20I%27ll%20create%20a%20short%20article%20on%20it%20later.%0D%0A%0D%0ALet%27s%20start%20with%20the%20%26lt%3Bdiv%26gt%3B%20tag.%20It%27s%20what%20I%27ll%20be%20covering.%20Making%20use%20of%20div%27s%20with%20CSS.%20You%27ll%20need%20to%20" title="Tumblr"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=CSS%20Lesson%206%3A%20Intro%20to%20Divs%20-%20http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-6-intro-to-divs%2F" title="Twitter"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=CSS%20Lesson%206%3A%20Intro%20to%20Divs&amp;body=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-6-intro-to-divs%2F" title="email"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=CSS%20Lesson%206%3A%20Intro%20to%20Divs&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-6-intro-to-divs%2F" title="Slashdot"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-6-intro-to-divs%2F&amp;title=CSS%20Lesson%206%3A%20Intro%20to%20Divs" title="StumbleUpon"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.davepcguy.com/archive/css-lesson-6-intro-to-divs/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>CSS Vertical Navigation</title>
		<link>http://www.davepcguy.com/archive/css-vertical-navigation/</link>
		<comments>http://www.davepcguy.com/archive/css-vertical-navigation/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 22:30:52 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[formatting]]></category>
		<category><![CDATA[lesson]]></category>
		<category><![CDATA[navigation]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[webpage]]></category>

		<guid isPermaLink="false">http://www.davepcguy.com/?p=471</guid>
		<description><![CDATA[CSS Vertical Navigation The List The CSS Sub-Menu Finally! Let&#8217;s check out vertical navigation. This tutorial will cover different tips and tricks on creating the vertical navigation bar. You can read my article on Color Theory and about Color Scheme Designer for more info on picking colors for your navbar. Most navbars, as I&#8217;ve heard,]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-vertical-navigation%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-vertical-navigation%2F&amp;source=clrkmck&amp;style=normal&amp;service_api=clrkmck%3AR_a73f58a91ed3515157df75ab6c37730f&amp;hashtags=css,formatting,lesson,navigation,text,webpage" height="61" width="50" /><br />
			</a>
		</div>
<ul>
<li>
<h1 style="padding:10px"><a href="http://www.davepcguy.com/archive/css-vertical-navigation/">CSS Vertical Navigation</a></h1>
<ul style="text-decoration: none; border: 1px solid black; list-style: none; margin-left: -1em; width: 150px; padding: 3px; display: block">
<li><a href="#list">The List</a></li>
<li><a href="#css">The CSS</a></li>
<li><a href="#sub">Sub-Menu</a></li>
</ul>
</li>
</ul>
<p>Finally! Let&#8217;s check out vertical navigation. This tutorial will cover different tips and tricks on creating the vertical navigation bar. You can read my article on Color Theory and about Color Scheme Designer for more info on picking colors for your navbar. Most navbars, as I&#8217;ve heard, depend on javascript for the more hardcore effects but I&#8217;ll show you how to create some dazzling, amazing navbars WITHOUT the knowledge of javascript. Which is great, because I don&#8217;t know javascript at all.<span id="more-471"></span></p>
<h1><a name="list">The List</a></h1>
<p>First we need to set up the navigation using lists and divs with unique id&#8217;s we&#8217;ll use in the CSS part. This is what it should look like:</p>
<blockquote><p>&lt;div id=&#8221;navdiv&#8221;&gt;<br />
&lt;ul id=&#8221;navlist&#8221;&gt;<br />
&lt;li&gt;&lt;a href=&#8221;link1.html&#8221;&gt;link one&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href=&#8221;link2.html&#8221;&gt;link two&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href=&#8221;link3.html&#8221;&gt;link three&lt;/a&gt;&lt;/li&gt;<br />
&lt;/ul&gt;<br />
&lt;/div&gt;</p></blockquote>
<p>Here we set up a container &#8220;div&#8221; to which you can apply numerous properties. But anyways, we have a nice list set up. Here&#8217;s what the same navbar would look like if you wanted a sub-menu to appear:</p>
<blockquote><p>&lt;div id=&#8221;navcontainer&#8221;&gt;<br />
&lt;ul id=&#8221;navlist&#8221;&gt;<br />
&lt;li&gt;&lt;a href=&#8221;link1.html&#8221;&gt;link one&lt;/a&gt;</p>
<p>&lt;ul id=&#8221;subnavlist&#8221;&gt;&lt;li&gt;&lt;a href=&#8221;link1a.html&#8221;&gt;link one a&lt;/a&gt;&lt;/li&gt;</p>
<p>&lt;li&gt;&lt;a href=&#8221;link1b.html&#8221;&gt;link one b&lt;/a&gt;&lt;/li&gt;</p>
<p>&lt;/ul&gt;</p>
<p>&lt;/li&gt;<br />
&#8230;..<br />
&lt;/ul&gt;<br />
&lt;/div&gt;</p></blockquote>
<p>The whole process can be done without id&#8217;s but if you want to implement this in your website, it may cause some confusion.</p>
<h1><a name="CSS">The CSS</a></h1>
<br />
Let&#8217;s set up the CSS then. First, we&#8217;ll want to define the width of the container:</p>
<blockquote><p>#navdiv {</p>
<p>160px;</p>
<p>}</p></blockquote>
<p>Result so far:</p>
<p><div id="attachment_539" class="wp-caption aligncenter" style="width: 159px"><a href="http://www.davepcguy.com/wp-content/uploads/2009/10/list1.png"><img class="size-full wp-image-539" title="list1" src="http://www.davepcguy.com/wp-content/uploads/2009/10/list1.png" alt="List" width="149" height="126" /></a><p class="wp-caption-text">List</p></div>
<p>Let&#8217;s talk about the navlist and set up the appropriate margins then:</p>
<blockquote><p>#navlist {</p>
<p>margin-left: 0;<br />
padding-left: 0;<br />
list-style-type: none;<br />
font-family: Arial, Helvetica, sans-serif;<br />
border: 1px solid black;</p>
<p>}</p></blockquote>
<p>Result so far:</p>
<div id="attachment_540" class="wp-caption aligncenter" style="width: 178px"><a href="http://www.davepcguy.com/wp-content/uploads/2009/10/list2.png"><img class="size-full wp-image-540" title="list2" src="http://www.davepcguy.com/wp-content/uploads/2009/10/list2.png" alt="List 2" width="168" height="109" /></a><p class="wp-caption-text">List 2</p></div>
<p>I&#8217;ve just basically reset some of the margin and padding values used as a default (it&#8217;s always good to include a general reset sheet at the beginning of the CSS file). I&#8217;ve also removed the bullet points from the side so that it&#8217;s an unordered list without any markings. I&#8217;ve set up the font-family (again, a reset) and put a border around our navigation.</p>
<p>Next, we&#8217;ll set up a couple values for the &#8220;a&#8221; element, that is all the hyperlinks involved will follow the style:</p>
<blockquote><p>#navlist a<br />
{<br />
display: block;<br />
padding: 3px;<br />
background-color: #FFFFFF;<br />
}</p></blockquote>
<p>Result so far:</p>
<div id="attachment_541" class="wp-caption aligncenter" style="width: 188px"><a href="http://www.davepcguy.com/wp-content/uploads/2009/10/list3.png"><img class="size-full wp-image-541" title="list3" src="http://www.davepcguy.com/wp-content/uploads/2009/10/list3.png" alt="List 3" width="178" height="153" /></a><p class="wp-caption-text">List 3</p></div>
<p>We&#8217;ve made it so that not only the WORDS of the hyperlinks will serve as a link but the whole block inside the division will be the hyperlink. It&#8217;s a sort of a nice effect. Check the final version to see what I mean.The padding of 3px is essential so that the navbar won&#8217;t be clumped together.</p>
<p>Next, we&#8217;ll tackle the a:link and a:visited:</p>
<blockquote><p>#navlist a:link, #navlist a:visited<br />
{<br />
color: #0000CC;<br />
text-decoration: none;<br />
}</p></blockquote>
<p>Result so far:</p>
<div id="attachment_542" class="wp-caption aligncenter" style="width: 177px"><a href="http://www.davepcguy.com/wp-content/uploads/2009/10/list4.png"><img class="size-full wp-image-542" title="list4" src="http://www.davepcguy.com/wp-content/uploads/2009/10/list4.png" alt="List 4" width="167" height="140" /></a><p class="wp-caption-text">List 4</p></div>
<p>We used these two pseudo classes and look where it&#8217;s gotten us. The links are no longer underlined (a success!) and they will also not change color once clicked which, I think, is highly desirable in a navbar. One more effect to go and then we&#8217;ll move onto the sub-menu:</p>
<blockquote><p>#navlist a:hover<br />
{<br />
background-color: #369;<br />
color: #fff;</p>
<p>}</p></blockquote>
<p>Result so far:</p>
<p><a href="http://www.davepcguy.com/wp-content/uploads/2009/10/list5.png"><img class="aligncenter size-full wp-image-543" title="list5" src="http://www.davepcguy.com/wp-content/uploads/2009/10/list5.png" alt="list5" width="169" height="137" /></a></p>
<p>Here&#8217;s a nifty effect. When you hover over the link, not only will it show up as a block (defined above) but it will also change color of the background as well as the text. If you delete the sub-menus from the list, you&#8217;ll get a nice clean navigation. If you keep the sub-menu items, you&#8217;ll get the result above.</p>
<h1><a name="sub">Sub-Menu</a></h1>
<p>Sub-menus, yay! Currently, only one sub-menu is supported which sucks but then again, who uses more than one sub-menu? Not me, that&#8217;s for sure. Let&#8217;s focus though. Here&#8217;s initial code concerning sub-menus:</p>
<blockquote><p>#navlist li&gt;ul{<br />
display: none;<br />
position: absolute;<br />
width: 100px;<br />
margin-top: -1.6em;<br />
margin-left: 157px;</p>
<p>}</p></blockquote>
<p>Result so far:</p>
<div id="attachment_544" class="wp-caption aligncenter" style="width: 180px"><a href="http://www.davepcguy.com/wp-content/uploads/2009/10/list6.png"><img class="size-full wp-image-544" title="list6" src="http://www.davepcguy.com/wp-content/uploads/2009/10/list6.png" alt="List 6" width="170" height="85" /></a><p class="wp-caption-text">List 6</p></div>
<p>First of all, this is how your navigation bar will look like without sub-menus. Second, this is what it will look like when the sub-menus are not shown.</p>
<p>Ah, so here we go. By using li&gt;ul, we&#8217;re only defining lists listed under other lists, now that&#8217;s a mouthful. The &#8220;display: none&#8221; makes the sub-menu invisible for the moment. The position is absolute so when placing this on your website, make sure to change the values accordingly. The only part that will need changing is probably &#8220;margin-left&#8221;. If you set a different width for the original list, you&#8217;ll have to adjust for that. Let&#8217;s look at why we need the &#8220;margin-top&#8221; in the negatives. This is what a simple list looks like:</p>
<blockquote>
<ul>
<li>one
<ul>
<li>one A</li>
<li> one B</li>
</ul>
</li>
<li> two</li>
</ul>
</blockquote>
<p>See what happened? The nested list has moved down and right. What we want though, is to have the list right NEXT to its parent list item like this:</p>
<blockquote>
<ul>
<li>one
<ul style="margin-top: -1.4em; margin-left: 40px">
<li>one A</li>
<li> one B</li>
</ul>
</li>
<li> two</li>
</ul>
</blockquote>
<p>The usual value is about -1.4em for margin-top to get the lists lined up but you&#8217;ll have to experiment if you added any padding, margins, and such. Like in the list we&#8217;re making, I had to adjust by putting -1.6 em. For margin-left, The value here is 40px.</p>
<p>Let&#8217;s make the sub-menu appear:</p>
<blockquote><p>#navlist li:hover&gt;ul {<br />
display: block;<br />
}</p></blockquote>
<p>And that&#8217;s it. We&#8217;re finished, this last piece will make the sub-menu appear when the original list is hovered over. There are many ways to re-make this navigation bar to make it prettier but these are the basics. Try experimenting with borders, padding, backgrounds, and such and see what you get.</p>
<p>Final result:</p>
<div id="attachment_545" class="wp-caption aligncenter" style="width: 286px"><a href="http://www.davepcguy.com/wp-content/uploads/2009/10/list7.png"><img class="size-full wp-image-545" title="list7" src="http://www.davepcguy.com/wp-content/uploads/2009/10/list7.png" alt="Final List" width="276" height="90" /></a><p class="wp-caption-text">Final List</p></div>
<p>Here&#8217;s the final code:</p>
<blockquote><p>&lt;head&gt;<br />
&lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html; charset=utf-8&#8243; /&gt;<br />
&lt;title&gt;Untitled Document&lt;/title&gt;<br />
&lt;style type=&#8217;text/css&#8217;&gt;<br />
/* NAVIGATION */<br />
#navcontainer {<br />
width: 160px;<br />
padding: 100px;<br />
}</p>
<p>#navlist<br />
{<br />
margin-left: 0;<br />
padding-left: 0;<br />
list-style-type: none;<br />
font-family: Arial, Helvetica, sans-serif;<br />
border: 1px solid black;</p>
<p>}</p>
<p>#navlist a<br />
{<br />
display: block;<br />
padding: 3px;<br />
background-color: #FFFFFF;<br />
}</p>
<p>#navlist a:link, #navlist a:visited<br />
{<br />
color: #0000CC;<br />
text-decoration: none;<br />
}</p>
<p>#navlist a:hover<br />
{<br />
background-color: #369;<br />
color: #fff;</p>
<p>}</p>
<p>#navlist li&gt;ul{<br />
display: none;<br />
position: absolute;<br />
width: 100px;</p>
<p>margin-top: -1.6em;<br />
margin-left: 158px;</p>
<p>}</p>
<p>#navlist li:hover&gt;ul {<br />
display: block;<br />
}</p>
<p>&lt;/style&gt;<br />
&lt;/head&gt;</p>
<p>&lt;body&gt;<br />
&lt;div id=&#8221;navcontainer&#8221;&gt;&lt;ul id=&#8221;navlist&#8221;&gt;<br />
&lt;li&gt;&lt;a href=&#8221;link1.html&#8221;&gt;link one&lt;/a&gt;<br />
&lt;ul id=&#8221;navlist&#8221;&gt;&lt;li&gt;&lt;a href=&#8221;link1a.html&#8221;&gt;link one A &lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href=&#8221;linkoneb.html&#8221;&gt;link one B &lt;/a&gt;&lt;/li&gt;<br />
&lt;/ul&gt;<br />
&lt;li&gt;&lt;a href=&#8221;link2.html&#8221;&gt;link two&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href=&#8221;link3.html&#8221;&gt;link three&lt;/a&gt;&lt;/li&gt;<br />
&lt;/ul&gt;<br />
&lt;/div&gt;<br />
&lt;/body&gt;</p></blockquote>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-vertical-navigation%2F&amp;partner=sociable" title="Print"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-vertical-navigation%2F&amp;title=CSS%20Vertical%20Navigation&amp;bodytext=%0D%0A%09%0D%0ACSS%20Vertical%20Navigation%0D%0A%0D%0A%09The%20List%0D%0A%09The%20CSS%0D%0A%09Sub-Menu%0D%0A%0D%0A%0D%0A%0D%0AFinally%21%20Let%27s%20check%20out%20vertical%20navigation.%20This%20tutorial%20will%20cover%20different%20tips%20and%20tricks%20on%20creating%20the%20vertical%20navigation%20bar.%20You%20can%20read%20my%20article%20on%20Color%20Theory%20an" title="Digg"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-vertical-navigation%2F&amp;title=CSS%20Vertical%20Navigation&amp;notes=%0D%0A%09%0D%0ACSS%20Vertical%20Navigation%0D%0A%0D%0A%09The%20List%0D%0A%09The%20CSS%0D%0A%09Sub-Menu%0D%0A%0D%0A%0D%0A%0D%0AFinally%21%20Let%27s%20check%20out%20vertical%20navigation.%20This%20tutorial%20will%20cover%20different%20tips%20and%20tricks%20on%20creating%20the%20vertical%20navigation%20bar.%20You%20can%20read%20my%20article%20on%20Color%20Theory%20an" title="del.icio.us"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-vertical-navigation%2F&amp;t=CSS%20Vertical%20Navigation" title="Facebook"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-vertical-navigation%2F&amp;title=CSS%20Vertical%20Navigation&amp;annotation=%0D%0A%09%0D%0ACSS%20Vertical%20Navigation%0D%0A%0D%0A%09The%20List%0D%0A%09The%20CSS%0D%0A%09Sub-Menu%0D%0A%0D%0A%0D%0A%0D%0AFinally%21%20Let%27s%20check%20out%20vertical%20navigation.%20This%20tutorial%20will%20cover%20different%20tips%20and%20tricks%20on%20creating%20the%20vertical%20navigation%20bar.%20You%20can%20read%20my%20article%20on%20Color%20Theory%20an" title="Google Bookmarks"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-vertical-navigation%2F&amp;title=CSS%20Vertical%20Navigation&amp;source=Dave+PC+Guy+Computers+and+Technology&amp;summary=%0D%0A%09%0D%0ACSS%20Vertical%20Navigation%0D%0A%0D%0A%09The%20List%0D%0A%09The%20CSS%0D%0A%09Sub-Menu%0D%0A%0D%0A%0D%0A%0D%0AFinally%21%20Let%27s%20check%20out%20vertical%20navigation.%20This%20tutorial%20will%20cover%20different%20tips%20and%20tricks%20on%20creating%20the%20vertical%20navigation%20bar.%20You%20can%20read%20my%20article%20on%20Color%20Theory%20an" title="LinkedIn"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-vertical-navigation%2F&amp;title=CSS%20Vertical%20Navigation" title="Reddit"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-vertical-navigation%2F&amp;t=CSS%20Vertical%20Navigation&amp;s=%0D%0A%09%0D%0ACSS%20Vertical%20Navigation%0D%0A%0D%0A%09The%20List%0D%0A%09The%20CSS%0D%0A%09Sub-Menu%0D%0A%0D%0A%0D%0A%0D%0AFinally%21%20Let%27s%20check%20out%20vertical%20navigation.%20This%20tutorial%20will%20cover%20different%20tips%20and%20tricks%20on%20creating%20the%20vertical%20navigation%20bar.%20You%20can%20read%20my%20article%20on%20Color%20Theory%20an" title="Tumblr"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=CSS%20Vertical%20Navigation%20-%20http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-vertical-navigation%2F" title="Twitter"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=CSS%20Vertical%20Navigation&amp;body=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-vertical-navigation%2F" title="email"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=CSS%20Vertical%20Navigation&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-vertical-navigation%2F" title="Slashdot"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-vertical-navigation%2F&amp;title=CSS%20Vertical%20Navigation" title="StumbleUpon"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.davepcguy.com/archive/css-vertical-navigation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CSS Lesson 4 Lists</title>
		<link>http://www.davepcguy.com/archive/css-lesson-4-lists/</link>
		<comments>http://www.davepcguy.com/archive/css-lesson-4-lists/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 19:24:54 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[formatting]]></category>
		<category><![CDATA[lesson]]></category>
		<category><![CDATA[lists]]></category>
		<category><![CDATA[navbar]]></category>
		<category><![CDATA[webpage]]></category>

		<guid isPermaLink="false">http://www.davepcguy.com/?p=469</guid>
		<description><![CDATA[Lists HTML CSS Lists are an important part of CSS, they are used to primarily make navbars. I&#8217;ll cover some basics with you and how to set up your list. In my NEXT tutorial, I&#8217;ll show you how to make VERTICAL navbars. I know, I know, you&#8217;re asking, &#8220;Why are you splitting it up?&#8221; Well,]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-4-lists%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-4-lists%2F&amp;source=clrkmck&amp;style=normal&amp;service_api=clrkmck%3AR_a73f58a91ed3515157df75ab6c37730f&amp;hashtags=css,formatting,lesson,lists,navbar,webpage" height="61" width="50" /><br />
			</a>
		</div>
<ul style="list-style: circle inside">
<li>
<h1 style="padding: 20px; font-size: 45px; color: white; text-shadow: 0px 1px .3px black"><a href="http://www.davepcguy.com/archive/css-lesson-4-lists/">Lists</a> </h1>
<ol style="list-style: lower-greek inside">
<li><a href="#html">HTML</a></li>
<li><a href="#css">CSS</a></li>
</ol>
</li>
</ul>
<p>Lists are an important part of CSS, they are used to primarily make navbars. I&#8217;ll cover some basics with you and how to set up your list. In my NEXT tutorial, I&#8217;ll show you how to make VERTICAL navbars. I know, I know, you&#8217;re asking, &#8220;Why are you splitting it up?&#8221; Well, mostly because I&#8217;ll have to cover vertical and horizontal navigation separately. There are tips and tricks to both, and although some apply to both, many do not. I&#8217;m starting out with lists all alone because it&#8217;s easier that way. When you need to review an item in CSS, you can switch between the different lessons and it won&#8217;t be all jumbled up.  I&#8217;ve found that numerous tutorials online do not explain this area thoroughly enough so I hope it will help you out.<br />
<span id="more-469"></span><br />
</p>
<ul>
<li>
<h1 style="padding: 15px"><a name="html">Lists (HTML)</a></h1>
</li>
</ul>
<p>Lists are important in PHP, and especially to navbars so I plan to spend some time discussing the HTML as well. There are two basic types of lists: an ordered list that starts with the tag &lt;ol&gt; and an unordered list &lt;ul&gt;. The idea is that you enclose a list in these tags and then write out each item with the tags &lt;li&gt; surrounding them. Here is what it should look like:</p>
<blockquote><p>&lt;ul&gt;</p>
<p>&lt;li&gt;first item&lt;/li&gt;</p>
<p>&lt;li&gt;second item&lt;/li&gt;</p>
<p>&lt;/ul&gt;</p>
<ul>
<li>first item</li>
<li>second item</li>
</ul>
</blockquote>
<p>Substitute &lt;ol&gt; for &lt;ul&gt; and you&#8217;ll get a numbered list:</p>
<blockquote>
<ol>
<li>first item</li>
<li>second item</li>
</ol>
</blockquote>
<p>There are also definition lists but you won&#8217;t need to know these to create navbars, at least not with me, but here is how they work. You start out with a &lt;dl&gt; tag to tell the browser you&#8217;re making a definition list. Then you list a definition term &lt;dt&gt; followed by the defintion description &lt;dd&gt; like this:</p>
<blockquote><p>&lt;dl&gt;</p>
<p>&lt;dt&gt;cow&lt;/dt&gt;</p>
<p>&lt;dd&gt;an animal&lt;/dd&gt;</p>
<p>&lt;dt&gt;dog&lt;/dt&gt;</p>
<p>&lt;dd&gt;another animal&lt;/dd&gt;</p>
<p>&lt;/dl&gt;</p>
<dl>
<dt>cow</dt>
<dd>an animal</dd>
<dt>dog</dt>
<dd>another animal</dd>
</dl>
</blockquote>
<p>One more thing, you can embed multiple lists by starting another list inside a list. Let me show you:</p>
<blockquote><p>&lt;ul&gt;</p>
<p>&lt;li&gt;first item</p>
<p>&lt;ul&gt;</p>
<p>&lt;li&gt;item a&lt;/li&gt;</p>
<p>&lt;li&gt;item b&lt;/li&gt;</p>
<p>&lt;/ul&gt;</p>
<p>&lt;/li&gt;</p>
<p>&lt;li&gt;second item&lt;/li&gt;</p>
<p>&lt;/ul&gt;</p>
<ul>
<li>first item
<ul>
<li>item a</li>
<li>item b</li>
</ul>
</li>
<li>second item</li>
</ul>
</blockquote>
<p>And that&#8217;s it for the HTML part. Simple, huh? Well remember it. All you need to really remember is how to start an unordered list with &lt;ul&gt; and that each item in the list has to be enclosed within the &lt;li&gt; tag.</p>
<ul>
<li>
<h1 style="padding: 15px"><a name="css">Lists (CSS)</a></h1>
</li>
</ul>
<p>The above was just to make sure you know how to do all of that basic stuff. Let&#8217;s move onto the basic CSS when it comes to lists. Now, you may wonder, what basics? Well, to create a navbar, you need to know everything from the previous lessons, especially all that stuff about borders and padding. There are SOME properties only inherent to lists, and that&#8217;s what I&#8217;ll deal with here.</p>
<p>Let&#8217;s start with the <strong>unordered list</strong>. You see those bullet points on the left of the item? Let&#8217;s change them to something else:</p>
<blockquote>
<p style="text-align: left;">ul.circle {list-style-type: circle}</p>
<ul style="list-style-type:circle">
<li>circle</li>
</ul>
<p style="text-align: left;">ul.square {list-style-type: square}</p>
<ul style="list-style-type:square">
<li>square</li>
</ul>
<p style="text-align: left;">ul.disc {list-style-type: disc}</p>
<ul style="list-style-type:disc">
<li>disc</li>
</ul>
<p style="text-align: left;">ul.none {list-style-type: none}</p>
<ul style="list-style-type:none">
<li>none</li>
</ul>
</blockquote>
<p>For the <strong>ordered list, </strong>you can use the same as above except in the CSS you&#8217;d change &#8220;ul&#8221; to &#8220;ol&#8221;. You can also use the following:</p>
<blockquote><p>ol.armenian {list-style-type: armenian}</p>
<ol style="list-style-type:armenian">
<li>armenian</li>
</ol>
<p>ol.decimal {list-style-type: decimal}</p>
<ol style="list-style-type:decimal">
<li>decimal</li>
</ol>
<p>ol.leadingzero {list-style-type: decimal-leading-zero}</p>
<ol style="list-style-type:decimal-leading-zero">
<li>decimal-leading-zero</li>
</ol>
<p>ol.georgian {list-style-type: georgian}</p>
<ol style="list-style-type:georgian">
<li>georgian</li>
</ol>
<p>ol.loweralpha {list-style-type: lower-alpha}</p>
<ol style="list-style-type:lower-alpha">
<li>lower-alpha</li>
</ol>
<p>ol.upperalpha {list-style-type: upper-alpha}</p>
<ol style="list-style-type:upper-alpha">
<li>upper-alpha</li>
</ol>
<p>ol.lowergreek {list-style-type: lower-greek}</p>
<ol style="list-style-type:lower-greek">
<li>lower-greek</li>
</ol>
<p>ol.lowerlatin {list-style-type: lower-latin}</p>
<ol style="list-style-type:lower-latin">
<li>lower-latin</li>
</ol>
<p>ol.upperlatin {list-style-type: upper-latin}</p>
<ol style="list-style-type:upper-latin">
<li>upper-latin</li>
</ol>
<p>ol.lowerroman {list-style-type: lower-roman}</p>
<ol style="list-style-type:lower-roman">
<li>lower-roman</li>
</ol>
<p>ol.upperroman {list-style-type: upper-roman}</p>
<ol style="list-style-type:upper-roman">
<li>upper-roman</li>
</ol>
</blockquote>
<p><strong>List-style-position</strong> is the next property,  its values are &#8220;inside&#8221; and &#8220;outside&#8221;. The default is set to &#8220;outside&#8221; and it determines the indent of the list. If you want the indent to be counted from the beginning of the text, it&#8217;s &#8220;outside&#8221;. If you want the text to start from the bulletpoint, use inside.</p>
<blockquote><p>&lt;ul style=&#8221;list-style-position: inside&#8221;&gt;</p>
<ul style="list-style-position: inside">
<li>text</li>
</ul>
<p>&lt;ul style=&#8221;list-style-position: outside&#8221;&gt;</p>
<ul style="list-style-position: outside">
<li>text</li>
</ul>
</blockquote>
<p>Let&#8217;s say you want an image to replace the bulletpoint, you set up a special &#8220;arrow&#8221; or whatever to replace it. You can do that using <strong>list-style-image</strong> and the following formula:</p>
<blockquote><p>ul { list-style-image: url(&#8216;image.png&#8217;) }</p></blockquote>
<p>Replace image.png with the right address. Unfortunately, this style is not supported by all browsers so I&#8217;ll use a little trick mentioned at <a href="http://www.w3schools.com/css/tryit.asp?filename=trycss_list_background-image">W3Schools:</a></p>
<blockquote><p>ul<br />
{<br />
list-style-type:none;<br />
padding:0px;<br />
margin:0px;<br />
}<br />
li<br />
{<br />
background-image:url(&#8216;arrow.png&#8217;);<br />
background-repeat:no-repeat;<br />
background-position:0px 5px;<br />
padding-left:14px;<br />
}</p></blockquote>
<p>All you do there is remove the lis-style-type and added a background image to the &lt;li&gt; tag that will be used as the bullet point. Finally, let&#8217;s look at the <strong>shorthand</strong>:</p>
<blockquote><p>ul {</p>
<p>list-style: none outside url(arrow.png);</p>
<p>}</p></blockquote>
<p>The order of properties is: type, position, image.</p>
<p>That&#8217;s it for lists! Yeah, nothing exciting, I know but it&#8217;s essential to know these things before moving on to navigation bars.</p>
<p>Here&#8217;s what we&#8217;ll be dealing with in my next tutorial by putting all the previous tutorial information together:</p>
<div id="attachment_501" class="wp-caption aligncenter" style="width: 172px"><a href="http://www.davepcguy.com/wp-content/uploads/2009/09/navbar.html"><img class="size-full wp-image-501" title="navbar" src="http://www.davepcguy.com/wp-content/uploads/2009/09/navbar.png" alt="NAvBar picture" width="162" height="79" /></a><p class="wp-caption-text">NAvBar picture</p></div>
<p>Click on the picture and it&#8217;ll take you to an example vertical navbar</p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-4-lists%2F&amp;partner=sociable" title="Print"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-4-lists%2F&amp;title=CSS%20Lesson%204%20Lists&amp;bodytext=Lists%20HTMLCSS%0D%0ALists%20are%20an%20important%20part%20of%20CSS%2C%20they%20are%20used%20to%20primarily%20make%20navbars.%20I%27ll%20cover%20some%20basics%20with%20you%20and%20how%20to%20set%20up%20your%20list.%20In%20my%20NEXT%20tutorial%2C%20I%27ll%20show%20you%20how%20to%20make%20VERTICAL%20navbars.%20I%20know%2C%20I%20know%2C%20you%27re%20asking%2C%20%22" title="Digg"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-4-lists%2F&amp;title=CSS%20Lesson%204%20Lists&amp;notes=Lists%20HTMLCSS%0D%0ALists%20are%20an%20important%20part%20of%20CSS%2C%20they%20are%20used%20to%20primarily%20make%20navbars.%20I%27ll%20cover%20some%20basics%20with%20you%20and%20how%20to%20set%20up%20your%20list.%20In%20my%20NEXT%20tutorial%2C%20I%27ll%20show%20you%20how%20to%20make%20VERTICAL%20navbars.%20I%20know%2C%20I%20know%2C%20you%27re%20asking%2C%20%22" title="del.icio.us"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-4-lists%2F&amp;t=CSS%20Lesson%204%20Lists" title="Facebook"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-4-lists%2F&amp;title=CSS%20Lesson%204%20Lists&amp;annotation=Lists%20HTMLCSS%0D%0ALists%20are%20an%20important%20part%20of%20CSS%2C%20they%20are%20used%20to%20primarily%20make%20navbars.%20I%27ll%20cover%20some%20basics%20with%20you%20and%20how%20to%20set%20up%20your%20list.%20In%20my%20NEXT%20tutorial%2C%20I%27ll%20show%20you%20how%20to%20make%20VERTICAL%20navbars.%20I%20know%2C%20I%20know%2C%20you%27re%20asking%2C%20%22" title="Google Bookmarks"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-4-lists%2F&amp;title=CSS%20Lesson%204%20Lists&amp;source=Dave+PC+Guy+Computers+and+Technology&amp;summary=Lists%20HTMLCSS%0D%0ALists%20are%20an%20important%20part%20of%20CSS%2C%20they%20are%20used%20to%20primarily%20make%20navbars.%20I%27ll%20cover%20some%20basics%20with%20you%20and%20how%20to%20set%20up%20your%20list.%20In%20my%20NEXT%20tutorial%2C%20I%27ll%20show%20you%20how%20to%20make%20VERTICAL%20navbars.%20I%20know%2C%20I%20know%2C%20you%27re%20asking%2C%20%22" title="LinkedIn"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-4-lists%2F&amp;title=CSS%20Lesson%204%20Lists" title="Reddit"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-4-lists%2F&amp;t=CSS%20Lesson%204%20Lists&amp;s=Lists%20HTMLCSS%0D%0ALists%20are%20an%20important%20part%20of%20CSS%2C%20they%20are%20used%20to%20primarily%20make%20navbars.%20I%27ll%20cover%20some%20basics%20with%20you%20and%20how%20to%20set%20up%20your%20list.%20In%20my%20NEXT%20tutorial%2C%20I%27ll%20show%20you%20how%20to%20make%20VERTICAL%20navbars.%20I%20know%2C%20I%20know%2C%20you%27re%20asking%2C%20%22" title="Tumblr"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=CSS%20Lesson%204%20Lists%20-%20http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-4-lists%2F" title="Twitter"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=CSS%20Lesson%204%20Lists&amp;body=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-4-lists%2F" title="email"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=CSS%20Lesson%204%20Lists&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-4-lists%2F" title="Slashdot"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-4-lists%2F&amp;title=CSS%20Lesson%204%20Lists" title="StumbleUpon"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.davepcguy.com/archive/css-lesson-4-lists/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CSS: Lesson 3</title>
		<link>http://www.davepcguy.com/archive/css-lesson-3/</link>
		<comments>http://www.davepcguy.com/archive/css-lesson-3/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 00:41:26 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[formatting]]></category>
		<category><![CDATA[tables]]></category>
		<category><![CDATA[webpage]]></category>

		<guid isPermaLink="false">http://www.davepcguy.com/?p=422</guid>
		<description><![CDATA[CSS Lesson 3 So, here we are, another CSS lesson. What do I plan to teach you today? Well, a couple of things, in my last Lesson, I discussed padding and borders among other things. Those are all part of what is called the &#8220;Box Model.&#8221; I&#8217;ll finish up discussing that theory with outline and]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-3%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-3%2F&amp;source=clrkmck&amp;style=normal&amp;service_api=clrkmck%3AR_a73f58a91ed3515157df75ab6c37730f&amp;hashtags=css,formatting,tables,webpage" height="61" width="50" /><br />
			</a>
		</div>
<table style="border-collapse: collapse; table-layout: auto; margin: 20px 30px 40px; outline:ridge thin; caption-side:bottom" border="0">
<caption>
<h1 style="font-size: 50px">CSS</h1>
</caption>
<tbody>
<tr>
<td width="100%">
<h2 style="font-size: 25px">Lesson</h2>
</td>
<td width="100%">
<h2 style="font-size: 25px">3</h2>
</td>
</tr>
</tbody>
</table>
<p style="margin: 40px 0px 0px">So, here we are, another CSS lesson. What do I plan to teach you today? Well, a couple of things, in my last<a href="http://www.davepcguy.com/archive/css-lesson-2-fonts-padding-and-border/"> Lesson</a>, I discussed padding and borders among other things. Those are all part of what is called the <a href="http://www.w3schools.com/css/css_boxmodel.asp">&#8220;Box Model.&#8221; </a>I&#8217;ll finish up discussing that theory with outline and margin. After that, we&#8217;ll look at lists and tables, probably in the next tutorial. So here&#8217;s what you&#8217;ll learn today:</p>
<ul>
<li><a href="#margin">margin</a></li>
<li><a href="#outline">outline</a></li>
<li><a href="#tables">tables</a></li>
</ul>
<p><span id="more-422"></span></p>
<h1><a name="margin"><strong>Margin</strong></a></h1>
<p>Margin is the outermost part of the &#8220;Box.&#8221; It&#8217;s right beyond the border and there is nothing beyond it in the model. It works almost just like padding except it&#8217;s OUTSIDE of the border and it is always transparent. I hope you read my last article because setting up a margin works the same way as setting up any other part of the box.</p>
<blockquote><p>margin: 10px</p></blockquote>
<p>This will create a 10 pixel margin all around your border. If no border is present, then around your content. You can set the margins separately for each side:</p>
<blockquote><p>margin-left: 10px</p>
<p>margin-right: 5px</p>
<p>margin-bottom: 15px</p>
<p>margin-top: 20px</p></blockquote>
<p>Read my about <a href="http://www.davepcguy.com/archive/css-lesson-2-fonts-padding-and-border/#padding">padding</a> to learn about the shorthand. I&#8217;ll just summarize the above as an example:</p>
<blockquote><p>margin: 20px 5px 15px 10px</p></blockquote>
<p>Also, you can set the margin to &#8220;auto&#8221; which will trigger the browser&#8217;s default setting.</p>
<h1><a name="outline"><strong>Outline</strong></a></h1>
<p>Outline works similar to the border but it is outside of the border and inside of the margin. It&#8217;s always a line, but you can adjust the thickness. Actually, it&#8217;s JUST like the <a href="http://www.davepcguy.com/archive/css-lesson-2-fonts-padding-and-border/#border">border</a>. Just look:</p>
<blockquote><p>outline-color: blue;</p>
<p>outline-style: dotted;</p>
<p>outline-width: thick;</p></blockquote>
<p>Color is self-explanatory. As for <strong>style</strong>, you can use &#8220;none&#8221;, &#8220;dotted&#8221;, &#8220;dashed&#8221;, &#8220;solid&#8221;, &#8220;double&#8221;, &#8220;groove&#8221;, &#8220;ridge&#8221;, &#8220;inset&#8221;, and &#8220;outset&#8221;. There is no &#8220;hidden&#8221;, mind that. If you want to see how each of these look, go to CSS: Lesson 2 article and check the borders. The link is somewhere above for it. For <strong>outline-width</strong>, you can use &#8220;thin&#8221;, &#8220;medium&#8221;, &#8220;thick&#8221;, or an actual numerical value (10px, 50%, 2em). Here, the difference is, you cannot set these properties for each individual side of the outline. Here is an example:</p>
<blockquote><p>p.outline {<br />
outline: blue dashed thin</p>
<p>}</p>
<p style="outline: blue dashed thin">Example text</p>
</blockquote>
<h1><a name="tables"><strong>Tables</strong></a></h1>
<p>Let&#8217;s move onto tables. Make sure you know the <a href="http://www.w3schools.com/html/html_tables.asp">HTML code </a>for tables well. Let&#8217;s review anyways. Here&#8217;s how you make a simple table with two headers, two rows, and two columns</p>
<blockquote><p>&lt;table border=&#8221;1&#8243;&gt;</p>
<p>&lt;caption&gt;My Simple Table&lt;/caption&gt;</p>
<p>&lt;tr&gt;</p>
<p>&lt;th&gt; Numbers &lt;/th&gt;</p>
<p>&lt;th&gt;Letters &lt;/th&gt;</p>
<p>&lt;/tr&gt;</p>
<p>&lt;tr&gt;</p>
<p>&lt;td&gt; 1&lt;/td&gt;</p>
<p>&lt;td&gt;A &lt;/td&gt;</p>
<p>&lt;/tr&gt;</p>
<p>&lt;tr&gt;</p>
<p>&lt;td&gt;2&lt;/td&gt;</p>
<p>&lt;td&gt;B &lt;/td&gt;</p>
<p>&lt;/tr&gt;</p>
<p>&lt;/table&gt;</p></blockquote>
<blockquote>
<table border="1">
<caption>My Simple Table</caption>
<tbody>
<tr>
<th> Numbers</th>
<th>Letters</th>
</tr>
<tr>
<td>1</td>
<td>A</td>
</tr>
<tr>
<td>2</td>
<td>B</td>
</tr>
</tbody>
</table>
</blockquote>
<p>Here&#8217;s the basic structure, you start the <strong>&lt;table&gt;</strong>, you can define the &lt;<strong>th&gt; </strong>which is headings or the &lt;<strong>caption&gt;</strong>.  Then, first &lt;<strong>tr&gt; </strong>for row, <strong>&lt;td&gt;</strong>for the columns. Close the tag after each term, etc. Read up on it, it&#8217;s easy stuff.</p>
<p>Let&#8217;s move onto the CSS. The first property to look at is <strong>table-layout</strong> which has two values &#8220;fixed&#8221;, and &#8220;auto&#8221;.</p>
<p>Let&#8217;s look at the difference:</p>
<blockquote>
<table style="table-layout:fixed" border="1" width="100%">
<caption>Fixed table</caption>
<tbody>
<tr>
<th> Numbers</th>
<th>Letters</th>
</tr>
<tr>
<td>100000000000000</td>
<td>A</td>
</tr>
<tr>
<td>200000000000000</td>
<td>B</td>
</tr>
</tbody>
</table>
<table style="table-layout:auto" border="1" width="100%">
<caption>Auto table</caption>
<tbody>
<tr>
<th> Numbers</th>
<th>Letters</th>
</tr>
<tr>
<td>100000000000000</td>
<td>A</td>
</tr>
<tr>
<td>200000000000000</td>
<td>B</td>
</tr>
</tbody>
</table>
</blockquote>
<p>I had to add width=&#8221;100%&#8221; to the table tag to REALLY show you the difference. As you can see, the &#8220;auto&#8221; makes the table adjust so that it compensates for the difference of content in the table. Here&#8217;s a neat property called <strong>empty-cells </strong>which can make the empty cells either &#8220;hide&#8221; or &#8220;show&#8221;. Unfortunately, the default CSS settings in WordPress won&#8217;t allow me to show you that. Just try it out in wordpad. Next property is called <strong>border-collapse</strong> with the values &#8220;separate&#8221; and &#8220;collapse&#8221;. Here&#8217;s the difference:</p>
<blockquote>
<table style="border-collapse: separate" border="1">
<caption>Separate</caption>
<tbody>
<tr>
<td>one</td>
<td>two</td>
</tr>
</tbody>
</table>
<table style="border-collapse: collapse" border="1">
<caption>Collapse</caption>
<tbody>
<tr>
<td>one</td>
<td>two</td>
</tr>
</tbody>
</table>
</blockquote>
<p>That was fun, there&#8217;s also <strong>border-spacing</strong> with a numerical value (23px, 3em, etc) wherein you specify how far the borders are. After that, there&#8217;s only <strong>caption-side</strong> which determines where the caption will be. It has two values &#8220;top&#8221; and &#8220;bottom&#8221;. Let&#8217;s look at a table with a caption on the bottom. WordPress, once again, doesn&#8217;t seem to want to show border spacing. I&#8217;m not sure why, but that&#8217;s alright. I used &lt;table style=&#8221;caption-side:bottom; border-spacing: 20xp&#8221; border=&#8221;1&#8243;&gt; , as you can see in the example below, the border-spacing did not work (even when I set the border-collapse to separate):</p>
<blockquote>
<table style="caption-side: bottom; border-spacing: 20xp" border="1">
<caption>Caption</caption>
<tbody>
<tr>
<td>one</td>
<td>two</td>
<td>three</td>
</tr>
<tr>
<td>four</td>
<td>five</td>
<td>six</td>
</tr>
<tr>
<td>seven</td>
<td>eight</td>
<td>nine</td>
</tr>
</tbody>
</table>
</blockquote>
<p>Anyways, that&#8217;s it again. I hope you enjoyed reading the tutorial. In my next tutorial, we&#8217;ll tackle lists, which is a very important part of CSS because using lists, you can create amazing nav bars. I&#8217;ll show you all of that.</p>
<p>Also, as per usual, the header of the article:</p>
<blockquote><p>&lt;table style=&#8221;border-collapse: collapse; table-layout: auto; margin: 20px 30px 40px; outline:ridge thin; caption-side:bottom&#8221; border=&#8221;0&#8243;&gt;&lt;caption&gt;<br />
&lt;h1 style=&#8221;font-size: 50px&#8221;&gt;CSS&lt;/h1&gt;<br />
&lt;/caption&gt;<br />
&lt;tbody&gt;<br />
&lt;tr&gt;<br />
&lt;td width=&#8221;100%&#8221;&gt;<br />
&lt;h2 style=&#8221;font-size: 25px&#8221;&gt;Lesson&lt;/h2&gt;<br />
&lt;/td&gt;<br />
&lt;td width=&#8221;100%&#8221;&gt;<br />
&lt;h2 style=&#8221;font-size: 25px&#8221;&gt;3&lt;/h2&gt;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/tbody&gt;&lt;/table&gt;</p></blockquote>
<p>I also set a 40px top margin on the paragraph below it.</p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-3%2F&amp;partner=sociable" title="Print"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-3%2F&amp;title=CSS%3A%20Lesson%203%20&amp;bodytext=%0D%0ACSS%0D%0A%0D%0A%0D%0A%0D%0A%0D%0ALesson%0D%0A%0D%0A%0D%0A3%0D%0A%0D%0A%0D%0A%0D%0ASo%2C%20here%20we%20are%2C%20another%20CSS%20lesson.%20What%20do%20I%20plan%20to%20teach%20you%20today%3F%20Well%2C%20a%20couple%20of%20things%2C%20in%20my%20last%20Lesson%2C%20I%20discussed%20padding%20and%20borders%20among%20other%20things.%20Those%20are%20all%20part%20of%20what%20is%20called%20the%20%22Box" title="Digg"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-3%2F&amp;title=CSS%3A%20Lesson%203%20&amp;notes=%0D%0ACSS%0D%0A%0D%0A%0D%0A%0D%0A%0D%0ALesson%0D%0A%0D%0A%0D%0A3%0D%0A%0D%0A%0D%0A%0D%0ASo%2C%20here%20we%20are%2C%20another%20CSS%20lesson.%20What%20do%20I%20plan%20to%20teach%20you%20today%3F%20Well%2C%20a%20couple%20of%20things%2C%20in%20my%20last%20Lesson%2C%20I%20discussed%20padding%20and%20borders%20among%20other%20things.%20Those%20are%20all%20part%20of%20what%20is%20called%20the%20%22Box" title="del.icio.us"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-3%2F&amp;t=CSS%3A%20Lesson%203%20" title="Facebook"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-3%2F&amp;title=CSS%3A%20Lesson%203%20&amp;annotation=%0D%0ACSS%0D%0A%0D%0A%0D%0A%0D%0A%0D%0ALesson%0D%0A%0D%0A%0D%0A3%0D%0A%0D%0A%0D%0A%0D%0ASo%2C%20here%20we%20are%2C%20another%20CSS%20lesson.%20What%20do%20I%20plan%20to%20teach%20you%20today%3F%20Well%2C%20a%20couple%20of%20things%2C%20in%20my%20last%20Lesson%2C%20I%20discussed%20padding%20and%20borders%20among%20other%20things.%20Those%20are%20all%20part%20of%20what%20is%20called%20the%20%22Box" title="Google Bookmarks"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-3%2F&amp;title=CSS%3A%20Lesson%203%20&amp;source=Dave+PC+Guy+Computers+and+Technology&amp;summary=%0D%0ACSS%0D%0A%0D%0A%0D%0A%0D%0A%0D%0ALesson%0D%0A%0D%0A%0D%0A3%0D%0A%0D%0A%0D%0A%0D%0ASo%2C%20here%20we%20are%2C%20another%20CSS%20lesson.%20What%20do%20I%20plan%20to%20teach%20you%20today%3F%20Well%2C%20a%20couple%20of%20things%2C%20in%20my%20last%20Lesson%2C%20I%20discussed%20padding%20and%20borders%20among%20other%20things.%20Those%20are%20all%20part%20of%20what%20is%20called%20the%20%22Box" title="LinkedIn"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-3%2F&amp;title=CSS%3A%20Lesson%203%20" title="Reddit"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-3%2F&amp;t=CSS%3A%20Lesson%203%20&amp;s=%0D%0ACSS%0D%0A%0D%0A%0D%0A%0D%0A%0D%0ALesson%0D%0A%0D%0A%0D%0A3%0D%0A%0D%0A%0D%0A%0D%0ASo%2C%20here%20we%20are%2C%20another%20CSS%20lesson.%20What%20do%20I%20plan%20to%20teach%20you%20today%3F%20Well%2C%20a%20couple%20of%20things%2C%20in%20my%20last%20Lesson%2C%20I%20discussed%20padding%20and%20borders%20among%20other%20things.%20Those%20are%20all%20part%20of%20what%20is%20called%20the%20%22Box" title="Tumblr"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=CSS%3A%20Lesson%203%20%20-%20http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-3%2F" title="Twitter"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=CSS%3A%20Lesson%203%20&amp;body=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-3%2F" title="email"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=CSS%3A%20Lesson%203%20&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-3%2F" title="Slashdot"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-3%2F&amp;title=CSS%3A%20Lesson%203%20" title="StumbleUpon"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.davepcguy.com/archive/css-lesson-3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CSS: Lesson 2 Fonts, Padding, and Border</title>
		<link>http://www.davepcguy.com/archive/css-lesson-2-fonts-padding-and-border/</link>
		<comments>http://www.davepcguy.com/archive/css-lesson-2-fonts-padding-and-border/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 21:23:46 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[background]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[formatting]]></category>
		<category><![CDATA[lesson]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[webpage]]></category>

		<guid isPermaLink="false">http://www.davepcguy.com/?p=346</guid>
		<description><![CDATA[CSS Lesson 2 In lesson 1, I talked about backgrounds and text. Let&#8217;s move on, I&#8217;ll start out by expanding on the text manipulation with fonts and continue by the introduction of  what I call &#8220;general formatting.&#8221; General formatting includes the definition of padding, borders, margins, and outlines. At the end of the lesson, you]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-2-fonts-padding-and-border%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-2-fonts-padding-and-border%2F&amp;source=clrkmck&amp;style=normal&amp;service_api=clrkmck%3AR_a73f58a91ed3515157df75ab6c37730f&amp;hashtags=background,css,fonts,formatting,lesson,text,webpage" height="61" width="50" /><br />
			</a>
		</div>
<h1 style="font-size: 30px; font-weight: bolder; text-align: center; padding: 10px; background: grey; color: white; border: thick outset grey; text-shadow:0px 1.4px 3px black">CSS Lesson 2</h1>
<p>In <a href="http://www.davepcguy.com/archive/css-lesson-1/">lesson 1</a>, I talked about backgrounds and text. Let&#8217;s move on, I&#8217;ll start out by expanding on the text manipulation with fonts and continue by the introduction of  what I call &#8220;general formatting.&#8221; General formatting includes the definition of padding, borders, margins, and outlines. At the end of the lesson, you should know how to create the above banner and more<span id="more-346"></span></p>
<p>Here&#8217;s an overview of what you&#8217;ll learn in this lesson:</p>
<ul>
<li><a href="#fonts">Fonts</a></li>
<li><a href="#padding">Padding</a></li>
<li><a href="#border">Border</a></li>
</ul>
<h1><strong><a name="fonts">Fonts </a></strong></h1>
<p>We&#8217;ve already learned that there are multiple ways to manipulate the text in your HTML document through CSS. You can add text-decoration, align the text (text-align), change the line-height, word-spacing, and a lot of other stuff. Now let&#8217;s look at the font.</p>
<p>The general idea with Fonts is to use CSS to specify a group of fonts you&#8217;d like to use in HTML. If the browser does not support the first font, it will fall back on the next available font, and so on. There are three different general groups of fonts. There is &#8220;Serif&#8221;, &#8220;Sans-Serif&#8221;, and &#8220;Mono-Space&#8221;. Serif is the group of fonts with those little lines at the end of characters. Here is how you write it:</p>
<blockquote><p>p.sans {font-family:Arial, Helvetica, sans-serif}</p>
<p style="font-family: Arial, Helvetica, sans-serif">Sans-serif</p>
<p>p.serif {font-family:&#8221;Times New Roman&#8221;, Times, serif}</p>
<p style="font-family: Times, Serif">Serif</p>
<p>p.monospace {font-family:&#8221;Courier New&#8221;, Courier, monospace}</p>
<p style="font-family: Courier, monospace">monospace</p>
</blockquote>
<p>Let&#8217;s continue. When you use fonts that have multiple words, use quotations as shown above. You can mix and match different fonts but try to stick to fonts that look similar. Here are some basic properties:</p>
<blockquote><p>&lt;p style=&#8221;font-size: 1.5em; font-variant: small-caps; font-weight: 200&#8243;&gt;</p>
<p><span style="font-size: 1.5em; font-variant: small caps; font-weight: 200">hello</span></p>
<p>&lt;/p&gt;</p></blockquote>
<p><strong>Font-size</strong> is self-explanatory, you can use &#8220;pt&#8221; for points, &#8220;px&#8221; for pixels, percent, and &#8220;em&#8221; which is a CSS unit of measurement, usually equaled to about 16px. It&#8217;s a unit of measurement that depends on the browser, the default browser size would be 1em, so if you want one and a half that size you&#8217;d use 1.5em. <strong>Font-variant</strong> only controls if the text has &#8220;small caps&#8221; or if it&#8217;s going to be &#8220;normal&#8221;. <strong>Font-weight</strong> specifies the font weight, obviously, or the boldness of the font. You can use values such as &#8220;bold, &#8220;bolder&#8221;, &#8220;lighter&#8221;, &#8220;normal&#8221;, and then go by &#8220;100&#8243;, &#8220;200&#8243; etc.</p>
<p>Let&#8217;s look at <strong>Font-style</strong>. Font-style has the values &#8220;normal&#8221;, &#8220;italic&#8221;, and &#8220;oblique&#8221; (don&#8217;t use this one).</p>
<p>Finally, let&#8217;s look at <strong>Font</strong> itself, under the property font, you can declare all the different values at once.</p>
<blockquote><p>body { font: bolder small-caps italic 2.4em/3em Arial, Helvetica, Sans-serif }<br />
<span style="font: bolder small-caps italic 2.4em/3em Arial, Helvetica, Sans-serif ">This is the modified text </span></p></blockquote>
<p>As you can see, you can modify a lot using just the &#8220;font&#8221; property. There are some additional font values such as &#8220;caption&#8221;, &#8220;icon&#8221;, &#8220;status-bar&#8221;, &#8220;small-caption&#8221;, &#8220;message-box&#8221;, and &#8220;menu&#8221;. All of these modify the font to correspond with the font usage. &#8220;Message-box&#8221; for example, uses the font that&#8217;s used by form/dialog boxes. &#8220;Caption&#8221; is used by buttons, drop down menus etc.</p>
<h1><strong><a name="padding">Padding </a></strong></h1>
<p>For every content area, like a box, there are four different sections. There is the content, the padding, the border, and margin in that order from the middle to the outside of the box. We&#8217;ll start with padding first, which is the area directly around the content. It &#8220;clears&#8221; the area around the content, let&#8217;s say text, for the background and under elements.</p>
<p>Let&#8217;s try to define some padding:</p>
<blockquote><p>&lt;p style=&#8221;padding-top: 10px; padding-bottom: 10px; padding-left: 15px; padding-right: 15px; background: black; color: white&#8221;&gt;</p>
<p style="padding-top: 10px; padding-bottom: 10px; padding-left: 15px; padding-right: 5px; background: black; color: white">Padded text</p>
</blockquote>
<p>Well that didn&#8217;t work out as I planned, it seems as if WordPress has its own formatting that I cannot bypass. <a href="http://www.w3schools.com/css/tryit.asp?filename=trycss_padding_sides">Here</a> is a better example you can play around with by <a href="http://www.w3schools.com">W3Schools</a>. Let&#8217;s learn the short-hand. To express the above, you could have written it as the following:</p>
<blockquote><p>&lt;p style=&#8221;padding: 10px 10px 15px 15px&#8221;&gt;</p>
<p>or</p>
<p>&lt;p style=&#8221;padding: 10px 15px&#8221;&gt;</p></blockquote>
<p>You have to express all the values otherwise, your CSS will be interpreted wrongly. Let&#8217;s say you have four different values:</p>
<blockquote><p>a, b, c, and d</p></blockquote>
<p>where a is the top, b is the right, c is the bottom, and d is the left (clockwise):</p>
<blockquote><p>padding: a b c d</p></blockquote>
<p>Let&#8217;s say &#8220;b&#8221; and &#8220;d&#8221; are equal:</p>
<blockquote><p>padding: a bd c</p></blockquote>
<p>&#8220;bd&#8221; would be a single value. In this example, the following is short-hand: &#8220;top&#8221;, &#8220;left and right&#8221;, &#8220;bottom&#8221;. If you input only two values such as &#8220;ac bd&#8221; then it&#8217;s: &#8220;top and bottom&#8221;, &#8220;left and right&#8221;. A single value &#8220;abcd&#8221; would apply to all padding. Oh and when I say &#8220;abcd&#8221;, I don&#8217;t mean the multiplication but rather that it applies to all values. For example, if a=15px, and so does b, c, and d. You&#8217;d have to only write:</p>
<blockquote><p>padding: 15px</p></blockquote>
<p>You can use any other lenght-specifying measurements such as em and %.</p>
<h1><strong><a name="border">Border </a></strong></h1>
<p>Let&#8217;s look at Borders, the next area around content. We specified the padding already which is affected by the background element of the content area. The border can have its own style and its own background and color.</p>
<p>Let&#8217;s start with <strong>border-style: </strong></p>
<blockquote><p>p.bordernone {border-style: none}</p>
<p><span style="border-style:dotted">p.borderdotted {border-style: dotted}</span></p>
<p><span style="border-style: solid">p.bordersolid {border-style: solid} </span></p>
<p><span style="border-style: double">p.borderdouble {border-style: double} </span></p>
<p><span style="border-style: groove"> p.bordergroove {border-style:groove}</span></p>
<p><span style="border-style: ridge">p.borderridge {border-style: ridge}</span></p>
<p><span style="border-style:inset">p.borderinset {border-style: inset} </span></p>
<p><span style="border-style: outset">p.borderoutset {border-style: outset} </span></p>
<p><span style="border-style: hidden">p.borderhidden {border-style: hidden} </span></p></blockquote>
<p>These are all the borders available for your own use. As you can see, I coded the code so that the code itself is an example. If you want to use the above for your own purposes, look in the source and type in &#8220;border-style&#8221; into the search bar. You can change the width of the border line with<strong> border-width</strong>. Which, in addition to normal measurements, also accepts the values &#8220;thin&#8221;, &#8220;medium&#8221;, and &#8220;thick&#8221;. Another property you can define is <strong>border-color</strong>.</p>
<p>Now, let&#8217;s say you want the width, color, AND the style different for each side of the border? Here&#8217;s how you do it:</p>
<blockquote><p>p.complicatedborder {</p>
<p>border-top-style: solid;</p>
<p>border-top-width: 5px;</p>
<p>border-top-color: black;</p>
<p>border-right-style: dotted;</p>
<p>border-right-width: 10px;</p>
<p>border-right-color: white;</p>
<p>etc&#8230;.</p>
<p>}</p></blockquote>
<p>I&#8217;m not going to write it all out, but you get the idea. Where it says &#8220;top&#8221; or &#8220;right&#8221;, substitute it with &#8220;bottom&#8221; or &#8220;left&#8221; and you can apply it to the bottom or left sides. It works the same for all of the sides. Here&#8217;s the short-hand:</p>
<blockquote><p>p.lesscomplicatedborder{</p>
<p>border-left: 15px groove blue;</p>
<p>border-bottom: 7px double red;</p>
<p>}</p></blockquote>
<p>The shorthand is used the following way: &#8220;border-(side): width style color;&#8221; You can use this method on all sides by declaring &#8220;border: width style color&#8221; and not including the side tidbit. One last thing, let&#8217;s say you need to only define the border styles but are too lazy and will instead resort to shorthand?</p>
<blockquote><p>p.borderstyles {</p>
<p>border: dotted solid hidden inset;</p>
<p>}</p></blockquote>
<p>This part works the same as the shorthand for padding. If you have four values they&#8217;ll apply to : top right bottom left, respectively. Three values: top right/left bottom. Two values: top/bottom left/right. One value: top/bottom/left/right.<br />
That&#8217;s it! In my next tutorial, I&#8217;ll address outlines and margins.</p>
<p>As always, here is the code for the header:</p>
<blockquote><p>&lt;h1 style=&#8221;font-size: 30px; font-weight: bolder; text-align: center; padding: 10px; background: grey; color: white; border: thick outset grey; text-shadow:0px 1.4px 3px black&#8221;&gt;CSS Lesson 2&lt;/h1&gt;</p></blockquote>




Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-2-fonts-padding-and-border%2F&amp;partner=sociable" title="Print"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-2-fonts-padding-and-border%2F&amp;title=CSS%3A%20Lesson%202%20Fonts%2C%20Padding%2C%20and%20Border&amp;bodytext=CSS%20Lesson%202%0D%0AIn%20lesson%201%2C%20I%20talked%20about%20backgrounds%20and%20text.%20Let%27s%20move%20on%2C%20I%27ll%20start%20out%20by%20expanding%20on%20the%20text%20manipulation%20with%20fonts%20and%20continue%20by%20the%20introduction%20of%C2%A0%20what%20I%20call%20%22general%20formatting.%22%20General%20formatting%20includes%20the%20def" title="Digg"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-2-fonts-padding-and-border%2F&amp;title=CSS%3A%20Lesson%202%20Fonts%2C%20Padding%2C%20and%20Border&amp;notes=CSS%20Lesson%202%0D%0AIn%20lesson%201%2C%20I%20talked%20about%20backgrounds%20and%20text.%20Let%27s%20move%20on%2C%20I%27ll%20start%20out%20by%20expanding%20on%20the%20text%20manipulation%20with%20fonts%20and%20continue%20by%20the%20introduction%20of%C2%A0%20what%20I%20call%20%22general%20formatting.%22%20General%20formatting%20includes%20the%20def" title="del.icio.us"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-2-fonts-padding-and-border%2F&amp;t=CSS%3A%20Lesson%202%20Fonts%2C%20Padding%2C%20and%20Border" title="Facebook"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-2-fonts-padding-and-border%2F&amp;title=CSS%3A%20Lesson%202%20Fonts%2C%20Padding%2C%20and%20Border&amp;annotation=CSS%20Lesson%202%0D%0AIn%20lesson%201%2C%20I%20talked%20about%20backgrounds%20and%20text.%20Let%27s%20move%20on%2C%20I%27ll%20start%20out%20by%20expanding%20on%20the%20text%20manipulation%20with%20fonts%20and%20continue%20by%20the%20introduction%20of%C2%A0%20what%20I%20call%20%22general%20formatting.%22%20General%20formatting%20includes%20the%20def" title="Google Bookmarks"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-2-fonts-padding-and-border%2F&amp;title=CSS%3A%20Lesson%202%20Fonts%2C%20Padding%2C%20and%20Border&amp;source=Dave+PC+Guy+Computers+and+Technology&amp;summary=CSS%20Lesson%202%0D%0AIn%20lesson%201%2C%20I%20talked%20about%20backgrounds%20and%20text.%20Let%27s%20move%20on%2C%20I%27ll%20start%20out%20by%20expanding%20on%20the%20text%20manipulation%20with%20fonts%20and%20continue%20by%20the%20introduction%20of%C2%A0%20what%20I%20call%20%22general%20formatting.%22%20General%20formatting%20includes%20the%20def" title="LinkedIn"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-2-fonts-padding-and-border%2F&amp;title=CSS%3A%20Lesson%202%20Fonts%2C%20Padding%2C%20and%20Border" title="Reddit"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-2-fonts-padding-and-border%2F&amp;t=CSS%3A%20Lesson%202%20Fonts%2C%20Padding%2C%20and%20Border&amp;s=CSS%20Lesson%202%0D%0AIn%20lesson%201%2C%20I%20talked%20about%20backgrounds%20and%20text.%20Let%27s%20move%20on%2C%20I%27ll%20start%20out%20by%20expanding%20on%20the%20text%20manipulation%20with%20fonts%20and%20continue%20by%20the%20introduction%20of%C2%A0%20what%20I%20call%20%22general%20formatting.%22%20General%20formatting%20includes%20the%20def" title="Tumblr"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=CSS%3A%20Lesson%202%20Fonts%2C%20Padding%2C%20and%20Border%20-%20http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-2-fonts-padding-and-border%2F" title="Twitter"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=CSS%3A%20Lesson%202%20Fonts%2C%20Padding%2C%20and%20Border&amp;body=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-2-fonts-padding-and-border%2F" title="email"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=CSS%3A%20Lesson%202%20Fonts%2C%20Padding%2C%20and%20Border&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-2-fonts-padding-and-border%2F" title="Slashdot"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-2-fonts-padding-and-border%2F&amp;title=CSS%3A%20Lesson%202%20Fonts%2C%20Padding%2C%20and%20Border" title="StumbleUpon"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.davepcguy.com/archive/css-lesson-2-fonts-padding-and-border/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>CSS: Lesson 1</title>
		<link>http://www.davepcguy.com/archive/css-lesson-1/</link>
		<comments>http://www.davepcguy.com/archive/css-lesson-1/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 18:32:35 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[background]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[dreamweaver]]></category>
		<category><![CDATA[formatting]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://www.davepcguy.com/?p=306</guid>
		<description><![CDATA[A tutorial on text and background manipulation using CSS: cascading style sheets. Also included is a short introduction to using DreamWeaver as your CSS editor. Most properties and values usable for the two main topics are included!]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-1%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-1%2F&amp;source=clrkmck&amp;style=normal&amp;service_api=clrkmck%3AR_a73f58a91ed3515157df75ab6c37730f&amp;hashtags=background,css,dreamweaver,formatting,text" height="61" width="50" /><br />
			</a>
		</div>
<h1 style="text-align:center; text-shadow: 0px .5px 2px black; color: black; font-size: 26pt; text-decoration:underline; letter-spacing:14px;">CSS Lesson1</h1>
<hr />CSS is a lot of fun once you start it, the same way PHP is a lot of fun. So here&#8217;s what I&#8217;ve learned so far.</p>
<ol>
<li><a href="#implement">Ways to implement CSS</a></li>
<li><a href="#dreamweaver">CSS in DreamWeaver</a></li>
<li><a href="#bgr">Backgrounds in CSS</a></li>
<li><a href="#text">Text in CSS </a></li>
</ol>
<p><span id="more-306"></span></p>
<p><strong><br />
</strong></p>
<p><a name="implement"><strong>Ways to implement CSS</strong><br />
</a><br />
There are three different ways to use styles:</p>
<ol>
<li>Using an <strong>External Style Sheet</strong>: You do this by creating a .css file. This file has the lowest priority when it comes to style use UNLESS you reference it in the &lt;head&gt; AFTER you use the internal style sheets. You can reference the file this way: &lt;link href=&#8221;style.css&#8221; rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; /&gt;</li>
<li><strong>Internal Style Sheet </strong>is another method of using styles. This style will only apply to the html document it&#8217;s in. It has the second highest priority but only when the external style sheet is referenced before it. This style sheet is in the &lt;head&gt; tag and you can use it by defining styles between these two tags: &lt;style type=&#8221;text/css&#8221;&gt; &lt;/style&gt;</li>
<li><strong>In-line Styles</strong> are of the highest priority and will override any other styles.  Here&#8217;s an example: &lt;p style=&#8221;color: #000000&#8243;&gt;.</li>
</ol>
<p><a name="dreamweaver"><strong>CSS in DreamWeaver</strong></a></p>
<p>CSS is made unbelievably easy in DreamWeaver. Once you start typing something about a style, let&#8217;s say you type &lt;style type=&#8221;text/css&#8221;&gt; and you type &#8220;p { text&#8221;, you&#8217;ll get a list of properties to choose from:</p>
<p><a href="http://www.davepcguy.com/wp-content/uploads/2009/09/option.jpg"><img class="aligncenter size-full wp-image-307" title="option" src="http://www.davepcguy.com/wp-content/uploads/2009/09/option.jpg" alt="option" width="196" height="173" /></a>Once you hit enter, you&#8217;ll be presented with another set of options for the value of the property:</p>
<p><a href="http://www.davepcguy.com/wp-content/uploads/2009/09/option2.jpg"><img class="aligncenter size-full wp-image-308" title="option2" src="http://www.davepcguy.com/wp-content/uploads/2009/09/option2.jpg" alt="option2" width="206" height="110" /></a><a href="http://www.davepcguy.com/wp-content/uploads/2009/09/dock.jpg"><img class="size-medium wp-image-309 alignleft" title="dock" src="http://www.davepcguy.com/wp-content/uploads/2009/09/dock-196x300.jpg" alt="dock" width="196" height="300" /></a>You&#8217;ve also the option to use the CSS dock on the right. If you can&#8217;t see it, go to Window&gt;&gt;CSS Styles and the dock should appear. As you can see, I already have a couple styles defined in my document: &lt;p&gt; and &lt;body&gt;. I&#8217;ve selected &#8220;p&#8221; and you can see that there is one property defined and that is &#8220;color&#8221; and that color is white.  If you selected the &lt;body&gt; tag, you&#8217;d see something similar. You can add properties with the &#8220;Add Property&#8221; button which will bring up a list of properties and then a list of values as above.</p>
<p>The three buttons on the bottom left will let you change the view of the properties:</p>
<p>1. <strong>Category view </strong>will show you all the available properties in different categories with values (if any) in the right column</p>
<p>2. <strong>Alphabetical view </strong>serves to show you the list of available properties in an alphabetical order</p>
<p>3. <strong>Set Property view</strong> is the view that I have set in the picture.</p>
<p>The bottom right icons are all self-explanatory if you just hover over them. The first let&#8217;s you add a style sheet that will show up on top (see that style.css with a plus next to it?), the second button is for a new CSS rule, the third is to edit style and the fourth button erases a style.</p>
<p><a name="bgr"><strong>Backgrounds in CSS</strong></a></p>
<p>Let&#8217;s get started with some properties. Traditionally, you could use &lt;body bgcolor=&#8221;white&#8221;&gt; or &lt;body background=&#8221;image.jpg&#8221;&gt; for the background but you can also use CSS for this and not only that, but you can define a background color or a background image for &lt;h1&gt; tags and for &lt;p&gt; tags:</p>
<blockquote><p>body { background-image: url(&#8216;link.jpg&#8217;)}</p>
<p>p { background-color: white}</p></blockquote>
<p>Instead of the word &#8220;white, <strong>color</strong> can also be specified using the hex designated value: #FFFFFF or the RGB color: rgb(0,0,0). Here are three more background properties that are quite interesting:</p>
<blockquote><p>body {</p>
<p>background-position: bottom;</p>
<p>background-repeat: repeat-x;</p>
<p>background-attachment: scroll;</p>
<p>}</p></blockquote>
<p>The first property can be set for any given position (left, right, top etc) and supports more complicated positions (top left, top right), you can even use pixels (10px 34px) and percent (32% 23%). Repeat can have the following values: repeat-x, repeat-y, repeat, and no-repeat. Repeat-x repeats horizontally while repeat-y repeats vertically. &#8220;Repeat&#8221; will repeat the image non-stop in every way while &#8220;no-repeat&#8221; will keep the image from repeating ever. For the last property has two values: fixed or scroll. &#8220;Fixed&#8221; will keep the background moving as you scroll, ie the image will seem to scroll down with you. &#8220;Scroll&#8221; will keep the image where it is so that when you&#8217;re scrolling down, you&#8217;re scrolling down the image as well. It&#8217;s hard to explain so let me show you an example, go to my <a title="WAJANUS twitter" href="http://twitter.com/wajanusdesigns" target="_blank">twitter page</a> and try scrolling down. That&#8217;s &#8220;fixed&#8221; attachment.</p>
<p><a name="text"><strong>Text in CSS</strong></a></p>
<p>There are many properties you can assign to the text in many different ways. Text can be defined under the &lt;body&gt; tag, the &lt;h#&gt; tag (# = 1, 2, 3 etc), the &lt;p&gt; tag, and others. Let&#8217;s start with text-alignment. I&#8217;ll use the class system which works like this:</p>
<blockquote><p>p.nameofclass {text-align: justify}</p>
<p>&lt;p class=&#8221;nameofclass&#8221;&gt; hello &lt;/p&gt;</p></blockquote>
<p>In this example, the class name &#8220;nameofclass&#8221; can only be used with the &lt;p&gt; tag. The <strong>text-align</strong>: justify will tell the browser to space out the letters and the words to fill up the entire line, much like in magazines. Other text-align attributes:</p>
<blockquote><p>p.left {text-align: left}</p>
<p>p.right {text-align: right}</p>
<p>p.center {text-align:center}</p></blockquote>
<p>You can align the text: left, right, or at the center as well. The class names are not mandatory. Next, let&#8217;s do <strong>text-decoration</strong>.</p>
<blockquote><p>h1.strikethrough {text-decoration: line-through}</p>
<p>h2.lineabove {text-decoration: overline}</p>
<p>h3.lineunder {text-decoration: underline}</p></blockquote>
<p>There is also another decoration called &#8220;<strong>blink</strong>&#8221; but it&#8217;s not supported in Chrome, IE, nor Safari. It makes the text blink in and out of existence.</p>
<p>There are actually a lot of different properties that are text-related. There is &#8220;<strong>color</strong>&#8220;, that&#8217;s self-explanatory. There is &#8220;<strong>line-height</strong>&#8221; which specifies the amount of space between consecutive lines. There is also &#8220;<strong>direction</strong>&#8221; with the values of either &#8220;ltr&#8221; or &#8220;rtl&#8221; which specifies if the text will go left to right or right to left. You can specify the amount of space between words with &#8220;<strong>word-spacing</strong>&#8221; with that comes &#8220;<strong>letter-spacing</strong>&#8221; with a similar function but this one defines space between letters.</p>
<p>Here is an interesting text property: text-shadow. Here is what you can define it as:</p>
<blockquote><p>h2.shadow {text-shadow: 2px 3px 4px white}</p>
<h2 style="text-shadow: 2px 3px 4px black; color: white">h2 example</h2>
</blockquote>
<p>As you can see, it&#8217;s quite a fun property. The values are pretty easy to define. The first <strong>&#8220;text-shadow&#8221;</strong> value is the x-coordinate offset, the second value is the y-coordinate offset, the third value is the amount of blur, and the fourth value is the color of the shadow.</p>
<p>You can also make a &#8220;<strong>text-indent</strong>&#8221; which will make an indent at the beginning of your paragraph. There is a neat property called &#8220;<strong>text-transform&#8221; </strong>which has the values: uppercase, lowercase, and capitalize. Self-explanatory, I think. It&#8217;ll make all of your text in uppercase, lower case, or it will capitalize everything in your text (or the specified class or tag). Finally, there is a &#8220;<strong>white-space</strong>&#8221; property that has the values: pre and nowrap. &#8220;Pre&#8221; will wrap your text according to how you have it in your code ie if you put a line break (not &lt;br&gt; but just pressed enter) in your code, it will show it. The default will read the whole paragraph and the browser will word-wrap it once the line reaches a certain limit (the end of the page or of its container). &#8220;Nowrap&#8221; will defy that wrapping and the text will go on and on in width.</p>
<p>I hope you enjoyed my tutorial, I&#8217;ll have more to come soon. Here is a tip: for most properties that require a number value (letter-spacing etc) you can use several methods to define the value. I like to use pixels, but you can usually also use % and other methods.</p>
<p>Oh and here&#8217;s the code for the CSS:Lesson1 header above:</p>
<blockquote><p>&lt;h1 style=&#8221;text-align:center; text-shadow: 0px .5px 2px black; color: black; font-size: 26pt; text-decoration:underline; letter-spacing:14px;&#8221;&gt;CSS Lesson1&lt;/h1&gt;</p></blockquote>
<p>When I figure out how to make the font less pixelated, I&#8217;ll tell you <img src='http://www.davepcguy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Thank you for reading!<br />
</p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-1%2F&amp;partner=sociable" title="Print"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-1%2F&amp;title=CSS%3A%20Lesson%201&amp;bodytext=A%20tutorial%20on%20text%20and%20background%20manipulation%20using%20CSS%3A%20cascading%20style%20sheets.%20Also%20included%20is%20a%20short%20introduction%20to%20using%20DreamWeaver%20as%20your%20CSS%20editor.%20Most%20properties%20and%20values%20usable%20for%20the%20two%20main%20topics%20are%20included%21" title="Digg"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-1%2F&amp;title=CSS%3A%20Lesson%201&amp;notes=A%20tutorial%20on%20text%20and%20background%20manipulation%20using%20CSS%3A%20cascading%20style%20sheets.%20Also%20included%20is%20a%20short%20introduction%20to%20using%20DreamWeaver%20as%20your%20CSS%20editor.%20Most%20properties%20and%20values%20usable%20for%20the%20two%20main%20topics%20are%20included%21" title="del.icio.us"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-1%2F&amp;t=CSS%3A%20Lesson%201" title="Facebook"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-1%2F&amp;title=CSS%3A%20Lesson%201&amp;annotation=A%20tutorial%20on%20text%20and%20background%20manipulation%20using%20CSS%3A%20cascading%20style%20sheets.%20Also%20included%20is%20a%20short%20introduction%20to%20using%20DreamWeaver%20as%20your%20CSS%20editor.%20Most%20properties%20and%20values%20usable%20for%20the%20two%20main%20topics%20are%20included%21" title="Google Bookmarks"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-1%2F&amp;title=CSS%3A%20Lesson%201&amp;source=Dave+PC+Guy+Computers+and+Technology&amp;summary=A%20tutorial%20on%20text%20and%20background%20manipulation%20using%20CSS%3A%20cascading%20style%20sheets.%20Also%20included%20is%20a%20short%20introduction%20to%20using%20DreamWeaver%20as%20your%20CSS%20editor.%20Most%20properties%20and%20values%20usable%20for%20the%20two%20main%20topics%20are%20included%21" title="LinkedIn"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-1%2F&amp;title=CSS%3A%20Lesson%201" title="Reddit"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-1%2F&amp;t=CSS%3A%20Lesson%201&amp;s=A%20tutorial%20on%20text%20and%20background%20manipulation%20using%20CSS%3A%20cascading%20style%20sheets.%20Also%20included%20is%20a%20short%20introduction%20to%20using%20DreamWeaver%20as%20your%20CSS%20editor.%20Most%20properties%20and%20values%20usable%20for%20the%20two%20main%20topics%20are%20included%21" title="Tumblr"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=CSS%3A%20Lesson%201%20-%20http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-1%2F" title="Twitter"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=CSS%3A%20Lesson%201&amp;body=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-1%2F" title="email"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=CSS%3A%20Lesson%201&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-1%2F" title="Slashdot"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-lesson-1%2F&amp;title=CSS%3A%20Lesson%201" title="StumbleUpon"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.davepcguy.com/archive/css-lesson-1/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>CSS intro</title>
		<link>http://www.davepcguy.com/archive/css-intro/</link>
		<comments>http://www.davepcguy.com/archive/css-intro/#comments</comments>
		<pubDate>Sat, 19 Sep 2009 21:35:13 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[formatting]]></category>
		<category><![CDATA[webpage]]></category>

		<guid isPermaLink="false">http://www.davepcguy.com/?p=275</guid>
		<description><![CDATA[A short tutorial on CSS, telling you what it's all about, and how to use it. Simple and effective introduction to the material as a formatting and styling tool for HTML layouts.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-intro%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-intro%2F&amp;source=clrkmck&amp;style=normal&amp;service_api=clrkmck%3AR_a73f58a91ed3515157df75ab6c37730f&amp;hashtags=css,formatting,webpage" height="61" width="50" /><br />
			</a>
		</div>
<p style="text-align: center;"><a href="http://www.davepcguy.com/wp-content/uploads/2009/09/CSSintro.jpg"><img class="aligncenter size-full wp-image-284" title="CSS intro" src="http://www.davepcguy.com/wp-content/uploads/2009/09/CSSintro.jpg" alt="CSSintro" width="300" height="200" /></a></p>
<p>Okay, I know this topic is nothing new and you&#8217;ve read hundreds of tutorials about it, but for a newbie like me, it&#8217;s still fascinating.</p>
<p><a href="http://www.w3schools.com/css/default.asp">CSS</a> = cascading style sheets. Basically, <a href="http://www.w3.org/Style/CSS/">CSS</a> is a compilation of styles and <a href="http://www.csszengarden.com/">formatting</a> elements you can add to your HTML code such as different fonts, colors, and other. It has replaced older, more traditional tags such as &lt;font&gt; and &lt;align&gt;. The best way to use <a href="http://en.wikipedia.org/wiki/Css">CSS </a>is to create a separate .css file that you&#8217;ll link into your HTML code like this:<span id="more-275"></span></p>
<blockquote><p>&lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; href=&#8221;filename.css&#8221;&gt;</p></blockquote>
<p>Add that into your &lt;head&gt; tag and the whole html file will follow these rules. This basically tells the browser that there is a stylesheet CSS in text that can be found under the name &#8220;filename.css&#8221;. You can also create in-document styles using this tag in the &lt;head&gt;:</p>
<blockquote><p>&lt;style type=&#8221;text/css&#8221;&gt;</p></blockquote>
<p>After you place this tag into the document, just write your style definitions and end the tag with &lt;/style&gt;. Here is an example of that:</p>
<blockquote><p>&lt;head&gt;</p>
<p>&lt;style type=&#8221;text/css&#8221;&gt;</p>
<p>p {color: blue; margin-left: 5 px}</p>
<p>&lt;/style&gt;</p>
<p>&lt;/head&gt;</p></blockquote>
<p>I just created a style in which every &#8220;&lt;p&gt;&#8221; or paragraph in the HTML document will be in blue with a five pixels margin from the left. You can use this same technique for a specific paragraph, using the &lt;style&gt; tag, if you wish to like this:</p>
<blockquote><p>&lt;p style=&#8221;color: blue; margin-left: 5px&#8221;&gt;</p>
<p>Text</p>
<p>&lt;/p&gt;</p></blockquote>
<p>There are a few commonly used tags associated with CSS:</p>
<ul>
<li><strong>&lt;style&gt;- </strong>this tag gives you the straight style definition, there&#8217;s nothing more to it. You can use several different attributes with this tag.</li>
<li><strong>&lt;div&gt; </strong>- creates a division in the document. You can create a &#8220;block&#8221; in the HTML code using div. It&#8217;s usually used for formatting the layout of a page.</li>
<li>&lt;<strong>span&gt;- </strong>similar to div, span is meant for smaller portions of HTML to define. Usually used with &#8220;class&#8221; and &#8220;id&#8221; attributes</li>
<li>&lt;<strong>link&gt;-</strong>is pretty self-explanatory and used in an example at the beginning of this article</li>
</ul>
<p><strong>How to write CSS:</strong></p>
<p>CSS has a distinct form:</p>
<blockquote><p>.newstyle{</p>
<p>property: value;</p>
<p>}</p></blockquote>
<p>You can define a <strong>class</strong> this way and use it like this:</p>
<blockquote><p>.fontstyle{</p>
<p>font-weight: bold;</p>
<p>}</p>
<p>&lt;p class=&#8221;fontstyle&#8221;&gt; style text &lt;/p&gt;</p></blockquote>
<p>The text would show up bold. You can put multiple properties under one style but they always have to be separated by &#8220;;&#8221; (just like in PHP). Now, let&#8217;s say you want all of the paragraphs to be bold, there is no sense in applying &#8220;class&#8221; to each one of them so you can apply the value a <strong>tag</strong>:</p>
<blockquote><p>p {font-weight: bold;}</p></blockquote>
<p>Now all paragraphs will show up in bold. You can redefine basically any tag this way in CSS. It&#8217;s a very powerful tool. You can define <strong>multiple tags</strong> at once as well:</p>
<blockquote><p>h1, h2, p</p>
<p>{</p>
<p>color: green;</p>
<p>}</p></blockquote>
<p>The same way, you can use <strong>multiple classes</strong> on a tag:</p>
<blockquote><p>&lt;p class=&#8221;mystyle mystyle2 boldstyle&#8221;&gt;Text &lt;/p&gt;</p></blockquote>
<p>In this example, the paragraph will be formatted according to three separate classes. The possibilities are endless with CSS. Let&#8217;s look at &#8220;id&#8221;&#8216;s :</p>
<blockquote><p>#myid { color: green}</p>
<p>p#pid { text-align: left}</p></blockquote>
<p>The first is just a regular &#8216;id&#8217; that you can apply to basically almost any tag. The second definition can only be used with paragraphs or the &lt;p&gt; tag.</p>
<p>One last thing that you should probably know about CSS, how to make comments. This is similar to PHP:</p>
<blockquote><p>/* comment goes here */</p></blockquote>
<p>And that&#8217;s it. In my next tutorial, I&#8217;ll show you how to do a basic format of your page using CSS. See you next time!<br />
</p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-intro%2F&amp;partner=sociable" title="Print"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-intro%2F&amp;title=CSS%20intro&amp;bodytext=A%20short%20tutorial%20on%20CSS%2C%20telling%20you%20what%20it%27s%20all%20about%2C%20and%20how%20to%20use%20it.%20Simple%20and%20effective%20introduction%20to%20the%20material%20as%20a%20formatting%20and%20styling%20tool%20for%20HTML%20layouts." title="Digg"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-intro%2F&amp;title=CSS%20intro&amp;notes=A%20short%20tutorial%20on%20CSS%2C%20telling%20you%20what%20it%27s%20all%20about%2C%20and%20how%20to%20use%20it.%20Simple%20and%20effective%20introduction%20to%20the%20material%20as%20a%20formatting%20and%20styling%20tool%20for%20HTML%20layouts." title="del.icio.us"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-intro%2F&amp;t=CSS%20intro" title="Facebook"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-intro%2F&amp;title=CSS%20intro&amp;annotation=A%20short%20tutorial%20on%20CSS%2C%20telling%20you%20what%20it%27s%20all%20about%2C%20and%20how%20to%20use%20it.%20Simple%20and%20effective%20introduction%20to%20the%20material%20as%20a%20formatting%20and%20styling%20tool%20for%20HTML%20layouts." title="Google Bookmarks"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-intro%2F&amp;title=CSS%20intro&amp;source=Dave+PC+Guy+Computers+and+Technology&amp;summary=A%20short%20tutorial%20on%20CSS%2C%20telling%20you%20what%20it%27s%20all%20about%2C%20and%20how%20to%20use%20it.%20Simple%20and%20effective%20introduction%20to%20the%20material%20as%20a%20formatting%20and%20styling%20tool%20for%20HTML%20layouts." title="LinkedIn"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-intro%2F&amp;title=CSS%20intro" title="Reddit"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-intro%2F&amp;t=CSS%20intro&amp;s=A%20short%20tutorial%20on%20CSS%2C%20telling%20you%20what%20it%27s%20all%20about%2C%20and%20how%20to%20use%20it.%20Simple%20and%20effective%20introduction%20to%20the%20material%20as%20a%20formatting%20and%20styling%20tool%20for%20HTML%20layouts." title="Tumblr"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=CSS%20intro%20-%20http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-intro%2F" title="Twitter"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" /></a>
	<a rel="nofollow"  target="_blank" href="mailto:?subject=CSS%20intro&amp;body=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-intro%2F" title="email"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=CSS%20intro&amp;url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-intro%2F" title="Slashdot"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.davepcguy.com%2Farchive%2Fcss-intro%2F&amp;title=CSS%20intro" title="StumbleUpon"><img src="http://www.davepcguy.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.davepcguy.com/archive/css-intro/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
	</channel>
</rss>
