<?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; html</title>
	<atom:link href="http://codewithdesign.com/tag/html/feed/" rel="self" type="application/rss+xml" />
	<link>http://codewithdesign.com</link>
	<description>web application development blog by Caleb Jonasson</description>
	<lastBuildDate>Thu, 15 Sep 2011 17:52:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<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.


Related posts:<ol><li><a href='http://codewithdesign.com/2009/10/08/javascript-hoirzontal-menu/' rel='bookmark' title='Permanent Link: Javascript Hoirzontal Menu'>Javascript Hoirzontal Menu</a></li>
<li><a href='http://codewithdesign.com/2009/09/30/intro-to-html-css-creating-a-style-sheet/' rel='bookmark' title='Permanent Link: 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/11/13/going-through-website-creation-part-1-layout/' rel='bookmark' title='Permanent Link: Going Through Website Creation Part 1: Layout'>Going Through Website Creation Part 1: Layout</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="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><g:plusone size="tall" href="http://codewithdesign.com/2010/04/02/get-install-and-use-light-box/"></g:plusone><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>Related posts:<ol><li><a href='http://codewithdesign.com/2009/10/08/javascript-hoirzontal-menu/' rel='bookmark' title='Permanent Link: Javascript Hoirzontal Menu'>Javascript Hoirzontal Menu</a></li>
<li><a href='http://codewithdesign.com/2009/09/30/intro-to-html-css-creating-a-style-sheet/' rel='bookmark' title='Permanent Link: 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/11/13/going-through-website-creation-part-1-layout/' rel='bookmark' title='Permanent Link: Going Through Website Creation Part 1: Layout'>Going Through Website Creation Part 1: Layout</a></li>
</ol></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>Learning HTML in one short night</title>
		<link>http://codewithdesign.com/2010/03/03/learning-html-in-one-short-night/</link>
		<comments>http://codewithdesign.com/2010/03/03/learning-html-in-one-short-night/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 02:43:29 +0000</pubDate>
		<dc:creator>Caleb Jonasson</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[h1]]></category>
		<category><![CDATA[hr]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[learn html]]></category>
		<category><![CDATA[night]]></category>
		<category><![CDATA[p]]></category>
		<category><![CDATA[table]]></category>
		<category><![CDATA[tag]]></category>

		<guid isPermaLink="false">http://codewithdesign.com/?p=275</guid>
		<description><![CDATA[Open up your text editor because it is time to learn HTML in one night. If you are unfamiliar with HTML you should know that it is first and foremost a scripting language. Your server is going to send this file to the person’s computer. This person’s web browser; be it “Chrome”, ”Safari”, ”Opera”, ”Firefox” or “Internet Explorer” is then going to read the information and display it on screen.


Related posts:<ol><li><a href='http://codewithdesign.com/2009/11/16/into-to-html-creating-a-basic-web-page-2/' rel='bookmark' title='Permanent Link: 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/10/12/into-to-html-creating-a-basic-web-page/' rel='bookmark' title='Permanent Link: 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='Permanent Link: Intro to HTML: CSS Creating a Style Sheet'>Intro to HTML: CSS Creating a Style Sheet</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="Learning HTML in one short night" data-via="" data-url="http://codewithdesign.com/2010/03/03/learning-html-in-one-short-night/" en>Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><g:plusone size="tall" href="http://codewithdesign.com/2010/03/03/learning-html-in-one-short-night/"></g:plusone><h2>Introduction</h2>
<p>Open up your text editor because it is time to learn HTML in one night. If you are unfamiliar with HTML you should know that it is first and foremost a scripting language. Your server is going to send this file to the person’s computer. This person’s web browser; be it “<a href="http://www.google.com/chrome" target="_blank">Chrome</a>”, ”<a href="http://www.apple.com/safari/" target="_blank">Safari</a>”, ”<a href="http://www.opera.com/" target="_blank">Opera</a>”, ”<a href="http://www.mozilla.com/en-US/firefox/personal.html" target="_blank">Firefox</a>” or “<span style="text-decoration: line-through;">Internet Explorer</span>” is then going to read the information and display it on screen.</p>
<p>This is an in depth look at HTML and how it is structured. In a future article I will include CSS with some CSS3.</p>
<p>HTML stands for hyper text markup language and is written in a standard text editor. (notepad for Windows, text edit for Macintosh) We are going to go ahead and start the tutorial now.</p>
<p>Please make sure that you have a folder, web browser and text editor open on your screen.</p>
<h2>Building our first page</h2>
<p>Open up your text editor; type in the following code and then save the file as “index.html” Be sure to write the extension. If it saves as “index.html.txt” then open up the folder that the file resides in, write click it go to “properties” on Window or “get info” on a Mac and remove the “.txt” extension.</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;html&gt;
    &lt;head&gt;
    &lt;/head&gt;
&nbsp;
    &lt;body&gt;
    &lt;/body&gt;
    &lt;/html&gt;</pre></td></tr></table></div>

<p>The code above doesn’t contain anything special which is why you don’t see anything. In order to add content we are going to add a little more code to demonstrate some content on the screen but first we need to understand what was just added.</p>
<p>The first part of the above code tells the browser that inside is the HTML, in fact everything is until it reaches the closing statement or the bottom of the page. The head tags as you can see &#8220;&lt;head&gt;&lt;/head&gt;&#8221; tell the browser where the head information is. This information usually contains the title of the page, some meta data, style tags or links to css files and a little javascrip.</p>
<p>The tags below this are the body tags. Inside of here is where we will be putting all of the page contents which you will see shortly.</p>
<p>The next step is to add a line of code to your website. It is going to be at the very top and will have the type of charset, some meta data and the doctype. For now you do not need to know what it means but know that it is good practice and allows your code to be read properly.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</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;head&gt;
    &lt;/head&gt;
&nbsp;
    &lt;body&gt;
    &lt;/body&gt;
    &lt;/html&gt;</pre></td></tr></table></div>

<p>Now that we have the basic structure of the page setup we can go ahead and add a title. Like everything else it is set in tags and requires no formatting.</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;head&gt;
&lt;title&gt;Code With Design&lt;/title&gt;
&lt;/head&gt;</pre></td></tr></table></div>

<p><strong>Note:</strong> The naming of the title is important. It will allow search engines and bots to easily find your content and increase your page rank. Make sure it covers what the page is about but don&#8217;t make it to long. Search engines don&#8217;t like that.</p>
<h2>Testing your page</h2>
<p>In order to test your page you just need to find the index.html file&#8217;s location on your hard disk and double click it. The page will open up in your default browser. If it does not you are going to need to associate a browser with that type of file. You can also open up your web browser and set the URL to the location of the file on your hard disk.</p>
<p>When it comes to testing to see if you have valid code it is as simple as using the W3C validation service offered <a href="http://validator.w3.org/" target="_blank">here</a>. You can test a page by using the URL, copying and pasting or uploading the file directly.</p>
<h2>The body of the page</h2>
<p>The next step in our quest for knowledge is getting text onto the screen. In order to accomplish this there are some ways to go about doing so. First there is just plain text which I would advise not doing do to styling complications later on. The next type of text is &#8220;paragraph&#8221; text. This text is displayed in &lt;p&gt;&lt;/p&gt; tags and is formatted to have spaces on the top of the first line and the bottom of the bottom line. The third main kind of text is heading tags, once again name these accordingly because it will help your pages chances of getting higher in the search engine.</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;body&gt;
&lt;h1&gt;This will be shown at an h1 level&lt;/h1&gt;
&lt;p&gt;Here is som basic fill text that is only used to display what is needed.&lt;/p&gt;
&lt;h2&gt;Difference in size&lt;/h2&gt;
&lt;p&gt;As you can tell there is a difference in size between the heading 1 and heading 2 tags. This difference can be changed later on using page styles.&lt;/p&gt;
&lt;/body&gt;</pre></td></tr></table></div>

<p>The bit of code we are going to use is called a div. Div tags can be found throughout websites and are the main structure of formatting. Div tags can be of type class or id and are used with css to change how a website appears on screen. The following is the basic structure of how a div tag works.</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;div class=”this_is_where_css_is_associated”&gt;
&lt;h1&gt;Article title&lt;/h1&gt;
&lt;p&gt;Content goes here.&lt;/p&gt;
&lt;/div&gt;</pre></td></tr></table></div>

<p><strong>Note:</strong> The div tag can be formatted with CSS to change the location of this content on the screen along with colors, and size. Also, div tags are often associated with classes over id.</p>
<h2>Menus and links</h2>
<p>Menus in HTML are commonly created using unordered lists and list items. These tags like as follows &lt;ul&gt;unordered list&lt;/ul&gt; and &lt;li&gt;List item&lt;/li&gt;. When written these tags are nested meaning that the list item tags inside of the unordered list.</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;ul&gt;
&lt;li&gt;Menu item 1&lt;/li&gt;
&lt;li&gt;Menu item 2&lt;/li&gt;
&lt;/ul&gt;</pre></td></tr></table></div>

<p><img class="alignnone size-full wp-image-279" title="html list item" src="http://codewithdesign.com/wp-content/uploads/2010/03/cwd-list.jpg" alt="" width="144" height="69" /></p>
<p>It isn&#8217;t going to be much of a menu if we cannot click the item and find ourselves on another page. In order to do this we are going to need to add the following code.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;a href=”http://codewithdesign.com/”&gt;Code With Design&lt;/a&gt;
&lt;a href=”some-random-page.php”&gt;Linking internally&lt;/a&gt;</pre></td></tr></table></div>


<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;ul&gt;
&lt;li&gt;&lt;href=”http://codewithdesign.com”&gt;codewithdesign.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;href=”http://lirkr.com”&gt;Search engine&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</pre></td></tr></table></div>

<p>Initially the menu is going to look very bad but there is hope for it yet. The menu is styled this way as a default. Once you add css to the web page it will begin to look better.</p>
<p>Header rules are not as common as they once were do to the increase in proper CSS they were quickly replaced with borders on div tags. If you are looking for a heading rule then you can add the simple code below.</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;hr&gt;&lt;/hr&gt;</pre></td></tr></table></div>

<p><strong>Note:</strong> There is not content inside of this header ruling for a reason. All that is required are the two tags and a line will be created.</p>
<h2>Tables</h2>
<p><strong>Note:</strong> It is best practice to not use tables at all unless you are puling the information form a database. If you choose to make your website layout using tables note that it isn&#8217;t considered common practice, it will increase load times, they are messier to work with and all around a bad idea.</p>
<p>Tables are created using the &lt;table&gt;&lt;/table&gt; tags and consist of nested tags inside. The basic table will look something like this.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;table cellspacing=”5px” border=”1px”&gt;
&lt;tr&gt;
&lt;td&gt;Row 1 col 1&lt;/td&gt;
&lt;td&gt;Row 1 col 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Row 2 col 1&lt;/td&gt;
&lt;td&gt;Row 2 col 2&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</pre></td></tr></table></div>

<p>This table was made using cell spacing and a border just to let you see how it is all aligned. Like I have previously stated these are not a good idea unless displaying data and even then there are better ways then tables.</p>
<h2>Forms</h2>
<p>These are html components that can be used to send information to other pages on the site. These components range in abilities and are often used to pass a username and password to a site. The general way that it is written is as follows:</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;form action=”&quot; method=”&quot; enctype=”multipart/form-data” name=”form-name” id=”form-id”&gt;
&nbsp;
    &lt;/form&gt;</pre></td></tr></table></div>

<p>Going through the top line it is obvious that we are going to need to add components within the form tags. The forms id and name should be changed to your choosing are commonly named the same. (ie: name=&#8221;form1&#8243; id=&#8221;form1&#8243;) The action of the form is where you want the information to be posted. This usually means that it will be sent to PHP page.</p>
<h2>Components for forms</h2>
<p>Components are usually enclosed in label tags which means that you can add generic text that will be grouped with the item itself.</p>
<p><strong>text area</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
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">    &lt;label&gt;
    &lt;input type=”text” name=”text” id=”text”&gt;
    &lt;label&gt;
&nbsp;
    &lt;label&gt;
    &lt;input type=”textarea” name=”textarea” id=”textarea”&gt;
    &lt;label&gt;
&nbsp;
    &lt;label&gt;
    &lt;input type=”checkbox” name=”chkbox” id=”chkbox”&gt;
    &lt;label&gt;
&nbsp;
    &lt;label&gt;
    &lt;input type=”radio” name=”radio” id=”radio”&gt;
    &lt;label&gt;</pre></td></tr></table></div>

<p>Using the above format you can create items such as:</p>
<blockquote><p>file input field &#8220;file&#8221;<br />
hidden field to pass data without a field appearing on screen &#8220;hidden&#8221;<br />
A submit button used to post the form &#8220;submit&#8221;</p></blockquote>
<p><img class="alignnone size-full wp-image-278" title="form" src="http://codewithdesign.com/wp-content/uploads/2010/03/form.jpg" alt="" width="393" height="362" /></p>
<img src="http://codewithdesign.com/?ak_action=api_record_view&id=275&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='Permanent Link: 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/10/12/into-to-html-creating-a-basic-web-page/' rel='bookmark' title='Permanent Link: 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='Permanent Link: Intro to HTML: CSS Creating a Style Sheet'>Intro to HTML: CSS Creating a Style Sheet</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://codewithdesign.com/2010/03/03/learning-html-in-one-short-night/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='Permanent Link: 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='Permanent Link: Remove images and increase load times with CSS3'>Remove images and increase load times 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='Permanent Link: 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="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><g:plusone size="tall" href="http://codewithdesign.com/2009/12/27/modifying-next-and-previous-posts/"></g:plusone><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='Permanent Link: 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='Permanent Link: Remove images and increase load times with CSS3'>Remove images and increase load times 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='Permanent Link: 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/27/modifying-next-and-previous-posts/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='Permanent Link: 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='Permanent Link: 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='Permanent Link: 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><g:plusone size="tall" href="http://codewithdesign.com/2009/11/20/creating-a-fixed-header-and-footer/"></g:plusone><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='Permanent Link: 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='Permanent Link: 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='Permanent Link: 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>Into to HTML: Creating A Basic Web Page</title>
		<link>http://codewithdesign.com/2009/11/16/into-to-html-creating-a-basic-web-page-2/</link>
		<comments>http://codewithdesign.com/2009/11/16/into-to-html-creating-a-basic-web-page-2/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 19:54:49 +0000</pubDate>
		<dc:creator>Caleb Jonasson</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[basics]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[intro to html]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://codewithdesign.com/?p=164</guid>
		<description><![CDATA[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.


Related posts:<ol><li><a href='http://codewithdesign.com/2009/10/12/into-to-html-creating-a-basic-web-page/' rel='bookmark' title='Permanent Link: 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='Permanent Link: 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='Permanent Link: 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/11/16/into-to-html-creating-a-basic-web-page-2/" en>Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><g:plusone size="tall" href="http://codewithdesign.com/2009/11/16/into-to-html-creating-a-basic-web-page-2/"></g:plusone><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 codewithdesign.com&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 codewithdesign.com&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;The Empty Headed Blog&lt;/h1&gt;<br />
&lt;/div&gt;</p></blockquote>
<p>Note that it is possible to contain divs inside of divs.</p>
<img src="http://codewithdesign.com/?ak_action=api_record_view&id=164&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://codewithdesign.com/2009/10/12/into-to-html-creating-a-basic-web-page/' rel='bookmark' title='Permanent Link: 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='Permanent Link: 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='Permanent Link: 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/16/into-to-html-creating-a-basic-web-page-2/feed/</wfw:commentRss>
		<slash:comments>0</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='Permanent Link: Going through website creation part 2: Backend'>Going through website creation part 2: Backend</a></li>
<li><a href='http://codewithdesign.com/2009/12/22/easyworks-a-new-php-front-end-framework/' rel='bookmark' title='Permanent Link: Easyworks a new PHP front end framework'>Easyworks a new PHP front end framework</a></li>
<li><a href='http://codewithdesign.com/2010/05/18/recycle-pages-by-splitting-your-website-into-pieces-with-php/' rel='bookmark' title='Permanent Link: Recycle pages by splitting your website into pieces with PHP'>Recycle pages by splitting your website into pieces with 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><g:plusone size="tall" href="http://codewithdesign.com/2009/11/13/going-through-website-creation-part-1-layout/"></g:plusone><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='Permanent Link: Going through website creation part 2: Backend'>Going through website creation part 2: Backend</a></li>
<li><a href='http://codewithdesign.com/2009/12/22/easyworks-a-new-php-front-end-framework/' rel='bookmark' title='Permanent Link: Easyworks a new PHP front end framework'>Easyworks a new PHP front end framework</a></li>
<li><a href='http://codewithdesign.com/2010/05/18/recycle-pages-by-splitting-your-website-into-pieces-with-php/' rel='bookmark' title='Permanent Link: Recycle pages by splitting your website into pieces with PHP'>Recycle pages by splitting your website into pieces with 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='Permanent Link: 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='Permanent Link: 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='Permanent Link: 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><g:plusone size="tall" href="http://codewithdesign.com/2009/10/12/into-to-html-creating-a-basic-web-page/"></g:plusone><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='Permanent Link: 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='Permanent Link: 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='Permanent Link: 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/2009/11/20/creating-a-fixed-header-and-footer/' rel='bookmark' title='Permanent Link: Creating a fixed header and Footer'>Creating a fixed header and Footer</a></li>
<li><a href='http://codewithdesign.com/2011/05/19/javascript-settimeout-firing-immediately/' rel='bookmark' title='Permanent Link: JavaScript: setTimeout Firing Immediately'>JavaScript: setTimeout Firing Immediately</a></li>
<li><a href='http://codewithdesign.com/2009/12/27/modifying-next-and-previous-posts/' rel='bookmark' title='Permanent Link: Modifying next and previous posts'>Modifying next and previous posts</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><g:plusone size="tall" href="http://codewithdesign.com/2009/10/08/javascript-hoirzontal-menu/"></g:plusone><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/2009/11/20/creating-a-fixed-header-and-footer/' rel='bookmark' title='Permanent Link: Creating a fixed header and Footer'>Creating a fixed header and Footer</a></li>
<li><a href='http://codewithdesign.com/2011/05/19/javascript-settimeout-firing-immediately/' rel='bookmark' title='Permanent Link: JavaScript: setTimeout Firing Immediately'>JavaScript: setTimeout Firing Immediately</a></li>
<li><a href='http://codewithdesign.com/2009/12/27/modifying-next-and-previous-posts/' rel='bookmark' title='Permanent Link: Modifying next and previous posts'>Modifying next and previous posts</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='Permanent Link: Modifying next and previous posts'>Modifying next and previous posts</a></li>
<li><a href='http://codewithdesign.com/2009/11/20/creating-a-fixed-header-and-footer/' rel='bookmark' title='Permanent Link: 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='Permanent Link: Intro to HTML: CSS Creating a Style Sheet'>Intro to HTML: CSS Creating a Style Sheet</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><g:plusone size="tall" href="http://codewithdesign.com/2009/10/04/creating-a-single-page-login-%e2%80%93-design-view/"></g:plusone><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='Permanent Link: Modifying next and previous posts'>Modifying next and previous posts</a></li>
<li><a href='http://codewithdesign.com/2009/11/20/creating-a-fixed-header-and-footer/' rel='bookmark' title='Permanent Link: 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='Permanent Link: Intro to HTML: CSS Creating a Style Sheet'>Intro to HTML: CSS Creating a Style Sheet</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>
		<item>
		<title>Intro to HTML: CSS Creating a Style Sheet</title>
		<link>http://codewithdesign.com/2009/09/30/intro-to-html-css-creating-a-style-sheet/</link>
		<comments>http://codewithdesign.com/2009/09/30/intro-to-html-css-creating-a-style-sheet/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 19:05:45 +0000</pubDate>
		<dc:creator>Caleb Jonasson</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[creating a style sheet]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[intro to html]]></category>

		<guid isPermaLink="false">http://codewithdesign.com/?p=22</guid>
		<description><![CDATA[TweetCSS stands for cascading style sheet, this is the document that will contain all of the information required to make your site look more appealing to the people reading it. Some of the things that CSS files can do are as follows: give areas of the page or the page a background, change the font [...]


Related posts:<ol><li><a href='http://codewithdesign.com/2009/11/20/creating-a-fixed-header-and-footer/' rel='bookmark' title='Permanent Link: Creating a fixed header and Footer'>Creating a fixed header and Footer</a></li>
<li><a href='http://codewithdesign.com/2009/10/04/creating-a-single-page-login-%e2%80%93-design-view/' rel='bookmark' title='Permanent Link: Creating a Single Page login – Design View'>Creating a Single Page login – Design View</a></li>
<li><a href='http://codewithdesign.com/2009/10/08/javascript-hoirzontal-menu/' rel='bookmark' title='Permanent Link: Javascript Hoirzontal Menu'>Javascript Hoirzontal Menu</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="Intro to HTML: CSS Creating a Style Sheet" data-via="" data-url="http://codewithdesign.com/2009/09/30/intro-to-html-css-creating-a-style-sheet/" en>Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><g:plusone size="tall" href="http://codewithdesign.com/2009/09/30/intro-to-html-css-creating-a-style-sheet/"></g:plusone><p>CSS stands for cascading style sheet, this is the document that will contain all of the information required to make your site look more appealing to the people reading it. Some of the things that CSS files can do are as follows: give areas of the page or the page a background, change the font and font color, and manage placement of div tags. Take note that the page created in this example is going to be very ugly and its sole purpose is to give you a better understanding as to how CSS works.</p>
<p>For the following we are going to use this as a layout and I would recommend that you use it as a base structure that you can build your site upon for the duration of this article.</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;Untitled Document&lt;/title&gt;<br />
&lt;link href=”style.css” rel=”stylesheet” type=”text/css” /&gt;<br />
&lt;/head&gt;</p>
<p>&lt;body&gt;<br />
&lt;div id=”container”&gt;<br />
&lt;div id=”header”&gt;<br />
&lt;h1&gt;Code With Design&lt;/h1&gt;<br />
&lt;/div&gt;<br />
&lt;div id=”sidebar1″&gt;<br />
&lt;h3&gt;navigation&lt;/h3&gt;<br />
&lt;p&gt;navigation links coming in another tutorial.&lt;/p&gt;<br />
&lt;/div&gt;<br />
&lt;div id=”mainContent”&gt;<br />
&lt;h1&gt; Header 1&lt;/h1&gt;<br />
&lt;p&gt;Paragraph text.&lt;/p&gt;<br />
&lt;/div&gt;<br />
&lt;br /&gt;<br />
&lt;div id=”footer”&gt;<br />
&lt;p&gt;Code With Design&lt;/p&gt;<br />
&lt;/div&gt;</p>
<p>&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p></blockquote>
<p>On this page we are going to work with styling the div tags. If you look at the code you will notice that the tags aren’t just a simple open and closing tag. These look differently because the div tags are named. This is important because the style.css file needs to know what to do with the separate content.</p>
<blockquote><p>&lt;div id=”footer”&gt;</p></blockquote>
<p>You are also going to notice that in the head of the file there is a link to the style sheet. If you where to put your pages into a separate folder you would have to change the link because it is relative. You can also call on it through a URL.</p>
<blockquote><p>&lt;link href=”style.css” rel=”stylesheet” type=”text/css” /&gt;</p></blockquote>
<p>If you need to push the link back use ../ before style.css</p>
<blockquote><p>&lt;link href=”../style.css” rel=”stylesheet” type=”text/css” /&gt;</p></blockquote>
<p>Now that we have gone over how to properly link to a style sheet it is time to take a look at what an actual style sheet. The beginning of a style sheet will contain some simple code then will start to stylize the body. All of the content within the style.css sheet will be named as divs and other parts of content such as p for paragraph or hover for content with a mouse over. The attributes that go with these separate sections are placed within curly bracers.</p>
<blockquote><p>@charset “utf-8″;<br />
body  {<br />
font: 100% Verdana, Arial, Helvetica, sans-serif;<br />
background: #ffffff;<br />
margin: 0;<br />
padding: 0;<br />
text-align: center;<br />
color: #000000;<br />
}<br />
#container {<br />
width: 900px;<br />
background: #FFFFFF;<br />
margin: 0 auto;<br />
text-align: left;<br />
}<br />
#header {<br />
background: #ffffff;<br />
padding: 0 10px 0 20px;<br />
}<br />
#header h1 {<br />
margin: 0;<br />
padding: 10px 0;<br />
}<br />
#sidebar1 {<br />
float: right;<br />
width: 200px;<br />
background: #ffffff;<br />
padding: 15px 10px;<br />
}<br />
#mainContent {<br />
margin: 0 250px 0 0;<br />
padding: 0 20px;<br />
}<br />
#footer {<br />
padding: 0 10px 0 20px;<br />
background:#ffffff;<br />
}<br />
#footer p {<br />
margin: 0;<br />
padding: 10px 0;<br />
}<br />
.fltrt {<br />
float: right;<br />
margin-left: 8px;<br />
}<br />
.fltlft {<br />
float: left;<br />
margin-right: 8px;<br />
}<br />
.clearfloat {<br />
clear:both;<br />
height:0;<br />
font-size: 1px;<br />
line-height: 0px;<br />
}</p></blockquote>
<p>Because I intend on linking an image to this page I want to make sure that the image will not have a border when I mouse over it. So in this demo I will first add an image that is linkable to the index.php page. The code looks like this.</p>
<blockquote><p>&lt;a href=”http://www.google.ca/”&gt;&lt;img src=”http://www.google.ca/intl/en_ca/images/logo.gif” alt=”&#8221; name=”image” width=”276″ height=”110″ id=”image” /&gt;&lt;/a&gt;</p></blockquote>
<p>Place the code into the main content div of your page and preview the page before changing the CSS so you know what the browser will want to do automatically. Now that you can see the large blue lines around the image you can place this code into the style.css page. As long as the code is not placed inside of another attribute it will work, it is a good idea to keep the separate styles close together based on where they come on the page so you may want header first then content followed by sidebar then footer.</p>
<blockquote><p>#mainContent img{<br />
float:left;<br />
border: 0px;<br />
text-decoration:none;<br />
}</p></blockquote>
<p>Because the CSS entered above has a hash sign followed by the content section and a space with “img” typed after; the following effects will only apply themselves to images inside of the main content. If you would like all of the images to display no border then you would have to enter the following code.</p>
<blockquote><p>img {<br />
border: 0px;<br />
}</p></blockquote>
<p>This is a very important technique when styling a page and it comes in handy quite often. If I wanted the paragraph to be indented 20 pixels and the header to only be indented 10 pixels I would use a very similar method.</p>
<blockquote><p>#mainContent h1,h2,h3{<br />
padding-left: 10px;</p>
<p>}</p>
<p>#mainContent p {<br />
padding-left:20px;<br />
}</p></blockquote>
<p>In order to give the page some boarders we could use the simple code.</p>
<blockquote><p>#container {<br />
border: 1px solid #444444;<br />
}</p></blockquote>
<p>Now you should have a simple understanding as to how CSS files can effect your document and one of the great things about them is that you can easily style all of the pages on your website by just linking back to the style sheet. This way if you need to change the look of something all you need to do is update the style.css file.</p>
<img src="http://codewithdesign.com/?ak_action=api_record_view&id=22&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='Permanent Link: Creating a fixed header and Footer'>Creating a fixed header and Footer</a></li>
<li><a href='http://codewithdesign.com/2009/10/04/creating-a-single-page-login-%e2%80%93-design-view/' rel='bookmark' title='Permanent Link: Creating a Single Page login – Design View'>Creating a Single Page login – Design View</a></li>
<li><a href='http://codewithdesign.com/2009/10/08/javascript-hoirzontal-menu/' rel='bookmark' title='Permanent Link: Javascript Hoirzontal Menu'>Javascript Hoirzontal Menu</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://codewithdesign.com/2009/09/30/intro-to-html-css-creating-a-style-sheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

