<?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>Code With Design &#187; CSS</title>
	<atom:link href="http://codewithdesign.com/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://codewithdesign.com</link>
	<description>web application development blog by Caleb Jonasson</description>
	<lastBuildDate>Fri, 11 May 2012 12:28:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Remove images and increase load times with CSS3</title>
		<link>http://codewithdesign.com/2010/05/05/remove-images-and-increase-load-times-with-css3/</link>
		<comments>http://codewithdesign.com/2010/05/05/remove-images-and-increase-load-times-with-css3/#comments</comments>
		<pubDate>Wed, 05 May 2010 16:30:49 +0000</pubDate>
		<dc:creator>Caleb Jonasson</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[drop shadow]]></category>
		<category><![CDATA[opacity]]></category>
		<category><![CDATA[shadow]]></category>

		<guid isPermaLink="false">http://codewithdesign.com/?p=396</guid>
		<description><![CDATA[An article on how to create style techniques that are commonly created using images. This will help you replace images for drop shadows, and the opacity on certain elements using CSS3.
Related posts:<ol>
<li><a href='http://codewithdesign.com/2009/12/22/making-it-that-much-better-with-css3/' rel='bookmark' title='Making it that much better with CSS3'>Making it that much better with CSS3</a></li>
<li><a href='http://codewithdesign.com/2009/12/16/css3-drop-shadow-on-text/' rel='bookmark' title='CSS3 Drop shadow on text'>CSS3 Drop shadow on text</a></li>
<li><a href='http://codewithdesign.com/2012/05/01/decrease-javascript-load-times-and-increase-script-speed/' rel='bookmark' title='Decrease Javascript Load Times and Increase Script Speed'>Decrease Javascript Load Times and Increase Script Speed</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div style = 'float:left; margin-right:5px;'>            <a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-text="Remove images and increase load times with CSS3" data-via="" data-url="http://codewithdesign.com/2010/05/05/remove-images-and-increase-load-times-with-css3/" en>Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="tall" href="http://codewithdesign.com/2010/05/05/remove-images-and-increase-load-times-with-css3/"></g:plusone></div><p>Recently when working on a clients site I found that there were a lot of images being used when a quick little CSS fix could have done the trick. The basic outline of the site involved a few transparencies and a lot of drop shadows. The drop shadows were placed on the container/wrap and the text had drop shadows that had been all done in Photoshop. (Some of the drop shadows were not consistent.)</p>
<p>After looking at the site I told the client that within three minutes I could remove all of the images being for text, drop shadows and opacity allowing his site to load faster.</p>
<p>The answer was what I had expected and the following code was quickly being thrown into the site.</p>
<p><strong>The Code</strong></p>
<p>For the drop shadows on divs:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">.container<span style="color: #00AA00;">&#123;</span>
     <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">1080px</span><span style="color: #00AA00;">;</span>
     <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
     -moz-border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
     -webkit-border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
     -moz-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">2px</span> <span style="color: #933;">5px</span> <span style="color: #cc00cc;">#666</span><span style="color: #00AA00;">;</span>
     -webkit-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">2px</span> <span style="color: #933;">5px</span> <span style="color: #cc00cc;">#666</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>For the drop shadows on text:</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;">h3<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Times<span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">letter-spacing</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">text-shadow</span><span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span> <span style="color: #933;">2px</span> <span style="color: #933;">2px</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>For the opacity:</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;"><span style="color: #6666ff;">.sidebar</span> ul<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">list-style-type</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	opacity<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0.9</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">180px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<img src="http://codewithdesign.com/?ak_action=api_record_view&id=396&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://codewithdesign.com/2009/12/22/making-it-that-much-better-with-css3/' rel='bookmark' title='Making it that much better with CSS3'>Making it that much better with CSS3</a></li>
<li><a href='http://codewithdesign.com/2009/12/16/css3-drop-shadow-on-text/' rel='bookmark' title='CSS3 Drop shadow on text'>CSS3 Drop shadow on text</a></li>
<li><a href='http://codewithdesign.com/2012/05/01/decrease-javascript-load-times-and-increase-script-speed/' rel='bookmark' title='Decrease Javascript Load Times and Increase Script Speed'>Decrease Javascript Load Times and Increase Script Speed</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://codewithdesign.com/2010/05/05/remove-images-and-increase-load-times-with-css3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get, install, and use light box</title>
		<link>http://codewithdesign.com/2010/04/02/get-install-and-use-light-box/</link>
		<comments>http://codewithdesign.com/2010/04/02/get-install-and-use-light-box/#comments</comments>
		<pubDate>Sat, 03 Apr 2010 02:38:17 +0000</pubDate>
		<dc:creator>Caleb Jonasson</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[light-box]]></category>
		<category><![CDATA[lightbox]]></category>

		<guid isPermaLink="false">http://codewithdesign.com/?p=369</guid>
		<description><![CDATA[First and foremost, if you do not know what light box is, then I can only assume that you have been living in the dark ages. A lot of sites incorporate this technique to view full sized photos inside of the browser.

Secondly I am going to have to add that this article is about implementing light box. Not creating a light box like plug in.

The first thing that is required for us is to get light box. Where do you get light box. Well the Internet probably has some light box.
No related posts.]]></description>
			<content:encoded><![CDATA[<div style = 'float:left; margin-right:5px;'>            <a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-text="Get, install, and use light box" data-via="" data-url="http://codewithdesign.com/2010/04/02/get-install-and-use-light-box/" en>Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="tall" href="http://codewithdesign.com/2010/04/02/get-install-and-use-light-box/"></g:plusone></div><p>First and foremost, if you do not know what light box is, then I can only assume that you have been living in the dark ages. A lot of sites incorporate this technique to view full sized photos inside of the browser.</p>
<p>Secondly I am going to have to add that this article is about implementing light box. Not creating a light box like plug in.</p>
<p>The first thing that is required for us is to get light box. Where do you get light box. Well the Internet probably has some light box. <a href="http://www.huddletogether.com/projects/lightbox2/#download">lets go there</a>.</p>
<p>This is the site that has what we need. If you would like to click that link, upload to the server you will be working on we can get started.</p>
<p>When working with lightbox you will need to include four lines of code into your header. Once added, your header will look like this.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;script src=&quot;prototype.js&quot; type=&quot;text/javascript&quot;&gt;&lt;!--mce:0--&gt;&lt;/script&gt;
&lt;script src=&quot;scriptaculous.js?load=effects,builder&quot; type=&quot;text/javascript&quot;&gt;&lt;!--mce:1--&gt;&lt;/script&gt;
&lt;script src=&quot;lightbox.js&quot; type=&quot;text/javascript&quot;&gt;&lt;!--mce:2--&gt;&lt;/script&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;lightbox.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;</pre></td></tr></table></div>

<p>The next part to using this script requires us to link to an image using it. This can be done by using a rel path.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;a title=&quot;Title&quot; rel=&quot;lightbox&quot; href=&quot;demo-image.jpg&quot;&gt;First Image&lt;/a&gt;</pre></td></tr></table></div>

<p><strong>Note:</strong> There are some things that can go wrong when working with lightbox. The first thing that you need to check is that everything is being properly linked to. There are files from the css that can cause lightbox to not function properly.</p>
<p>Also, if you do not see an image or lightbox appear then you may have to check the JavaScript within the body tag. You may have to modify the on load.</p>
<img src="http://codewithdesign.com/?ak_action=api_record_view&id=369&type=feed" alt="" /><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://codewithdesign.com/2010/04/02/get-install-and-use-light-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a top button</title>
		<link>http://codewithdesign.com/2009/12/30/creating-a-top-button/</link>
		<comments>http://codewithdesign.com/2009/12/30/creating-a-top-button/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 08:30:23 +0000</pubDate>
		<dc:creator>Caleb Jonasson</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[anchor]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[position]]></category>
		<category><![CDATA[top]]></category>

		<guid isPermaLink="false">http://codewithdesign.com/?p=239</guid>
		<description><![CDATA[Buttons that stick to the sides of the browser are becoming more and more popular. Most of it started with a companies feedback button which turned into people using them for their own convenience. In this article I am going to go over the CSS code for making it stick to the side.
Related posts:<ol>
<li><a href='http://codewithdesign.com/2009/11/20/creating-a-fixed-header-and-footer/' rel='bookmark' title='Creating a fixed header and Footer'>Creating a fixed header and Footer</a></li>
<li><a href='http://codewithdesign.com/2009/09/30/intro-to-html-css-creating-a-style-sheet/' rel='bookmark' title='Intro to HTML: CSS Creating a Style Sheet'>Intro to HTML: CSS Creating a Style Sheet</a></li>
<li><a href='http://codewithdesign.com/2009/10/04/creating-a-single-page-login-%e2%80%93-design-view/' rel='bookmark' title='Creating a Single Page login – Design View'>Creating a Single Page login – Design View</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div style = 'float:left; margin-right:5px;'>            <a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-text="Creating a top button" data-via="" data-url="http://codewithdesign.com/2009/12/30/creating-a-top-button/" en>Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="tall" href="http://codewithdesign.com/2009/12/30/creating-a-top-button/"></g:plusone></div><h2>Introduction</h2>
<p>Buttons that stick to the sides of the browser are becoming more and more popular. Most of it started with a companies feedback button which turned into people using them for their own convenience. In this article I am going to go over the CSS code for making it stick to the side.</p>
<p>The first thing that is required is an anchor. We can add this to the top of the page and it will be located just below the first div (or above your header) You can really locate this where ever you would like your readers eyes to be. Some people prefer the title of the first blog post.)</p>
<p>Once the code has been placed it should look like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;body&gt;
&lt;a name=&quot;top&quot; id=&quot;top&quot;&gt;&lt;/a&gt;
&lt;div class=&quot;header&quot;&gt;</pre></td></tr></table></div>

<h2>Anchors</h2>
<p>Now that we have placed our anchor there is something you need to know if unfamiliar. In order to link to an anchor all you need to do is add a &#8216;name&#8217; and an &#8216;id.&#8217; When linking to an anchor you will be required to have an &#8216;href&#8217; like so:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;a href=&quot;#top&quot;&gt;Top&lt;/a&gt;</pre></td></tr></table></div>

<p>Notice how the &#8216;href&#8217; is simple a pound sign followed by the name of the anchor. If you would like a contact button the you can do something similar to the following anchor:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;h3&gt;&lt;a href=&quot;http://codewithdesign.com/contact.php#contact&quot;&gt;Contact&lt;/a&gt;</pre></td></tr></table></div>

<p>Depending on where the anchor for contact is the user can be linked to a page and moved directly to the contact form. This just allows you to skip information and the only reason this is used as an example is because I wanted you to know exactly how you can use anchors across page.</p>
<h2>Styling the page</h2>
<p>Now that we have our two anchors we will get into the portion of styling that will make this button stick to the side. The first thing we are going to be doing is enclosing the link in a div. The results of this will look as such:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;sidelinks-container&quot;&gt;&lt;h3&gt;&lt;a href=&quot;#top&quot;&gt;Top&lt;/a&gt;&lt;/h3&gt;&lt;/div&gt;</pre></td></tr></table></div>

<p>The placement of this code is completely irrelevant since we will be adding a position property to it. I threw it directly under my anchor to keep it all together if changes are eventually needed.</p>
<p>Now we need to begin the actual styling of the div. This will require two separate styling, one for the div itself and the other will be for the &#8216;&lt;h3&gt;&#8217; tag.</p>
<p>The first thing that we will be adding to our style will be the positioning and size of the box. As noted earlier the position and how the container acts with the sides of the browser is key. Because it is important we will start by adding the following lines of code to the div.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.sidelinks-container</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">fixed</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">50px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">40px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span><span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>As we go through the code you will notice that everything is standard. The position is fixed so even though the div is outside of the container it is still properly displayed on the screen. The left property forces the box to the left side of the screen. The width and height are required properties. If the width was not set it would expand across the screen and overlap the content. The height it required so the box does not collapse on the contents that are within. The final important property is the &#8216;bottom&#8217; style, this will force the box to position itself a certain distance from the bottom of the browser. In our case it will be &#8217;40px&#8217; away.</p>
<p>The next important piece of code will change the h3 properties. When it comes down to it you can actually just add class to the link or throw it in a span but I chose to stick with &#8216;&lt;h3&gt;&#8217; because I had originally created it with the default h3 font style.</p>
<p>The code for the next chunk of CSS will look as follows:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.sidelinks-container</span> h3<span style="color: #00AA00;">&#123;</span>
-webkit-transform<span style="color: #00AA00;">:</span> rotate<span style="color: #00AA00;">&#40;</span>-90deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
-moz-transform<span style="color: #00AA00;">:</span> rotate<span style="color: #00AA00;">&#40;</span>-90deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font</span><span style="color: #00AA00;">:</span><span style="color: #933;">32px</span> Verdana<span style="color: #00AA00;">,</span> Arial<span style="color: #00AA00;">,</span> Helvetica<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">50px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h2>Live demo</h2>
<p><a href="http://codewithdesign.com/pages/design1_test.php#top"><img class="size-full wp-image-240 alignleft" title="topbutton" src="http://codewithdesign.com/wp-content/uploads/2009/12/topbutton.jpg" alt="" width="351" height="195" /></a></p>
<p>By going through the code we will notice that everything is font styling with an added little text rotation that works with IE. Now that we have most of the CSS and the HTML we can throw it all together and see how well it works out.</p>
<p>Below there will be a copy of the html used in this example along with the CSS. By clicking the image you can see a demo version of this page in action. Simply scroll down and click the fixed div on the left.</p>
<h2>The CSS</h2>

<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
17
18
19
20
21
22
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.sidelinks-container</span> h3<span style="color: #00AA00;">&#123;</span>
-webkit-transform<span style="color: #00AA00;">:</span> rotate<span style="color: #00AA00;">&#40;</span>-90deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
-moz-transform<span style="color: #00AA00;">:</span> rotate<span style="color: #00AA00;">&#40;</span>-90deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font</span><span style="color: #00AA00;">:</span><span style="color: #933;">32px</span> Verdana<span style="color: #00AA00;">,</span> Arial<span style="color: #00AA00;">,</span> Helvetica<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">50px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.sidelinks-container</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">fixed</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">50px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">40px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#444</span><span style="color: #00AA00;">;</span>
-moz-border-radius-topright<span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
-webkit-border-top-right-radius<span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
-moz-border-radius-bottomright<span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
-webkit-border-bottom-right-radius<span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span><span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
&nbsp;
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h2>The HTML</h2>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;body&gt;
&lt;a name=&quot;top&quot; id=&quot;top&quot;&gt;&lt;/a&gt;
&lt;div&gt;&lt;h3&gt;&lt;a href=&quot;#top&quot;&gt;Top&lt;/a&gt;&lt;/h3&gt;&lt;/div&gt;</pre></td></tr></table></div>

<p>That is all, you are done.</p>
<img src="http://codewithdesign.com/?ak_action=api_record_view&id=239&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://codewithdesign.com/2009/11/20/creating-a-fixed-header-and-footer/' rel='bookmark' title='Creating a fixed header and Footer'>Creating a fixed header and Footer</a></li>
<li><a href='http://codewithdesign.com/2009/09/30/intro-to-html-css-creating-a-style-sheet/' rel='bookmark' title='Intro to HTML: CSS Creating a Style Sheet'>Intro to HTML: CSS Creating a Style Sheet</a></li>
<li><a href='http://codewithdesign.com/2009/10/04/creating-a-single-page-login-%e2%80%93-design-view/' rel='bookmark' title='Creating a Single Page login – Design View'>Creating a Single Page login – Design View</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://codewithdesign.com/2009/12/30/creating-a-top-button/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Modifying next and previous posts</title>
		<link>http://codewithdesign.com/2009/12/27/modifying-next-and-previous-posts/</link>
		<comments>http://codewithdesign.com/2009/12/27/modifying-next-and-previous-posts/#comments</comments>
		<pubDate>Sun, 27 Dec 2009 09:01:25 +0000</pubDate>
		<dc:creator>Caleb Jonasson</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://codewithdesign.com/?p=231</guid>
		<description><![CDATA[We could change the float class to have a background and a border but that would change everything that uses the float class. In order to change this we are going to have to create new classes and change the index code. For this I will be changing the index code to "post_new_entries" and "post_old_entries."
Related posts:<ol>
<li><a href='http://codewithdesign.com/2009/12/22/making-it-that-much-better-with-css3/' rel='bookmark' title='Making it that much better with CSS3'>Making it that much better with CSS3</a></li>
<li><a href='http://codewithdesign.com/2009/10/04/creating-a-single-page-login-%e2%80%93-design-view/' rel='bookmark' title='Creating a Single Page login – Design View'>Creating a Single Page login – Design View</a></li>
<li><a href='http://codewithdesign.com/2010/05/05/remove-images-and-increase-load-times-with-css3/' rel='bookmark' title='Remove images and increase load times with CSS3'>Remove images and increase load times with CSS3</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div style = 'float:left; margin-right:5px;'>            <a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-text="Modifying next and previous posts" data-via="" data-url="http://codewithdesign.com/2009/12/27/modifying-next-and-previous-posts/" en>Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="tall" href="http://codewithdesign.com/2009/12/27/modifying-next-and-previous-posts/"></g:plusone></div><p>For most standard WordPress themes you are stuck with a boring text on the bottom of the screen with a float left and right property. This simple float looks boring however it is a simple solution for going from page to page.</p>
<p><img class="alignnone size-full wp-image-232" title="older-entries1" src="http://codewithdesign.com/wp-content/uploads/2009/12/older-entries1.jpg" alt="" width="379" height="83" /></p>
<p>The below image is what my personal blog used to have for a page navigation. This was to simple for what I wanted which made me want to change it to fit the rest of the page style. The solution was a work through of the CSS requiring a little CSS3 to make the borders rounded.</p>
<p>The final result looks as follows:</p>
<p><img class="alignnone size-full wp-image-233" title="older-entries2" src="http://codewithdesign.com/wp-content/uploads/2009/12/older-entries2.jpg" alt="" width="333" height="98" /></p>
<p>The first thing we are going to need to do is open up the style.css and the index.php inside of the theme you are intending to modify.</p>
<p><strong>WordPress Root -&gt; wp-content -&gt; themes -&gt; theme_name</strong></p>
<p>Once you have opened up the two files, refer to the index.php and scroll down past the post loops to get to your code that checks for posts and allows you to go forward and backwards in post history. The code should look as follows:</p>
<blockquote><p>&lt;div&gt;<br />
&lt;h5 class=&#8221;float-right&#8221;&gt;<br />
&lt;?php previous_posts_link(&#8216;Newer Entries &amp;rarr;&#8217;) ?&gt;<br />
&lt;/h5&gt;<br />
&lt;h5 class=&#8221;float-left&#8221;&gt;<br />
&lt;?php next_posts_link(&#8216;&amp;larr; Older Entries&#8217;) ?&gt;<br />
&lt;/h5&gt;<br />
&lt;div&gt;&lt;/div&gt;<br />
&lt;/div&gt;</p></blockquote>
<p>As you can see there is a float class above which is in our css file as:</p>
<blockquote><p>.float-right {</p>
<p>float:right;</p>
<p>}</p></blockquote>
<p>We could change the float class to have a background and a border but that would change everything that uses the float class. In order to change this we are going to have to create new classes and change the index code. For this I will be changing the index code to &#8220;post_new_entries&#8221; and &#8220;post_old_entries.&#8221;</p>
<p>The &#8220;index.php&#8221; will now look something like this:</p>
<blockquote><p>&lt;div&gt;<br />
&lt;h5 class=&#8221;post_new_entries&#8221;&gt;<br />
&lt;?php previous_posts_link(&#8216;Newer Entries &amp;rarr;&#8217;) ?&gt;<br />
&lt;/h5&gt;<br />
&lt;h5 class=&#8221;post_old_entries&#8221;&gt;<br />
&lt;?php next_posts_link(&#8216;&amp;larr; Older Entries&#8217;) ?&gt;<br />
&lt;/h5&gt;<br />
&lt;div&gt;&lt;/div&gt;<br />
&lt;/div&gt;</p></blockquote>
<p>The final thing to do in this modification is to create the classes inside of the &#8220;style.css&#8221; file. The first thing that is required for the modification is for us to make them float to their designated sides just like the previous floats from before.</p>
<blockquote><p>.post_old_entries {<br />
float:left;<br />
font:bold 20px/20px Georgia, &#8220;Times New Roman&#8221;, Times, serif;<br />
}</p></blockquote>
<p>The rest of the code is fully customizable and up to you. There is always the option of adding hovers and link colors as well as paddings, backgrounds and borders. The code that is currently used for code with design is as follows:</p>
<blockquote><p>.post_old_entries {<br />
float:left;<br />
font:bold 20px/20px Georgia, &#8220;Times New Roman&#8221;, Times, serif;<br />
margin-left:-31px;<br />
padding:5px 15px;<br />
background: #f2f2f2;<br />
border: 1px solid #ddd;<br />
-moz-border-radius-topright: 5px;<br />
-webkit-border-top-right-radius:5px;<br />
-moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px;<br />
}<br />
.post_old_entries a{<br />
color:#666666;<br />
}<br />
.post_old_entries a:hover {<br />
color:#333333;<br />
}<br />
.post_new_entries {<br />
float:right;<br />
font:bold 20px/20px Georgia, &#8220;Times New Roman&#8221;, Times, serif;<br />
margin-right:-31px;<br />
padding:5px 15px;<br />
background: #f2f2f2;<br />
border: 1px solid #ddd;<br />
-moz-border-radius-topright: 5px;<br />
-webkit-border-top-right-radius:5px;<br />
-moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px;<br />
}<br />
.post_new_entries a {<br />
color:#666666;<br />
}<br />
.post_new_entries a:hover {<br />
color:#333333;<br />
}</p></blockquote>
<p>Best of luck with your WordPress modifications.</p>
<img src="http://codewithdesign.com/?ak_action=api_record_view&id=231&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://codewithdesign.com/2009/12/22/making-it-that-much-better-with-css3/' rel='bookmark' title='Making it that much better with CSS3'>Making it that much better with CSS3</a></li>
<li><a href='http://codewithdesign.com/2009/10/04/creating-a-single-page-login-%e2%80%93-design-view/' rel='bookmark' title='Creating a Single Page login – Design View'>Creating a Single Page login – Design View</a></li>
<li><a href='http://codewithdesign.com/2010/05/05/remove-images-and-increase-load-times-with-css3/' rel='bookmark' title='Remove images and increase load times with CSS3'>Remove images and increase load times with CSS3</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://codewithdesign.com/2009/12/27/modifying-next-and-previous-posts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easyworks a new PHP front end framework</title>
		<link>http://codewithdesign.com/2009/12/22/easyworks-a-new-php-front-end-framework/</link>
		<comments>http://codewithdesign.com/2009/12/22/easyworks-a-new-php-front-end-framework/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 17:01:23 +0000</pubDate>
		<dc:creator>Caleb Jonasson</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[easyworks]]></category>
		<category><![CDATA[Framework]]></category>

		<guid isPermaLink="false">http://codewithdesign.com/?p=226</guid>
		<description><![CDATA[The framework is still in its V1.0 stage but it does have potential to be something. The idea behind this framework is simple site construction through a header navigation. It is supporting a validating login and register system but it does not yet have the back end coding to make it all happen. To get a copy of it for yourself you can download it here.
Related posts:<ol>
<li><a href='http://codewithdesign.com/2009/11/13/going-through-website-creation-part-1-layout/' rel='bookmark' title='Going Through Website Creation Part 1: Layout'>Going Through Website Creation Part 1: Layout</a></li>
<li><a href='http://codewithdesign.com/2010/09/24/check-email-function-php/' rel='bookmark' title='Check Email Function PHP'>Check Email Function PHP</a></li>
<li><a href='http://codewithdesign.com/2009/12/20/random-images-using-a-php-function-cj_random_image/' rel='bookmark' title='Random Images Using A PHP Function: cj_random_image'>Random Images Using A PHP Function: cj_random_image</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div style = 'float:left; margin-right:5px;'>            <a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-text="Easyworks a new PHP front end framework" data-via="" data-url="http://codewithdesign.com/2009/12/22/easyworks-a-new-php-front-end-framework/" en>Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="tall" href="http://codewithdesign.com/2009/12/22/easyworks-a-new-php-front-end-framework/"></g:plusone></div><p>Creating a <a href="http://codewithdesign.com/pages/framework/cjd_easyworks/index.php">framework</a> was on the list of things to do and so when getting off a 7.5 hour shift I started working on the base of it. A few hours later and 7 episodes of Boston Legal later I found myself uploading it and running out the door to work another 7.5 hours. The frame work is very basic, it does link to site information, class files, function but it is not a true framework yet.<br />
The framework is still in its V1.0 stage but it does have potential to be something. The idea behind this framework is simple site construction through a header navigation. It is supporting a validating login and register system but it does not yet have the back end coding to make it all happen. To get a copy of it for yourself you can <a href="http://codewithdesign.com/pages/framework/cjd_easyworks/index.php">download it here</a>.</p>
<p><img class="alignnone size-medium wp-image-225" title="cjd_easyframeworkv1.0" src="http://codewithdesign.com/wp-content/uploads/2009/12/cjd_easyframeworkv1.0-600x400.jpg" alt="" width="540" height="360" /></p>
<img src="http://codewithdesign.com/?ak_action=api_record_view&id=226&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://codewithdesign.com/2009/11/13/going-through-website-creation-part-1-layout/' rel='bookmark' title='Going Through Website Creation Part 1: Layout'>Going Through Website Creation Part 1: Layout</a></li>
<li><a href='http://codewithdesign.com/2010/09/24/check-email-function-php/' rel='bookmark' title='Check Email Function PHP'>Check Email Function PHP</a></li>
<li><a href='http://codewithdesign.com/2009/12/20/random-images-using-a-php-function-cj_random_image/' rel='bookmark' title='Random Images Using A PHP Function: cj_random_image'>Random Images Using A PHP Function: cj_random_image</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://codewithdesign.com/2009/12/22/easyworks-a-new-php-front-end-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a fixed header and Footer</title>
		<link>http://codewithdesign.com/2009/11/20/creating-a-fixed-header-and-footer/</link>
		<comments>http://codewithdesign.com/2009/11/20/creating-a-fixed-header-and-footer/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 21:39:30 +0000</pubDate>
		<dc:creator>Caleb Jonasson</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[fixed]]></category>
		<category><![CDATA[footer]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[position]]></category>

		<guid isPermaLink="false">http://codewithdesign.com/?p=166</guid>
		<description><![CDATA[The above CSS contains the header div and the H1 tag. There are four very important things that are required when having a fixed header. First: It must have the position set to fixed. The other three are all about positioning and linking it to the top and sides. With the above code we set the sides to link 20px from the browser and the top to link directly.

Another important part of the CSS is having the page contents forced below what the header is covering. This will allow us to see div that is underneath. That chunk of CSS looks like this.
Related posts:<ol>
<li><a href='http://codewithdesign.com/2009/09/30/intro-to-html-css-creating-a-style-sheet/' rel='bookmark' title='Intro to HTML: CSS Creating a Style Sheet'>Intro to HTML: CSS Creating a Style Sheet</a></li>
<li><a href='http://codewithdesign.com/2009/12/30/creating-a-top-button/' rel='bookmark' title='Creating a top button'>Creating a top button</a></li>
<li><a href='http://codewithdesign.com/2009/10/04/creating-a-single-page-login-%e2%80%93-design-view/' rel='bookmark' title='Creating a Single Page login – Design View'>Creating a Single Page login – Design View</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div style = 'float:left; margin-right:5px;'>            <a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-text="Creating a fixed header and Footer" data-via="" data-url="http://codewithdesign.com/2009/11/20/creating-a-fixed-header-and-footer/" en>Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="tall" href="http://codewithdesign.com/2009/11/20/creating-a-fixed-header-and-footer/"></g:plusone></div><p>If you are looking for a fixed header of fixed footer you have come to the right place. In this tutorial I will be going over the basic page setup for sections of content, the header bar, footer bar, CSS and HTML.</p>
<p>The CSS code for a header is quite simple depending on how you would like it to interact with the rest of the page.</p>
<blockquote><p>#header {<br />
top:0px;<br />
right:20px;<br />
left:20px;<br />
position:fixed;<br />
background: #eee;<br />
border:1px solid #ccc;<br />
padding: 0 10px 0 20px;<br />
}<br />
#header h1 {<br />
margin: 0px;<br />
padding: opx;<br />
font:18px &#8220;Plantagenet Cherokee&#8221;;<br />
letter-spacing:2px;<br />
}</p></blockquote>
<p>The above CSS contains the header div and the H1 tag. There are four very important things that are required when having a fixed header. First: It must have the position set to fixed. The other three are all about positioning and linking it to the top and sides. With the above code we set the sides to link 20px from the browser and the top to link directly.</p>
<p>Another important part of the CSS is having the page contents forced below what the header is covering. This will allow us to see div that is underneath. That chunk of CSS looks like this.</p>
<blockquote><p>body {<br />
font: 100% Verdana, Arial, Helvetica, sans-serif;<br />
background: #666666;<br />
margin: 0;<br />
padding: 0;<br />
text-align: center;<br />
color: #000000;<br />
margin-top:40px;<br />
}</p></blockquote>
<p>The HTML looks something like this.</p>
<blockquote><p>&lt;html&gt;<br />
&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;Code With Design Fixed Header&lt;/title&gt;<br />
&lt;link href=&#8221;style.css&#8221; rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; /&gt;<br />
&lt;/head&gt;</p>
<p>&lt;body&gt;<br />
&lt;div id=&#8221;header&#8221;&gt;<br />
&lt;h1&gt;Header&lt;/h1&gt;<br />
&lt;!&#8211; end #header &#8211;&gt;&lt;/div&gt;<br />
&lt;div id=&#8221;container&#8221;&gt;<br />
&lt;div id=&#8221;mainContent&#8221;&gt;<br />
&lt;h1&gt; Main Content &lt;/h1&gt;<br />
&lt;/div&gt;<br />
&lt;div id=&#8221;footer&#8221;&gt;<br />
&lt;p&gt;Footer&lt;/p&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p></blockquote>
<p>Generally the header is kept withing the container to keep it aligned with the rest of the page however we wanted it to break out of the rest of the page and thus we moved it up, out and away.</p>
<p>The rest of this article will cover the footer which is very similar except for a few things. The footers CSS is going to be fixed to the bottom and not the top which is unlike the header. We will also need to pull it out of the HTML so it can fill up and be safe across browsers.</p>
<p>So first we will take note of the css which goes something like this:</p>
<blockquote><p>#footer {<br />
padding: 0 10px;<br />
background:#EEE;<br />
bottom:0px;<br />
right:0px;<br />
left:0px;<br />
position:fixed;<br />
}<br />
#footer p {<br />
margin: 0;<br />
padding: 10px 0;<br />
}</p></blockquote>
<p>Once again we bring in the four important properties; bottom, left, right, and position. You will also need to change the body tag in the CSS so the footer does not overlap the content you would like the readers to see. This CSS is going to look like this:</p>
<blockquote><p>body {<br />
font: 100% Verdana, Arial, Helvetica, sans-serif;<br />
background: #666666;<br />
margin: 0;<br />
padding: 0;<br />
text-align: center;<br />
color: #000000;<br />
margin-bottom:50px;<br />
}</p></blockquote>
<p>And now finally we will look at the HTML to see the footer break out of the container similar to what the header did.</p>
<blockquote><p>&lt;!&#8211; end #container &#8211;&gt;&lt;/div&gt;<br />
&lt;div id=&#8221;footer&#8221;&gt;<br />
&lt;p&gt;Created by Caleb Jonasson&lt;/p&gt;<br />
&lt;/div&gt;</p></blockquote>
<p>Caleb Jonasson</p>
<img src="http://codewithdesign.com/?ak_action=api_record_view&id=166&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://codewithdesign.com/2009/09/30/intro-to-html-css-creating-a-style-sheet/' rel='bookmark' title='Intro to HTML: CSS Creating a Style Sheet'>Intro to HTML: CSS Creating a Style Sheet</a></li>
<li><a href='http://codewithdesign.com/2009/12/30/creating-a-top-button/' rel='bookmark' title='Creating a top button'>Creating a top button</a></li>
<li><a href='http://codewithdesign.com/2009/10/04/creating-a-single-page-login-%e2%80%93-design-view/' rel='bookmark' title='Creating a Single Page login – Design View'>Creating a Single Page login – Design View</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://codewithdesign.com/2009/11/20/creating-a-fixed-header-and-footer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Going Through Website Creation Part 1: Layout</title>
		<link>http://codewithdesign.com/2009/11/13/going-through-website-creation-part-1-layout/</link>
		<comments>http://codewithdesign.com/2009/11/13/going-through-website-creation-part-1-layout/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 19:25:59 +0000</pubDate>
		<dc:creator>Caleb Jonasson</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[create]]></category>
		<category><![CDATA[creation]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[include]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[skorg]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://codewithdesign.com/?p=151</guid>
		<description><![CDATA[A few months ago I posted an old project on the old blog. The project was entitled “Browser Friendly Feed Reader.” This project consisted of three simple pages. The first was the submitting form where users could enter their rss or xml feed. The contents of this feed could be output in the web browser to displaying it inside of the site framework that was created.
Related posts:<ol>
<li><a href='http://codewithdesign.com/2010/03/26/going-through-website-creation-part-2-backend/' rel='bookmark' title='Going through website creation part 2: Backend'>Going through website creation part 2: Backend</a></li>
<li><a href='http://codewithdesign.com/2010/05/18/recycle-pages-by-splitting-your-website-into-pieces-with-php/' rel='bookmark' title='Recycle pages by splitting your website into pieces with PHP'>Recycle pages by splitting your website into pieces with PHP</a></li>
<li><a href='http://codewithdesign.com/2009/09/29/the-beginners-guide-to-php/' rel='bookmark' title='The Beginners Guide to PHP'>The Beginners Guide to PHP</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div style = 'float:left; margin-right:5px;'>            <a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-text="Going Through Website Creation Part 1: Layout" data-via="" data-url="http://codewithdesign.com/2009/11/13/going-through-website-creation-part-1-layout/" en>Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="tall" href="http://codewithdesign.com/2009/11/13/going-through-website-creation-part-1-layout/"></g:plusone></div><h2>Starting Up An Old Project</h2>
<div id="content_div-141">
<p>A few months ago I posted an old project on the old blog. The project was entitled “<a href="http://rss.skorg.org/">Browser Friendly Feed Reader.</a>” This project consisted of three simple pages. The first was the submitting form where users could enter their rss or xml feed. The contents of this feed could be output in the web browser to displaying it inside of the site framework that was created.</p>
<p><a rel="lightbox[141]" href="../wp-content/uploads/2009/11/rss_skorg_atchison.jpg"><img title="rss_skorg_atchison" src="../wp-content/uploads/2009/11/rss_skorg_atchison.jpg" alt="rss_skorg_atchison" width="490" height="453" /></a></p>
<p><strong>Process.php<br />
Forum.php<br />
View.php</strong></p>
<p>The site was very simple but it was more built for the idea behind viewing a feed in the browser. Since then I wanted to create a more advanced version of the site that relied on a database and the ability to subscribe to the feeds. This is when I decided to restart to the old project and completely rework how everything is set from the ground up.</p>
<h2>Working With The Framework</h2>
<h2><a href="http://codewithdesign.com/wp-content/uploads/2009/11/framework.jpg" rel="lightbox[151]"><img class="alignnone size-full wp-image-152" title="framework" src="http://codewithdesign.com/wp-content/uploads/2009/11/framework.jpg" alt="framework" width="540" height="524" /></a></h2>
<p>When starting to create a new project or just recreating one the first thing that you will need is a frame work. The frame work is a quick drawing of how you would like to have everything setup. Some people like to create theirs with programs such as In Design or Illustrator but I prefer to use a graphing set, a notepad and whatever pen is closest to me. I should be using pencil but I normally have a plan in my head prior to starting something.</p>
<p><a rel="lightbox[141]" href="../wp-content/uploads/2009/11/dreamweaver_create_a_page.jpg"><img title="dreamweaver_create_a_page" src="../wp-content/uploads/2009/11/dreamweaver_create_a_page.jpg" alt="dreamweaver_create_a_page" width="582" height="460" /></a></p>
<p>Once you have the general idea of how things are going to work it is a good idea to draw out how you would like to store the key components of a site. I use a notepad throughout the whole process and it usually starts with me laying out something that looks like this.</p>
<h2>Contents of index</h2>
<p><strong>Header</strong> (include not secure page)<br />
Main image<br />
Nav bar (include)<br />
<strong> </strong></p>
<p><strong>Sidebar</strong> (include)<br />
Sidebar components (include single and double width items)<br />
Navigation (include)</p>
<p><strong>Main content</strong> (not included)<br />
Post data</p>
<p><strong>Footer</strong> (include)<br />
Blocks of meta and links (include)<br />
Bottom strip (include)</p>
<h2>Order of Operations When Designing the Index</h2>
<p>Once this has been worked up I then head into Adobe Dreamweaver to begin the process of changing my framework into an actual css ready site with all of the divs. This process takes a fair amount of time and the content usually created in this order. First note that Dreamweaver automatically creates the untitled.php page and the css page. At this point I only have the two items on my testing server. Back to showing you the order of operations.</p>
<ol>
<li>Change the CSS page to create the proper widths for main content, sidebar, and post.</li>
<li>Change padding properties, select fonts, change margin properties.</li>
<li>Create the divs within the untitled document ie the divs in the header that hold link menus.</li>
<li> Add the div id and classes to the CSS file. (remember to work down the content as it appears within your page. Start with the header then go to sidebar, etc.)</li>
<li>Create and fill the pages with fake content and see if this is how you would like the pages to be displayed.</li>
<li>Go through and tweak anything that makes you unhappy.</li>
</ol>
<h2>Pulling Apart the Index.php Page</h2>
<p>Now that you have created your base index page and you are somewhat happy with the content you can go ahead and begin to pull the page apart. This is where the layout of includes will come in handy. This process consists of cutting and pasting section of code into new php files. The naming of these files is up to you but I normally go with “pt_” as a prefix for “Part” which is a part of a page and “pg_” which stands for “Page” meaning that it is a whole page. An example of this is “pg_authors.php” or pg_feeds_addfeed.php” The next section of naming a page comes from the actual section that is within the page. On the friendly browser feed viewer project I started there are sections of pages that relate to feeds. If I wanted to create a page where users could subscribe to a feed I would name it “pg_feed_subscribe” this tells me what the php file is, its subject and what the page is for. Another type of file I often contain is the prefix “process_” This is a page that requires a form to post to or backend piece of date. The page naming is completely up to you I just wanted to share how I go about naming my webpages.</p>
<p>Now we will go through pulling the pages apart. Now that we have gone through a little lesson on proper page names it is now time to actually pull something apart. For this I will not be using the <a href="http://rss.skorg.org/">rss.skorg.org</a> site but a new site with no content instead.</p>
<p><strong>Here is the full index.php page that we will be working with.</strong></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
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;Test&lt;/title&gt;
&lt;link href=&quot;style.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
&lt;!--[if IE 5]&gt;
&lt;style type=&quot;text/css&quot;&gt;
/* place css box model fixes for IE 5* in this conditional comment */
.twoColFixRtHdr #sidebar1 { width: 220px; }
&lt;/style&gt;
&lt;![endif]--&gt;&lt;!--[if IE]&gt;
&lt;style type=&quot;text/css&quot;&gt;
/* place css fixes for all versions of IE in this conditional comment */
.twoColFixRtHdr #sidebar1 { padding-top: 30px; }
.twoColFixRtHdr #mainContent { zoom: 1; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
&lt;/style&gt;
&lt;![endif]--&gt;&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;container&quot;&gt;
&lt;div id=&quot;header&quot;&gt;
&lt;h1&gt;Header&lt;/h1&gt;
&lt;!-- end #header --&gt;&lt;/div&gt;
&lt;div id=&quot;sidebar1&quot;&gt;
&lt;h3&gt;Sidebar1 Content&lt;/h3&gt;
&lt;p&gt;The background color on this div will only show for the length of the content. If you'd like a dividing line instead, place a border on the right side of the #mainContent div if it will always contain more content. &lt;/p&gt;
&lt;p&gt;Donec eu mi sed turpis feugiat feugiat. Integer turpis arcu, pellentesque  eget, cursus et, fermentum ut, sapien. Fusce metus mi, eleifend  sollicitudin, molestie id, varius et, nibh. Donec nec libero.&lt;/p&gt;
&lt;!-- end #sidebar1 --&gt;&lt;/div&gt;
&lt;div id=&quot;mainContent&quot;&gt;
&lt;h1&gt; Main Content &lt;/h1&gt;
&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam,  justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam  ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo  porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis  ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean  sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at,  odio. Donec et ipsum et sapien vehicula nonummy. Suspendisse potenti. Fusce  varius urna id quam. Sed neque mi, varius eget, tincidunt nec, suscipit id,  libero. In eget purus. Vestibulum ut nisl. Donec eu mi sed turpis feugiat  feugiat. Integer turpis arcu, pellentesque eget, cursus et, fermentum ut,  sapien. Fusce metus mi, eleifend sollicitudin, molestie id, varius et, nibh.  Donec nec libero.&lt;/p&gt;
&lt;h2&gt;H2 level heading &lt;/h2&gt;
&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam,  justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam  ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo  porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis  ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean  sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio.&lt;/p&gt;
&lt;!-- end #mainContent --&gt;&lt;/div&gt;
&lt;!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --&gt;&lt;br /&gt;
&lt;div id=&quot;footer&quot;&gt;
&lt;p&gt;Footer&lt;/p&gt;
&lt;!-- end #footer --&gt;&lt;/div&gt;
&lt;!-- end #container --&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></td></tr></table></div>

<p>Now we are going to pull this page apart and change some things so the include will work properly. The first thing we are going to want to do is change how the header information is setup. We want the content that can be thrown into one file to stay at the very top. The rest that we need for the page is going to be below that.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;title&gt;Test&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;container&quot;&gt;
&lt;div id=&quot;header&quot;&gt;
&lt;h1&gt;Header&lt;/h1&gt;
&lt;!– end #header –&gt;&lt;/div&gt;</pre></td></tr></table></div>

<p>Take note of where this section of code is and what has changed. The title tags have been moved below the IE exceptions. This is so it is not included in the new “pt_head_req_top.php” file. Now we are going to cut the bottom part of the header code will have a separate required field for the transition tags. This is important so if you wanted to add class to the divs you could do it to everything based on one file change.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pt_head_req_top.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;title&gt;Test&lt;/title&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pt_head_main.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Inside the two sections is where you want the head data that will change for each page. The following code is what pt_head_main.php consists of.</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="html" style="font-family:monospace;">&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;container&quot;&gt;
&lt;div id=&quot;header&quot;&gt;
&lt;h1&gt;Header&lt;/h1&gt;
&lt;!-- end #header --&gt;&lt;/div&gt;</pre></td></tr></table></div>

<p>Because we are now pulling sections of the page together with php the load times will be a little bit quicker and we have decreased the code of the index by an incredible amount. The index.php code now looks like this when we are done with it.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pt_head_req_top.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;title&gt;Test&lt;/title&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pt_head_main.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pt_sidebar_main.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;h1&gt; Main Content &lt;/h1&gt;
&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam,  justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam  ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo  porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis  ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean  sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at,  odio. Donec et ipsum et sapien vehicula nonummy. Suspendisse potenti. Fusce  varius urna id quam. Sed neque mi, varius eget, tincidunt nec, suscipit id,  libero. In eget purus. Vestibulum ut nisl. Donec eu mi sed turpis feugiat  feugiat. Integer turpis arcu, pellentesque eget, cursus et, fermentum ut,  sapien. Fusce metus mi, eleifend sollicitudin, molestie id, varius et, nibh.  Donec nec libero.&lt;/p&gt;
&lt;h2&gt;H2 level heading &lt;/h2&gt;
&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam,  justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam  ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo  porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis  ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean  sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio.&lt;/p&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pt_footer_main.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Now you should be able to create a site that is fully based off of your index. If you need to change things around like the css link based on different pages there is always PHP code for things like that.</p>
<p><a href="http://codewithdesign.com/2010/03/26/going-through-website-creation-part-2-backend/">Continue on to read part 2</a></p>
<p>By: Caleb Jonasson</p>
</div>
<img src="http://codewithdesign.com/?ak_action=api_record_view&id=151&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://codewithdesign.com/2010/03/26/going-through-website-creation-part-2-backend/' rel='bookmark' title='Going through website creation part 2: Backend'>Going through website creation part 2: Backend</a></li>
<li><a href='http://codewithdesign.com/2010/05/18/recycle-pages-by-splitting-your-website-into-pieces-with-php/' rel='bookmark' title='Recycle pages by splitting your website into pieces with PHP'>Recycle pages by splitting your website into pieces with PHP</a></li>
<li><a href='http://codewithdesign.com/2009/09/29/the-beginners-guide-to-php/' rel='bookmark' title='The Beginners Guide to PHP'>The Beginners Guide to PHP</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://codewithdesign.com/2009/11/13/going-through-website-creation-part-1-layout/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Into to HTML: Creating A Basic Web Page</title>
		<link>http://codewithdesign.com/2009/10/12/into-to-html-creating-a-basic-web-page/</link>
		<comments>http://codewithdesign.com/2009/10/12/into-to-html-creating-a-basic-web-page/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 18:53:38 +0000</pubDate>
		<dc:creator>Caleb Jonasson</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[create a basic web page]]></category>
		<category><![CDATA[create a website]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://codewithdesign.com/?p=93</guid>
		<description><![CDATA[TweetIn order to create your own web page you should first open up a text editor such as notepad or notepad ++. First things first is to copy the following code into your text editor and save it as index.php. PHP is a server side programming language which is most commonly used across the web [...]
Related posts:<ol>
<li><a href='http://codewithdesign.com/2009/11/16/into-to-html-creating-a-basic-web-page-2/' rel='bookmark' title='Into to HTML: Creating A Basic Web Page'>Into to HTML: Creating A Basic Web Page</a></li>
<li><a href='http://codewithdesign.com/2009/09/30/intro-to-html-css-creating-a-style-sheet/' rel='bookmark' title='Intro to HTML: CSS Creating a Style Sheet'>Intro to HTML: CSS Creating a Style Sheet</a></li>
<li><a href='http://codewithdesign.com/2009/10/04/creating-a-single-page-login-%e2%80%93-design-view/' rel='bookmark' title='Creating a Single Page login – Design View'>Creating a Single Page login – Design View</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div style = 'float:left; margin-right:5px;'>            <a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-text="Into to HTML: Creating A Basic Web Page" data-via="" data-url="http://codewithdesign.com/2009/10/12/into-to-html-creating-a-basic-web-page/" en>Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="tall" href="http://codewithdesign.com/2009/10/12/into-to-html-creating-a-basic-web-page/"></g:plusone></div><p>In order to create your own web page you should first open up a text editor such as notepad or notepad ++. First things first is to copy the following code into your text editor and save it as index.php. PHP is a server side programming language which is most commonly used across the web because of its simple integration with html. Actual PHP code requires a server but if there is html text inside of a PHP file a simple test on your computer will allow you to properly view the page.</p>
<blockquote><p>&lt;!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;<br />
&lt;html xmlns=”http://www.w3.org/1999/xhtml”&gt;<br />
&lt;head&gt;<br />
&lt;meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ /&gt;<br />
&lt;title&gt;Demo Website || featured on Code With Design&lt;/title&gt;<br />
&lt;/head&gt;</p>
<p>&lt;body&gt;<br />
&lt;h1&gt;H1 tags&lt;/h1&gt;<br />
&lt;h2&gt;H2 tags&lt;/h2&gt;<br />
&lt;h3&gt;H3 tags&lt;/h3&gt;<br />
&lt;p&gt;The h1 stands for header1 and these p tags are paragraph tags&lt;/p&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p></blockquote>
<p>Now we are going to step through the code so you know exactly what is going on and how the web browser reads the information. The top line of the code will let your browser know what standards it is to follow when reading the code.</p>
<blockquote><p>&lt;!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;</p></blockquote>
<p>The second line of code states that it is going to follow the w3 standards.</p>
<blockquote><p>&lt;html xmlns=”http://www.w3.org/1999/xhtml”&gt;</p></blockquote>
<p>Now we are going to get into the more customizable areas of the website. This section of information is known as head information and is not displayed on the webpage itself. This information is once again read by the browser but you can tell the search engines what information to display along with the title of the page. There are many more things that you can do with this section of the text which I will be going over in another into to HTML article.</p>
<blockquote><p>&lt;head&gt;<br />
&lt;meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ /&gt;<br />
&lt;title&gt;Demo Website || featured on Code With Design&lt;/title&gt;<br />
&lt;/head&gt;</p></blockquote>
<p>The first bit of the code is very boring but now we can get more into the content of the page. As you can see there are greater and lesser then signs with content in between, these are called tags. When declaring information inside of a tag you need to have a starting tag and a closing tag. The closing tag is going to allow you to specify that it is closing and will always close the tag immediately before it. For every opening tag you need to have a closing tag or information will not be displayed properly.</p>
<blockquote><p>&lt;h1&gt;H1 tags&lt;/h1&gt;<br />
&lt;h2&gt;H2 tags&lt;/h2&gt;<br />
&lt;h3&gt;H3 tags&lt;/h3&gt;</p></blockquote>
<p>Notice how these tag examples are within the body tags. This means that the following content will be displayed within the body of the web browser. When you look at the page you will notice that it breaks into sections. The main section is html which contains the sub sections of head and body.</p>
<blockquote><p>&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p></blockquote>
<p>You can start creating a site with just this information but it is a good idea to clarify the beginning information in the tags for the best results when trying to find bugs and errors.</p>
<p>Within the body of the page a lot of the information can be sorted into different sections. In order to seperate the content you will need to use something called div tags. A div tag can easily break apart seperate sections of the page and will help you style your page in the future.</p>
<blockquote><p>&lt;div id=”header”&gt;<br />
&lt;h1&gt;Code With Design&lt;/h1&gt;<br />
&lt;/div&gt;</p></blockquote>
<p>Note that it is possible to contain divs inside of divs.</p>
<p>Caleb Jonasson</p>
<img src="http://codewithdesign.com/?ak_action=api_record_view&id=93&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://codewithdesign.com/2009/11/16/into-to-html-creating-a-basic-web-page-2/' rel='bookmark' title='Into to HTML: Creating A Basic Web Page'>Into to HTML: Creating A Basic Web Page</a></li>
<li><a href='http://codewithdesign.com/2009/09/30/intro-to-html-css-creating-a-style-sheet/' rel='bookmark' title='Intro to HTML: CSS Creating a Style Sheet'>Intro to HTML: CSS Creating a Style Sheet</a></li>
<li><a href='http://codewithdesign.com/2009/10/04/creating-a-single-page-login-%e2%80%93-design-view/' rel='bookmark' title='Creating a Single Page login – Design View'>Creating a Single Page login – Design View</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://codewithdesign.com/2009/10/12/into-to-html-creating-a-basic-web-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript Hoirzontal Menu</title>
		<link>http://codewithdesign.com/2009/10/08/javascript-hoirzontal-menu/</link>
		<comments>http://codewithdesign.com/2009/10/08/javascript-hoirzontal-menu/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 08:31:53 +0000</pubDate>
		<dc:creator>Caleb Jonasson</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[drop down menu bar]]></category>
		<category><![CDATA[horizontal]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Spry]]></category>

		<guid isPermaLink="false">http://codewithdesign.com/?p=77</guid>
		<description><![CDATA[Tweet In order to create a proper working javascript based horizontal menu you need to have all of the necessary files. These files consist of : /SpryAssets/SpryMenuBarHorizontal.css /SpryAssets/SpryMenuBar.js index.php main.css The first section of code is going to be the SpryMenuBarHorizontal.css 1 2 3 4 5 6 7 8 9 10 11 12 13 14 [...]
Related posts:<ol>
<li><a href='http://codewithdesign.com/2012/05/11/javascript-arrays/' rel='bookmark' title='Javascript Arrays'>Javascript Arrays</a></li>
<li><a href='http://codewithdesign.com/2012/05/09/javascript-canvas-basic-game-logic-and-movement/' rel='bookmark' title='Javascript Canvas: Basic Game Logic and Movement'>Javascript Canvas: Basic Game Logic and Movement</a></li>
<li><a href='http://codewithdesign.com/2009/11/20/creating-a-fixed-header-and-footer/' rel='bookmark' title='Creating a fixed header and Footer'>Creating a fixed header and Footer</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div style = 'float:left; margin-right:5px;'>            <a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-text="Javascript Hoirzontal Menu" data-via="" data-url="http://codewithdesign.com/2009/10/08/javascript-hoirzontal-menu/" en>Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="tall" href="http://codewithdesign.com/2009/10/08/javascript-hoirzontal-menu/"></g:plusone></div><p><a href="http://codewithdesign.com/pages/java_header_test_1/index.php"><img class="alignnone size-full wp-image-78" title="javascript_horizontal_menu" src="http://codewithdesign.com/wp-content/uploads/2009/10/javascript_horizontal_menu.jpg" alt="javascript_horizontal_menu" width="592" height="108" /></a></p>
<p>In order to create a proper working javascript based horizontal menu you need to have all of the necessary files. These files consist of :</p>
<p>/SpryAssets/SpryMenuBarHorizontal.css<br />
/SpryAssets/SpryMenuBar.js</p>
<p>index.php<br />
main.css</p>
<p>The first section of code is going to be the SpryMenuBarHorizontal.css</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
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #a1a100;">@charset &quot;UTF-8&quot;;</span>
ul<span style="color: #6666ff;">.MenuBarHorizontal</span>
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">list-style-type</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</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;">100%</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">default</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.MenuBarActive</span>
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1000</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.MenuBarHorizontal</span> li
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">list-style-type</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</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;">100%</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">pointer</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">8em</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.MenuBarHorizontal</span> ul
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">list-style-type</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</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;">100%</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1020</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">default</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">8.2em</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-1000em</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.MenuBarHorizontal</span> ul<span style="color: #6666ff;">.MenuBarSubmenuVisible</span>
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.MenuBarHorizontal</span> ul li
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">8.2em</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.MenuBarHorizontal</span> ul ul
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-5%</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">95%</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.MenuBarHorizontal</span> ul<span style="color: #6666ff;">.MenuBarSubmenuVisible</span> ul<span style="color: #6666ff;">.MenuBarSubmenuVisible</span>
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.MenuBarHorizontal</span> ul
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#CCC</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.MenuBarHorizontal</span> a
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">pointer</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#4b4b4b</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0.2em</span> <span style="color: #933;">0.4em</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ffffff</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.MenuBarHorizontal</span> a<span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">,</span> ul<span style="color: #6666ff;">.MenuBarHorizontal</span> a<span style="color: #3333ff;">:focus
</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: #cc00cc;">#4b4b4b</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FFF</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.MenuBarHorizontal</span> a<span style="color: #6666ff;">.MenuBarItemHover</span><span style="color: #00AA00;">,</span> ul<span style="color: #6666ff;">.MenuBarHorizontal</span> a<span style="color: #6666ff;">.MenuBarItemSubmenuHover</span><span style="color: #00AA00;">,</span> ul<span style="color: #6666ff;">.MenuBarHorizontal</span> a<span style="color: #6666ff;">.MenuBarSubmenuVisible</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: #cc00cc;">#333366</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ccccff</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.MenuBarHorizontal</span> iframe
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1010</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #a1a100;">@media screen, projection</span>
<span style="color: #00AA00;">&#123;</span>
ul<span style="color: #6666ff;">.MenuBarHorizontal</span> li<span style="color: #6666ff;">.MenuBarItemIE</span>
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">inline</span><span style="color: #00AA00;">;</span>
f\loat<span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#4b4b4b</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>The second file, SpryMenuBar.js looks like this.</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
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">    <span style="color: #003366; font-weight: bold;">var</span> Spry<span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>Spry<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    Spry <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>Spry.<span style="color: #660066;">Widget</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    Spry.<span style="color: #660066;">Widget</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    Spry.<span style="color: #660066;">Widget</span>.<span style="color: #660066;">MenuBar</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>element<span style="color: #339933;">,</span> opts<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span>element<span style="color: #339933;">,</span> opts<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
    Spry.<span style="color: #660066;">Widget</span>.<span style="color: #660066;">MenuBar</span>.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">init</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>element<span style="color: #339933;">,</span> opts<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">element</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">getElement</span><span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">currMenu</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #003366; font-weight: bold;">var</span> isie <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> document.<span style="color: #660066;">all</span> <span style="color: #339933;">!=</span> ‘undefined’ <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #000066; font-weight: bold;">typeof</span> window.<span style="color: #660066;">opera</span> <span style="color: #339933;">==</span> ‘undefined’ <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> navigator.<span style="color: #660066;">vendor</span> <span style="color: #339933;">!=</span> ‘KDE’<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> document.<span style="color: #660066;">getElementById</span> <span style="color: #339933;">==</span> ‘undefined’ <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">vendor</span> <span style="color: #339933;">==</span> ‘Apple Computer<span style="color: #339933;">,</span> Inc.’ <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #000066; font-weight: bold;">typeof</span> window.<span style="color: #660066;">XMLHttpRequest</span> <span style="color: #339933;">==</span> ‘undefined’<span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span>isie <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #000066; font-weight: bold;">typeof</span> document.<span style="color: #660066;">uniqueID</span> <span style="color: #339933;">==</span> ‘undefined’<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>opts<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> k <span style="color: #000066; font-weight: bold;">in</span> opts<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> rollover <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Image<span style="color: #339933;">;</span>
    rollover.<span style="color: #660066;">src</span> <span style="color: #339933;">=</span> opts<span style="color: #009900;">&#91;</span>k<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">element</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">currMenu</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">element</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> items <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">element</span>.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span>‘li’<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    layers<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">parentNode</span>.<span style="color: #660066;">removeChild</span><span style="color: #009900;">&#40;</span>layers<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
    Spry.<span style="color: #660066;">Widget</span>.<span style="color: #660066;">MenuBar</span>.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">clearMenus</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>root<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> menus <span style="color: #339933;">=</span> root.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span>‘ul’<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #CC0000;">0</span> <span style="color: #339933;">?</span> submenus<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #003366; font-weight: bold;">var</span> hasSubMenu <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>menu<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">addClassName</span><span style="color: #009900;">&#40;</span>link<span style="color: #339933;">,</span> “MenuBarItemSubmenu”<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    hasSubMenu <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>isie<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
&nbsp;
    listitem.<span style="color: #660066;">contains</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>testNode<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>testNode <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>testNode <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000066; font-weight: bold;">else</span>
    <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">contains</span><span style="color: #009900;">&#40;</span>testNode.<span style="color: #660066;">parentNode</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #003366; font-weight: bold;">var</span> self <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span>listitem<span style="color: #339933;">,</span> ‘mouseover’<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>self.<span style="color: #660066;">bubbledTextEvent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    clearTimeout<span style="color: #009900;">&#40;</span>closetime<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>self.<span style="color: #660066;">currMenu</span> <span style="color: #339933;">==</span> listitem<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    self.<span style="color: #660066;">currMenu</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    self.<span style="color: #660066;">addClassName</span><span style="color: #009900;">&#40;</span>link<span style="color: #339933;">,</span> hasSubMenu <span style="color: #339933;">?</span> “MenuBarItemSubmenuHover” <span style="color: #339933;">:</span> “MenuBarItemHover”<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>menu <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #339933;">!</span>self.<span style="color: #660066;">hasClassName</span><span style="color: #009900;">&#40;</span>menu<span style="color: #339933;">,</span> “MenuBarSubmenuVisible”<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    opentime <span style="color: #339933;">=</span> window.<span style="color: #660066;">setTimeout</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>self.<span style="color: #660066;">showSubmenu</span><span style="color: #009900;">&#40;</span>menu<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">250</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span>listitem<span style="color: #339933;">,</span> ‘mouseout’<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>self.<span style="color: #660066;">bubbledTextEvent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #003366; font-weight: bold;">var</span> related <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> e.<span style="color: #660066;">relatedTarget</span> <span style="color: #339933;">!=</span> ‘undefined’ <span style="color: #339933;">?</span> e.<span style="color: #660066;">relatedTarget</span> <span style="color: #339933;">:</span> e.<span style="color: #660066;">toElement</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>listitem.<span style="color: #660066;">contains</span><span style="color: #009900;">&#40;</span>related<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    clearTimeout<span style="color: #009900;">&#40;</span>opentime<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    self.<span style="color: #660066;">currMenu</span> <span style="color: #339933;">=</span> listitem<span style="color: #339933;">;</span>
&nbsp;
    self.<span style="color: #660066;">removeClassName</span><span style="color: #009900;">&#40;</span>link<span style="color: #339933;">,</span> hasSubMenu <span style="color: #339933;">?</span> “MenuBarItemSubmenuHover” <span style="color: #339933;">:</span> “MenuBarItemHover”<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>menu<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    closetime <span style="color: #339933;">=</span> window.<span style="color: #660066;">setTimeout</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>self.<span style="color: #660066;">hideSubmenu</span><span style="color: #009900;">&#40;</span>menu<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Now you need your index.php. This is where the menu content will be.</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
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;
&lt;html xmlns=”http://www.w3.org/1999/xhtml”&gt;
&lt;head&gt;
&lt;meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ /&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;link href=”main.css” rel=”stylesheet” type=”text/css” /&gt;
&lt;script src=”SpryAssets/SpryMenuBar.js” type=”text/javascript”&gt;&lt;/script&gt;
&lt;link href=”SpryAssets/SpryMenuBarHorizontal.css” rel=”stylesheet” type=”text/css” /&gt;
&lt;/head&gt;
&nbsp;
&lt;body&gt;
&nbsp;
&lt;div id=”container”&gt;
&lt;div id=”header”&gt;
&lt;h1&gt;Header&lt;/h1&gt;
&nbsp;
&lt;ul id=”MenuBar1″&gt;
&lt;li&gt;
&lt;div align=”center”&gt;&lt;a href=”#”&gt;simple&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div align=”center”&gt;&lt;a href=”#”&gt;Smart&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div align=”center”&gt;&lt;a href=”#”&gt;Tutorials&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=”#”&gt;Photoshop&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=”#”&gt;Illustrator&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=”#”&gt;Flash&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=”#”&gt;Dreamweaver&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;!– end #header –&gt;&lt;/div&gt;
&lt;div id=”mainContent”&gt;
&lt;h1&gt; Main Content &lt;/h1&gt;
&lt;!– end #mainContent –&gt;&lt;/div&gt;
&lt;div id=”footer”&gt;
&lt;p&gt;Footer&lt;/p&gt;
&lt;!– end #footer –&gt;&lt;/div&gt;
&lt;!– end #container –&gt;&lt;/div&gt;
&lt;script type=”text/javascript”&gt;
&lt;!–
var MenuBar1 = new Spry.Widget.MenuBar(“MenuBar1″);
//–&gt;
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></td></tr></table></div>

<p>The last file that we need is the main.css file.</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
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #a1a100;">@charset &quot;utf-8&quot;;</span>
body <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">font</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100%</span> Verdana<span style="color: #00AA00;">,</span> Arial<span style="color: #00AA00;">,</span> Helvetica<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#666666</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.oneColElsCtrHdr</span> <span style="color: #cc00cc;">#container</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">46em</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FFFFFF</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.oneColElsCtrHdr</span> <span style="color: #cc00cc;">#header</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#4b4b4b</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ffffff</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.oneColElsCtrHdr</span> <span style="color: #cc00cc;">#header</span> h1 <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.oneColElsCtrHdr</span> <span style="color: #cc00cc;">#mainContent</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FFFFFF</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">50px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.oneColElsCtrHdr</span> <span style="color: #cc00cc;">#footer</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#DDDDDD</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.oneColElsCtrHdr</span> <span style="color: #cc00cc;">#footer</span> p <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p><a href="http://codewithdesign.com/pages/java_header_test_1/index.php">Try it out by clicking here.</a></p>
<img src="http://codewithdesign.com/?ak_action=api_record_view&id=77&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://codewithdesign.com/2012/05/11/javascript-arrays/' rel='bookmark' title='Javascript Arrays'>Javascript Arrays</a></li>
<li><a href='http://codewithdesign.com/2012/05/09/javascript-canvas-basic-game-logic-and-movement/' rel='bookmark' title='Javascript Canvas: Basic Game Logic and Movement'>Javascript Canvas: Basic Game Logic and Movement</a></li>
<li><a href='http://codewithdesign.com/2009/11/20/creating-a-fixed-header-and-footer/' rel='bookmark' title='Creating a fixed header and Footer'>Creating a fixed header and Footer</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://codewithdesign.com/2009/10/08/javascript-hoirzontal-menu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a Single Page login – Design View</title>
		<link>http://codewithdesign.com/2009/10/04/creating-a-single-page-login-%e2%80%93-design-view/</link>
		<comments>http://codewithdesign.com/2009/10/04/creating-a-single-page-login-%e2%80%93-design-view/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 23:03:58 +0000</pubDate>
		<dc:creator>Caleb Jonasson</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://codewithdesign.com/?p=40</guid>
		<description><![CDATA[TweetThere are many ways to go about creating a single page login. There are also many different styles that you can use when creating these logins. Before you start it is a good idea to have a good idea of what you are creating, this way you can always use it as a template in [...]
Related posts:<ol>
<li><a href='http://codewithdesign.com/2009/12/27/modifying-next-and-previous-posts/' rel='bookmark' title='Modifying next and previous posts'>Modifying next and previous posts</a></li>
<li><a href='http://codewithdesign.com/2009/12/22/making-it-that-much-better-with-css3/' rel='bookmark' title='Making it that much better with CSS3'>Making it that much better with CSS3</a></li>
<li><a href='http://codewithdesign.com/2010/05/05/remove-images-and-increase-load-times-with-css3/' rel='bookmark' title='Remove images and increase load times with CSS3'>Remove images and increase load times with CSS3</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div style = 'float:left; margin-right:5px;'>            <a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-text="Creating a Single Page login – Design View" data-via="" data-url="http://codewithdesign.com/2009/10/04/creating-a-single-page-login-%e2%80%93-design-view/" en>Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="tall" href="http://codewithdesign.com/2009/10/04/creating-a-single-page-login-%e2%80%93-design-view/"></g:plusone></div><p>There are many ways to go about creating a single page login. There are also many different styles that you can use when creating these logins. Before you start it is a good idea to have a good idea of what you are creating, this way you can always use it as a template in case things start to go wrong.</p>
<p><img class="size-full wp-image-41 alignleft" title="wp-login_img" src="http://codewithdesign.com/wp-content/uploads/2009/10/wp-login_img.jpg" alt="wp-login_img" width="378" height="343" /></p>
<p>The design I would like to create is going to consist of the title of the site, a quick description and the forum to login with. For this tutorial I will be creating the login so it will look similar to WordPress’ login screen except it will be off center and there will be no header. These types of login pages are great if the login information is in its own folder or you have a site that requires users to login prior to seeing any of the information.</p>
<p>The first step to creating a login that looks good knowing where the content will be placed. Because I plan on having my content in the middle area of the screen I am going to have to rely on percent based margin properties. After I get all of the padding and margin properties sorted out It will then be time to create a functional and easily useable text.</p>
<blockquote><p>&lt;!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN&#8221; “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221;&gt;<br />
&lt;html xmlns=&#8221;http://www.w3.org/1999/xhtml&#8221;&gt;<br />
&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;Login || Code With Design&lt;/title&gt;<br />
&lt;link href=&#8221;main.css&#8221; rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; /&gt;<br />
&lt;/head&gt;</p>
<p>&lt;body&gt;</p>
<p>&lt;div id=&#8221;container&#8221;&gt;<br />
&lt;div id=&#8221;mainContent&#8221;&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p></blockquote>
<p>By using the code above you will create the base structure for the design. It contains all of the div tags required to line this all up later with the CSS file. Now all we need to do is create a functioning form that users can enter their password and username.</p>
<blockquote><p>&lt;h1&gt;Code With Design&lt;/h1&gt;<br />
&lt;form id=&#8221;form1&#8243; name=&#8221;form1&#8243; method=&#8221;post&#8221; action=&#8221;somepage.php&#8221;&gt;<br />
&lt;table width=&#8221;375&#8243;&gt;<br />
&lt;tr&gt;<br />
&lt;td width=&#8221;142&#8243;&gt;&lt;label&gt;<br />
&lt;div align=&#8221;right&#8221;&gt;Username:&lt;/div&gt;<br />
&lt;/label&gt;&lt;/td&gt;<br />
&lt;td width=&#8221;162&#8243;&gt;&lt;input type=&#8221;text&#8221; name=&#8221;username&#8221; id=&#8221;username&#8221; /&gt;&lt;/td&gt;<br />
&lt;td width=&#8221;55&#8243;&gt;&amp;nbsp;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;&lt;label&gt;<br />
&lt;div align=&#8221;right&#8221;&gt;Password:&lt;/div&gt;<br />
&lt;/label&gt;&lt;/td&gt;<br />
&lt;td&gt;&lt;input type=&#8221;password&#8221; name=&#8221;password&#8221; id=&#8221;password&#8221; /&gt;&lt;/td&gt;<br />
&lt;td&gt;&lt;input type=&#8221;submit&#8221; name=&#8221;login&#8221; id=&#8221;login&#8221; value=&#8221;Login&#8221; /&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
&lt;h5&gt;&lt;a href=&#8221;somelink.php&#8221;&gt;Lost your password?&lt;/a&gt;&lt;/h5&gt;<br />
&lt;label&gt;&lt;/label&gt;<br />
&lt;/form&gt;</p></blockquote>
<p>If you read over the information above you will notice that the information in the tables has been moved around with the tables and not with the CSS sheet. Whatever method you use is up to you, Normally its safer to go with the CSS method but at the time of creating this login I wanted to keep the CSS clean for creating more login pages.</p>
<blockquote><p>@charset “utf-8″;<br />
body {<br />
font: 100% Plantagenet Cherokee;<br />
background: #ffffff;<br />
margin: 0;<br />
padding: 0;<br />
text-align: center;<br />
color: #000000;<br />
}<br />
body a {<br />
text-decoration:none;<br />
color:#333333;<br />
}<br />
body a:hover {<br />
text-decoration:none;<br />
color:#666666;<br />
}<br />
.oneColElsCtr #container {<br />
width: 100%;<br />
margin: 0 auto;<br />
text-align: left;<br />
}<br />
.oneColElsCtr #mainContent {<br />
padding: 3px 20px;<br />
margin-top:20%;<br />
margin-left:20%;<br />
margin-bottom: 10%;<br />
width:400px;<br />
background: #e4edfe; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px;<br />
}<br />
.oneColElsCtr #mainContent h1 {<br />
background: #ffffff; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px;<br />
}<br />
.oneColElsCtr #mainContent input {<br />
font-family: “Plantagenet Cherokee”;<br />
background: #e4edfe;<br />
border: 2px #333 solid;<br />
}</p></blockquote>
<p>Now we are going to go through the CSS file that was entered above. The body is pretty standard here and doesn’t have a whole lot to do with the placement of the login container. The placement of the login container is built up within the one column elastic container main content. If you look at the code you will see that there is padding so the information is not touching the outside of the div. There is also a lot of margins created here and as mentioned above its measurement is percent based. This will help the login div stay within the central areas of the page. There is also a set width, this is so the div doesn’t extend all the way to the right.</p>
<blockquote><p>.oneColElsCtr #mainContent {<br />
padding: 3px 20px;<br />
margin-top:20%;<br />
margin-left:20%;<br />
margin-bottom: 10%;<br />
width:400px;<br />
background: #e4edfe; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px;<br />
}</p></blockquote>
<p>The next thing on the page that you will notice is how the content is wrapped in a round border. This is because of the following code. It is a simple way to make the content rounded inside of your browser. It is also possible to make a border with this style method, however the look of this login is flat so a boarder is not going to be needed.</p>
<blockquote><p>background: #e4edfe; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px;</p></blockquote>
<p>The third and final thing that you will notice is how the login box contains the same font as the rest of the page and the button does not look like a normal forum button. This is because of the following code in the CSS file.</p>
<blockquote><p>.oneColElsCtr #mainContent input {<br />
font-family: “Plantagenet Cherokee”;<br />
background: #e4edfe;<br />
border: 2px #333 solid;<br />
}</p></blockquote>
<p>It forces the input properties within the MainContent to have a background that matches that of the rest of the page and also creates square borders around the button and input text lines.</p>
<p>Here are the final results</p>
<p><img class="size-full wp-image-42 alignnone" title="Untitled-1" src="http://codewithdesign.com/wp-content/uploads/2009/10/Untitled-1.jpg" alt="Untitled-1" width="479" height="261" /></p>
<p>Caleb Jonasson</p>
<img src="http://codewithdesign.com/?ak_action=api_record_view&id=40&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://codewithdesign.com/2009/12/27/modifying-next-and-previous-posts/' rel='bookmark' title='Modifying next and previous posts'>Modifying next and previous posts</a></li>
<li><a href='http://codewithdesign.com/2009/12/22/making-it-that-much-better-with-css3/' rel='bookmark' title='Making it that much better with CSS3'>Making it that much better with CSS3</a></li>
<li><a href='http://codewithdesign.com/2010/05/05/remove-images-and-increase-load-times-with-css3/' rel='bookmark' title='Remove images and increase load times with CSS3'>Remove images and increase load times with CSS3</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://codewithdesign.com/2009/10/04/creating-a-single-page-login-%e2%80%93-design-view/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

