<?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>The portfolio of davekilljoy, formerly known as David B Stubbs</title>
	<atom:link href="http://www.davekilljoy.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.davekilljoy.com/blog</link>
	<description>Introductions, Tutorials and Resources for aspiring web developers everywhere</description>
	<lastBuildDate>Fri, 31 Jul 2009 16:33:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>This week in Blend &#8211; Reset</title>
		<link>http://www.davekilljoy.com/blog/2009/this-week-in-blend-reset/</link>
		<comments>http://www.davekilljoy.com/blog/2009/this-week-in-blend-reset/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 14:52:42 +0000</pubDate>
		<dc:creator>davekilljoy</dc:creator>
				<category><![CDATA[Expression Blend 3]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[blend]]></category>
		<category><![CDATA[expression blend]]></category>
		<category><![CDATA[tips of the week]]></category>

		<guid isPermaLink="false">http://www.davekilljoy.com/blog/?p=7</guid>
		<description><![CDATA[Hello all, I’m trying this new weekly Blend tip thing. These will be little tips and tricks that will hopefully alleviate some of the nuances and annoyances of Blend.
This week – Reset!
A lot of the time, Blend will set margins and odd settings automatically when you are doing edits on properties (width, height) or when [...]]]></description>
			<content:encoded><![CDATA[<p>Hello all, I’m trying this new weekly Blend tip thing. These will be little tips and tricks that will hopefully alleviate some of the nuances and annoyances of Blend.</p>
<h3>This week – Reset!</h3>
<p>A lot of the time, Blend will set margins and odd settings automatically when you are doing edits on properties (width, height) or when you are dragging objects around the Artboard. A quick and easy way to see what’s going on is by looking at the little square that is next to every property.</p>
<p><img class="size-medium wp-image-8" title="Tip1" src="http://www.davekilljoy.com/blog/wp-content/uploads/2009/07/Tip1-300x247.png" alt="Blend 3 Properties Panel " width="300" height="247" /></p>
<p><span id="more-7"></span></p>
<p>A blank square will denote that there is nothing set for that property, a white square means there is a property set, an orange square means there is a Binding set, and a green square means there is a Local Resource set.</p>
<p><img src="http://www.davekilljoy.com/blog/wp-content/uploads/2009/07/Tip4-300x248.png" alt="Tip4" title="Tip4" width="300" height="248" class="alignleft size-medium wp-image-11" /></p>
<p>Any who, an easy way to get rid of that pesky setting is to simply do a Reset, we can do that by clicking on the white square, and selecting Reset. It’s a good way to get rid of annoying margins, weird alignments, odd heights/widths and so on.</p>
<p><img src="http://www.davekilljoy.com/blog/wp-content/uploads/2009/07/Tip3-300x247.png" alt="Tip3" title="Tip3" width="300" height="247" class="alignleft size-medium wp-image-10" /></p>
<p>That about wraps it up, tune in next week for another crazy tip?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davekilljoy.com/blog/2009/this-week-in-blend-reset/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Intermediate CSS Techniques</title>
		<link>http://www.davekilljoy.com/blog/2008/intermediate-css-techniques/</link>
		<comments>http://www.davekilljoy.com/blog/2008/intermediate-css-techniques/#comments</comments>
		<pubDate>Tue, 03 Jun 2008 14:46:38 +0000</pubDate>
		<dc:creator>davekilljoy</dc:creator>
				<category><![CDATA[What I've learned about Web Development]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.davekilljoy.com/blog/?p=5</guid>
		<description><![CDATA[Continuing from where we left off, lets take a look at some of the awesome things CSS can really do.
 The Basics
Let&#8217;s start with the most common and basic CSS attributes, width and height. Once you assign a class to an element you are free to style it any way you want. We will be [...]]]></description>
			<content:encoded><![CDATA[<p>Continuing from where we left off, lets take a look at some of the awesome things CSS can really do.</p>
<h3> The Basics</h3>
<p>Let&#8217;s start with the most common and basic CSS attributes, <code>width</code> and <code>height</code>. Once you assign a <code>class</code> to an element you are free to style it any way you want. We will be using this code snipet and styling it as examples.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;test&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Hello<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

<p><span id="more-5"></span><br />
You can now assign <code>height</code> and <code>width</code> values, like this. Take special note that after each attribute, we add a <code>;</code> to tell the browser to move to the next attribute.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">.test<span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">200px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">200px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Which would look like. Take note I added a background color so you could see the dimensions of the <code>&lt;div&gt;</code>.</p>
<div class="ex_code">
<style type="text/css">
.test{
  width:200px;
  height:200px;
  background-color:Blue;
  color:White;
}
</style>
<div class="test">
<p>Hello</p>
</div>
</div>
<p>We can also apply different colors to text and backgrounds. When applying colors to backgrounds of fonts, you can use color names like Red, Blue, Green (the full list can be seen <a href="http://www.w3schools.com/css/css_colornames.asp" target="_blank">here</a>), hex values (#000000, #FFFFFF) or the RGB value (rgb(0,0,0)). To recap, to change the color of a font, we use <code>color</code>, and to change the color of a background we use <code>background-color</code>. This is how it would look.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">.test<span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span>Pink<span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span>Blue<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Which would look like this.</p>
<div class="ex_code">
<style type="text/css">
.test2{
  color:Pink;
  background-color:Blue;
}
</style>
<div class="test2">
<p>Hello</p>
</div>
</div>
<p>There are many font modifiers was have available to us as well. Here are a few.</p>
<ul>
<li><code>font-family</code> &#8211; Defines a either a certain font (Times New Roman) or a font type (San-Serif)</li>
<li><code>font-weight</code> &#8211; Defines if the font will be bold or not.</li>
<li><code>font-size</code> &#8211; Defines the size of the font either in pixels(px), points(pt), multiply(em)</li>
</ul>
<p>The CSS would be something like this.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">.test<span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #3333ff;">:Georgia</span><span style="color: #00AA00;">,</span> <span style="color: #ff0000;">&quot;Times New Roman&quot;</span><span style="color: #00AA00;">,</span> Times<span style="color: #00AA00;">,</span> <span style="color: #993333;">serif</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">24px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>And it would look like this.</p>
<div class="ex_code">
<style type="text/css">
.test3{
  font-family:Georgia, "Times New Roman", Times, serif;
  font-size:24px;
  font-weight:bold;
}
</style>
<div class="test3">
<div>Hello</div>
</div>
</div>
<h3>Moving Forward</h3>
<p>Now that you have a good footing on CSS syntax, lets step it up a notch and introduce the <code>float</code>. Firs we&#8217;ll take a little history lesson. Traditionally, if you ever wanted a 2 column layout done in HTML, you would have to resort the tables, which looked something like this.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">table</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">border</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">cellspacing</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;2&quot;</span> <span style="color: #000066;">cellpadding</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;2&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;</span>Column 1<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;</span>Column 2<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">table</span>&gt;</span></pre></td></tr></table></div>

<p>While it doesn&#8217;t look so bad now, tables are a nightmare and most importantly, they are not semantic. Why this is an issue is because tables were made for 1 thing, to display tabular information. This is a problem when Google or Yahoo are indexing your page, it thinks that your whole page is actually a table of information and treats it differently than it would if you have the information in a <code>&lt;div&gt;</code>. So how do we get around this? We use CSS of course.</p>
<p>First you must understand the difference between a Block Element and an Inline Element. A Block Element, like a <code>&lt;div&gt;</code>, is an element that will take up all available horizontal space. Lets take a look at an example. I&#8217;m going to use a <code>&lt;div&gt;</code> (Block Element) and a <code>&lt;span&gt;</code> (Inline Element). I&#8217;m going to apply a <code>background-color</code> to each one so you can really see what space they take up.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;test4&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span>&gt;</span>Block Div<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span>&gt;</span>Inline Span<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

<p>With no styles applied, the defualt behavior of each element is as follows.</p>
<div class="ex_code">
<style type="text/css">
.ex_code .test4 div{background-color:blue; color:white;}
.ex_code .test4 span{background-color:green; color:white;}
</style>
<div class="test4">
<div>Block Div</div>
<p><span>Inline Span</span>
</div>
</div>
<p>Do you see the difference? The Block Element fills up all the horizontal space it can, where the Inline Element only takes up the space its needs. So then I bet your asking yourself how do we make Block Elements sit next to each other horizontally? We use the magic of <code>Floats</code>. Unfortunately that will take a full tutorial. Stay tuned for the next one =).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davekilljoy.com/blog/2008/intermediate-css-techniques/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Introduction to HTML and CSS</title>
		<link>http://www.davekilljoy.com/blog/2008/introduction-to-html-and-css/</link>
		<comments>http://www.davekilljoy.com/blog/2008/introduction-to-html-and-css/#comments</comments>
		<pubDate>Mon, 02 Jun 2008 14:31:18 +0000</pubDate>
		<dc:creator>davekilljoy</dc:creator>
				<category><![CDATA[What I've learned about Web Development]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.davekilljoy.com/blog/?p=4</guid>
		<description><![CDATA[Hi! First off, welcome to my website, its a brand new design and overall an excuse to try out my newly founded PHP/MySQL chops.
So here&#8217;s the deal, I&#8217;ve been learning web development for a while now, picking up tidbits from all over the web, books and friends helping me out. Then I started thinking, the [...]]]></description>
			<content:encoded><![CDATA[<p>Hi! First off, welcome to my website, its a brand new design and overall an excuse to try out my newly founded PHP/MySQL chops.</p>
<p>So here&#8217;s the deal, I&#8217;ve been learning web development for a while now, picking up tidbits from all over the web, books and friends helping me out. Then I started thinking, the web has been so great for helping me, I feel like I should do the same, which is why I am writing the first of a long series or how to articles, tutorials and information. I&#8217;ll be covering everything sequentially, so first part will be something along the lines of intro to the web in general, HTML and CSS. The subsequent parts will cover things like advanced CSS, WordPress integration, PHP/MySQL, Javascript and more. Enough of this, lets get to it, after the jump!<br />
<span id="more-4"></span><br />
I suppose the most logical place to start would be introducing the concept of HTML and CSS to you.</p>
<h3>HTML</h3>
<p>HTML is a markup language, not to be confused with actual coding. I&#8217;m going to assume that you know absolutely nothing about HTML and start from the very beginning. All HTML tags start with a <code>&lt;tag&gt;</code> and end with a <code>&lt;/tag&gt;</code>, this for example would be valid markup.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>hello<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span></pre></td></tr></table></div>

<p>Here is a list of the most common tags:</p>
<ul>
<li><code>&lt;h1&gt;</code>, <code>&lt;h2&gt;</code>, <code>&lt;h3&gt;</code>, <code>&lt;h4&gt;</code>, <code>&lt;h5&gt;</code>, and <code>&lt;h6&gt;</code> &#8211; These are the most important to the least important header tags</li>
<li><code>&lt;p&gt;</code> &#8211; This is a paragraph tag, it is generally a good idea to put all your body text into one of these tags</li>
<li><code>&lt;a&gt;</code> &#8211; This is a link tag, use this to link to off site pages or in-site pages</li>
<li><code>&lt;div&gt;</code> &#8211; This is a container generally used to arrange content in an organized fashion</li>
</ul>
<p>There are many more tags for many different uses, to see all of them described go <a href="http://www.w3schools.com/tags/default.asp" target="_blank">here</a>.</p>
<p>So now we have a basic idea of what HTML tags look like, now lets go through some of the theory that goes behind coding HTML. HTML is a very linear language, where the further down in the code you are, the further down in the page you should technically be. Lets take a look at how some typical HTML should look.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>Example 1<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/css/style.css&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/scripts/script.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h1</span>&gt;</span>Hi I'm a header<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h1</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>And I'm a paragraph of text<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></td></tr></table></div>

<p>Lets break it down, line by line. First we have the <code >&lt;head&gt;</code> tag. Anything put in between the opening <code >&lt;head&gt;</code> tag and closing <code >&lt;/head&gt;</code> tag will NOT be rendered in your browser. The <code >&lt;head&gt;</code> tag is used to load in things that are needed to make your web page work, things like your CSS style sheet, and Javascript. It is also where you define the title of your page, descriptions and keywords which we will get to in a bit.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span></pre></td></tr></table></div>

<p>Now lets take a closer look at some of the items we can have in the head tag.<br />
The <code >&lt;title&gt;</code> tag is used to define the title of the web page.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>Example 1<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span></pre></td></tr></table></div>

<p>The <code >&lt;link&gt;</code> tag is used to link to an external file. Notice in the <code >&lt;link&gt;</code> tag there is are &#8220;type&#8221; and &#8220;rel&#8221; identifiers. &#8220;Type&#8221; and &#8220;Rel&#8221; combined tell the browser how to handle the file it is linking to. In this instance we are linking to a CSS style sheet which literally styles the entire page.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>3
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/css/style.css&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></td></tr></table></div>

<p>This <code >&lt;script&gt;</code> tag is used to link to a Javascript file that contains code to modify your web page. We will discuss Javascript later on, but its good to know how to link to it properly. Notice again that we have a &#8220;type&#8221; identifier, to tell the browser how to handle the file.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>4
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/scripts/script.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></td></tr></table></div>

<p>Next we have the <code >&lt;html&gt;</code> and <code >&lt;body&gt;</code> tags. These are ESSENTIAL for your web page to work. They tell the browser that the actual HTML code starts and stops!</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h1</span>&gt;</span>Hi I'm a header<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h1</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>And I'm a paragraph of text<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></td></tr></table></div>

<p>Next take a look at the <code >&lt;div&gt;</code> tag, its wrapping the <code >&lt;h1&gt;</code> and the<code >&lt;p&gt;</code> tags in a box.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>9
10
11
12
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h1</span>&gt;</span>Hi I'm a header<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h1</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>And I'm a paragraph of text<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

<p>This is useful because you can think of HTML as a collection of boxes stacked one on top of another, and that way its very easy to move things around if they are sectioned off in their own little boxes.</p>
<h3>CSS</h3>
<p>Now lets move on to CSS, the reason the web looks so cool now-a-days. CSS stands for Cascading Style Sheet. CSS is basically a separate file that defines your HTML tags (remember &#8211; <code >&lt;h1&gt;</code>, <code >&lt;p&gt;</code> etc.). By default every tag has a style already applied to it, that can be useful but I generally don&#8217;t like this, so I use a style sheet reset, which re-defines every HTML tag to have no style at all. You can get that reset <a href="http://developer.yahoo.com/yui/reset/" target="_blank">here</a>.</p>
<p>Now that we have a completely clean slate lets stay learning what CSS does and how its suppose to be written. CSS is based on &#8216;Classes&#8217;. Classes are a way of targeting specific tags to be styled a certain way. </p>
<p>First lets take a look at how to include a CSS file in your web page. You must include a .css file in the head of your HTML page, and the link is relative to where the HTML page is. Take a look at the example below, the style.css file is located in a folder called css.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>Example 2<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;css/style.css&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span></pre></td></tr></table></div>

<p>Now lets take a look at what a Class looks like.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;header&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>This is a paragraph<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span></pre></td></tr></table></div>

<p>And then in the CSS stylesheet, we define the Class like this.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.header</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #993333;">red</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #993333;">white</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">40px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Take special note of the period <code>.</code> before the Class Name, that tells the browser reading the CSS style sheet that what you&#8217;re designating is indeed a Class. </p>
<p>This is how our code would look in a browser.</p>
<div class="ex_code">
<style type="text/css">
.ex_code .header {background-color:red; width:100px; height:40px; color:white;} 
</style>
<div class="header">
<p>This is a paragraph</p>
</div>
</div>
<p>You can pretty much do anything once you have assigned an element (<code>&lt;p class="text" &gt;</code> etc..) a Class, for the full specifications of what attributes you can give a Class, refer to the <a href="http://www.w3schools.com/Css/css_intro.asp" target="_blank">W3C Schools</a>. </p>
<p>This concludes Part 1 of What I&#8217;ve learned about Web Development, in Part 2, I&#8217;ll be diving much more in depth about CSS, tricks and tips.</p>
<p>Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davekilljoy.com/blog/2008/introduction-to-html-and-css/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
