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

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

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

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

<p>For the drop shadows on text:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">h3<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Times<span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">letter-spacing</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">text-shadow</span><span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span> <span style="color: #933;">2px</span> <span style="color: #933;">2px</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>For the opacity:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.sidebar</span> ul<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">list-style-type</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	opacity<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0.9</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">180px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<h2>The HTML</h2>

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

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

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

		<guid isPermaLink="false">http://codewithdesign.com/?p=229</guid>
		<description><![CDATA[With the introduction of CSS3 we now have quite a few new CSS techniques at our disposal. To create a drop shadow we only need two lines of code for our technique to work on most of the popular browser. In order to get rounded corners we only need another two lines of code. This post is purely for reference purposes when using CSS3.
Related posts:<ol>
<li><a href='http://codewithdesign.com/2010/05/05/remove-images-and-increase-load-times-with-css3/' rel='bookmark' title='Remove images and increase load times with CSS3'>Remove images and increase load times with CSS3</a></li>
<li><a href='http://codewithdesign.com/2009/12/30/creating-a-top-button/' rel='bookmark' title='Creating a top button'>Creating a top button</a></li>
<li><a href='http://codewithdesign.com/2009/12/27/modifying-next-and-previous-posts/' rel='bookmark' title='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="Making it that much better with CSS3" data-via="" data-url="http://codewithdesign.com/2009/12/22/making-it-that-much-better-with-css3/" en>Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="tall" href="http://codewithdesign.com/2009/12/22/making-it-that-much-better-with-css3/"></g:plusone></div><p>With the introduction of CSS3 we now have quite a few new CSS techniques at our disposal. To create a drop shadow we only need two lines of code for our technique to work on most of the popular browser. In order to get rounded corners we only need another two lines of code. This post is purely for reference purposes when using CSS3.</p>
<h2>Rounding 4 corners</h2>
<p>To round four corners you only need the following code. It is quite simple to get these to work and the information in the lines explain themselves when working with div tags.</p>
<blockquote><p>-moz-border-radius:0px;<br />
-webkit-border-radius:0px;</p></blockquote>
<p>An example of this code in action would be as follows:</p>
<blockquote><p>.post {</p>
<p>-moz-border-radius:5px;<br />
-webkit-border-radius:5px;</p>
<p>}</p></blockquote>
<p>The HTML:</p>
<blockquote><p>&lt;div class=&#8221;post&#8221;&gt;&lt;h1&gt;hello&lt;/h1&gt;&lt;/div&gt;</p></blockquote>
<h2>Rounding individual corners</h2>
<p>To round individual corners you will need to use the following pairs of code. Much like rounding all corners this is pretty self explanatory.</p>
<blockquote><p>-moz-border-radius-topleft:0px;<br />
-webkit-border-top-left-radius:0px;</p></blockquote>
<blockquote><p>
-moz-border-radius-topright:0px;<br />
-webkit-border-top-right-radius:0px;</p></blockquote>
<blockquote><p>
-moz-border-radius-bottomleft:0px;<br />
-webkit-border-bottom-left-radius:0px;</p></blockquote>
<blockquote><p>
-moz-border-radius-bottomright:0px;<br />
-webkit-border-bottom-right-radius:0px;</p></blockquote>
<p>An example of the individual corners would be as follows:</p>
<blockquote><p>.topleft3 {</p>
<p>-moz-border-radius-topleft:3px;<br />
-webkit-border-top-left-radius:3px;</p>
<p>}</p>
<p>.topright5 {</p>
<p>-moz-border-radius-topright:5px;<br />
-webkit-border-top-right-radius:5px;</p>
<p>}</p></blockquote>
<p>The HTML:</p>
<blockquote><p>&lt;div class=&#8221;topleft3&#8243;&gt;&lt;div class=&#8221;ropright5&#8243;&gt;&lt;h1&gt;hello there&lt;/h1&gt;&lt;/div&gt;&lt;/div&gt;</p></blockquote>
<h2>Giving a div a drop shadow</h2>
<p>This is pretty simple much the rest of the code. It allows you to give a box a drop shadow and a pretty effective one at that.</p>
<blockquote><p>-webkit-box-shadow: 0 0 0 #000000;<br />
-moz-box-shadow: 0 0 0 #000000;</p></blockquote>
<p>Once again an example:</p>
<blockquote><p>.shadow {</p>
<p>-webkit-box-shadow: 0 1px 5px #333;<br />
-moz-box-shadow: 0 1px 5px #333;</p>
<p>}</p></blockquote>
<p>The HTML:</p>
<blockquote><p>&lt;div class=&#8221;shadow&#8221;&gt;&lt;h1&gt;Hello Shadow&lt;/h1&gt;&lt;/div&gt;</p></blockquote>
<img src="http://codewithdesign.com/?ak_action=api_record_view&id=229&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://codewithdesign.com/2010/05/05/remove-images-and-increase-load-times-with-css3/' rel='bookmark' title='Remove images and increase load times with CSS3'>Remove images and increase load times with CSS3</a></li>
<li><a href='http://codewithdesign.com/2009/12/30/creating-a-top-button/' rel='bookmark' title='Creating a top button'>Creating a top button</a></li>
<li><a href='http://codewithdesign.com/2009/12/27/modifying-next-and-previous-posts/' rel='bookmark' title='Modifying next and previous posts'>Modifying next and previous posts</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://codewithdesign.com/2009/12/22/making-it-that-much-better-with-css3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easyworks a new PHP front end framework</title>
		<link>http://codewithdesign.com/2009/12/22/easyworks-a-new-php-front-end-framework/</link>
		<comments>http://codewithdesign.com/2009/12/22/easyworks-a-new-php-front-end-framework/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 17:01:23 +0000</pubDate>
		<dc:creator>Caleb Jonasson</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[easyworks]]></category>
		<category><![CDATA[Framework]]></category>

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

		<guid isPermaLink="false">http://codewithdesign.com/?p=221</guid>
		<description><![CDATA[Recently while working on a new blog layout for Code With Design I found myself finding that the code blocks look far to dull. My way of fixing this was to add an image but it didn't end up helping anything, the image just looked repetitive and thus it is time to find some change and include a random image setup for each block.

Wordpress uses a while loop to display the post information. I plan on taking advantage of this by adding a style to each of the div blocks. This will force the function to load for each div block and thus making the background images random for each individual block.
Related posts:<ol>
<li><a href='http://codewithdesign.com/2010/09/24/check-email-function-php/' rel='bookmark' title='Check Email Function PHP'>Check Email Function PHP</a></li>
<li><a href='http://codewithdesign.com/2009/09/29/the-beginners-guide-to-php/' rel='bookmark' title='The Beginners Guide to PHP'>The Beginners Guide to PHP</a></li>
<li><a href='http://codewithdesign.com/2009/12/22/easyworks-a-new-php-front-end-framework/' rel='bookmark' title='Easyworks a new PHP front end framework'>Easyworks a new PHP front end framework</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="Random Images Using A PHP Function: cj_random_image" data-via="" data-url="http://codewithdesign.com/2009/12/20/random-images-using-a-php-function-cj_random_image/" en>Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="tall" href="http://codewithdesign.com/2009/12/20/random-images-using-a-php-function-cj_random_image/"></g:plusone></div><p>Recently while working on a new blog layout for Code With Design I found myself finding that the code blocks look far to dull. My way of fixing this was to add an image but it didn&#8217;t end up helping anything, the image just looked repetitive and thus it is time to find some change and include a random image setup for each block.</p>
<p>WordPress uses a while loop to display the post information. I plan on taking advantage of this by adding a style to each of the div blocks. This will force the function to load for each div block and thus making the background images random for each individual block.</p>
<p>If the image was entered into the css then each block would look the same:</p>
<blockquote><p>Function loads -&gt; CSS is put into the style sheet -&gt; style sheet loads into each element.</p></blockquote>
<p>If the image was loaded on each div individually then the process will look something like this:</p>
<blockquote><p>Function loads inside of div tag -&gt; CSS is put into the looping div -&gt; On each run the Function runs its random -&gt; The random is placed out on each div.</p></blockquote>
<p>The function loads a list of URL paths separated by comas. Then you are given the option of using placement properties and two of them so bottom right or top left is aloud. The final variable that this function uses is the repeat. This allows you to repeat the image by x, y, repeat or no-repeat.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">//'/images/br_corner_cloud.png,/images/tr_corner_cloud.png','bottom','right','no-repeat'</span>
<span style="color: #666666; font-style: italic;">//creating a function</span>
<span style="color: #000000; font-weight: bold;">function</span> cj_random_image<span style="color: #009900;">&#40;</span><span style="color: #000088;">$image_array</span><span style="color: #339933;">,</span> <span style="color: #000088;">$prop1</span><span style="color: #339933;">,</span> <span style="color: #000088;">$prop2</span><span style="color: #339933;">,</span> <span style="color: #000088;">$repeat</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">//image arrays</span>
<span style="color: #000088;">$image_array</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;,&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$image_array</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$image_max</span> <span style="color: #339933;">=</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$image_array</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//random image count based on user input</span>
<span style="color: #000088;">$image_rando</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mt_rand</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #000088;">$image_max</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//image</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'url('</span><span style="color: #339933;">.</span><span style="color: #000088;">$image_array</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$image_rando</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">')'</span><span style="color: #339933;">.</span><span style="color: #000088;">$prop1</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">.</span><span style="color: #000088;">$prop2</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">.</span><span style="color: #000088;">$repeat</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">//created by calebj</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>The first thing the function does is takes what the user has placed into it then outputs it. The main inputs are the URL paths. These paths are counted and the count is used as the maximum on the random. This forces the mt_rand function to return the proper value which means that you can enter any amount of image URLs and the function will still work out.</p>
<p>In order to use this effectively you will need to place the function like so:</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;">&lt;div style=&quot;background: #f2f2f2<span style="color: #000000; font-weight: bold;">&lt;?php</span> cj_random_image<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'images/br_corner_cloud.png,images/cloud1.png'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'bottom'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'right'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'no-repeat'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> &quot;&gt;
&nbsp;
&lt;/div&gt;</pre></td></tr></table></div>

<p><a href="http://codewithdesign.com/pages/sample_sites/blog_test/random_image_placement_php/random_images_using_php.php">If you would like to see this code working in action please click here.</a> Keep in mind that you need to refresh the page to see the random clouds show up.</p>
<img src="http://codewithdesign.com/?ak_action=api_record_view&id=221&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://codewithdesign.com/2010/09/24/check-email-function-php/' rel='bookmark' title='Check Email Function PHP'>Check Email Function PHP</a></li>
<li><a href='http://codewithdesign.com/2009/09/29/the-beginners-guide-to-php/' rel='bookmark' title='The Beginners Guide to PHP'>The Beginners Guide to PHP</a></li>
<li><a href='http://codewithdesign.com/2009/12/22/easyworks-a-new-php-front-end-framework/' rel='bookmark' title='Easyworks a new PHP front end framework'>Easyworks a new PHP front end framework</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://codewithdesign.com/2009/12/20/random-images-using-a-php-function-cj_random_image/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS3 Drop shadow on text</title>
		<link>http://codewithdesign.com/2009/12/16/css3-drop-shadow-on-text/</link>
		<comments>http://codewithdesign.com/2009/12/16/css3-drop-shadow-on-text/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 20:23:31 +0000</pubDate>
		<dc:creator>Caleb Jonasson</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[drop shadow]]></category>
		<category><![CDATA[text-shadow]]></category>

		<guid isPermaLink="false">http://codewithdesign.com/?p=206</guid>
		<description><![CDATA[Adding drop shadows is now possible with CSS3 but is it worth it? There are only a few web browsers that currently support a css styled drop shadow are Firefox, Opera and Safari. (Don't expect the old IE versions to work with this because they don't work with anything.) This means that the page may look better off without using dom style text and going with an image.
Related posts:<ol>
<li><a href='http://codewithdesign.com/2010/05/05/remove-images-and-increase-load-times-with-css3/' rel='bookmark' title='Remove images and increase load times with CSS3'>Remove images and increase load times with CSS3</a></li>
<li><a href='http://codewithdesign.com/2009/12/22/making-it-that-much-better-with-css3/' rel='bookmark' title='Making it that much better with CSS3'>Making it that much better with CSS3</a></li>
</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="CSS3 Drop shadow on text" data-via="" data-url="http://codewithdesign.com/2009/12/16/css3-drop-shadow-on-text/" en>Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="tall" href="http://codewithdesign.com/2009/12/16/css3-drop-shadow-on-text/"></g:plusone></div><style>
.textdrop {
font: 80px Verdana, Arial, Helvetica, sans-serif;
text-shadow: 2px 2px 3px #666666;
}
</style>
<p>Adding drop shadows is now possible with CSS3 but is it worth it? There are only a few web browsers that currently support a css styled drop shadow are Firefox, Opera and Safari. (Don&#8217;t expect the old IE versions to work with this because they don&#8217;t work with anything.) This means that the page may look better off without using dom style text and going with an image.</p>
<p>The code is simple and looks like this:</p>
<blockquote><p>text-shadow: 2px 2px 3px #666666;</p></blockquote>
<p>Yes, this is all that is required to add a drop shadow but it may not be worth it depending on what browser the user is currently on. For the following example I used this bit of code.</p>
<blockquote><p>&lt;style&gt;<br />
.textdrop {<br />
font: 80px Verdana, Arial, Helvetica, sans-serif;<br />
text-shadow: 2px 2px 3px #666666;<br />
}<br />
&#8211;&gt;<br />
&lt;/style&gt;</p>
<p>&lt;div class=&#8221;textdrop&#8221;&gt;This is a test&lt;/div&gt;</p></blockquote>
<div class="textdrop">This is a text drop.</div>
<p>If you are unable to view the above text in your browser I have included a print screen of what it looks like in Firefox.<br />
<a href="http://codewithdesign.com/pages/sample_sites/blog_test/textdrop.jpg" rel="lightbox[206]"><img class="alignnone" src="http://codewithdesign.com/pages/sample_sites/blog_test/textdrop.jpg" alt="" width="576" height="102" /></a><br />
<a href="http://codewithdesign.com/pages/sample_sites/blog_test/cssdrop-txt-shadow.php">The text is slightly different because it has been placed in a blog with a different css style on it. To see the drops shadow as it truly is you can use the image or click here to see it in action.</a></p>
<img src="http://codewithdesign.com/?ak_action=api_record_view&id=206&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://codewithdesign.com/2010/05/05/remove-images-and-increase-load-times-with-css3/' rel='bookmark' title='Remove images and increase load times with CSS3'>Remove images and increase load times with CSS3</a></li>
<li><a href='http://codewithdesign.com/2009/12/22/making-it-that-much-better-with-css3/' rel='bookmark' title='Making it that much better with CSS3'>Making it that much better with CSS3</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://codewithdesign.com/2009/12/16/css3-drop-shadow-on-text/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a fixed header and Footer</title>
		<link>http://codewithdesign.com/2009/11/20/creating-a-fixed-header-and-footer/</link>
		<comments>http://codewithdesign.com/2009/11/20/creating-a-fixed-header-and-footer/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 21:39:30 +0000</pubDate>
		<dc:creator>Caleb Jonasson</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[fixed]]></category>
		<category><![CDATA[footer]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[position]]></category>

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

		<guid isPermaLink="false">http://codewithdesign.com/?p=151</guid>
		<description><![CDATA[A few months ago I posted an old project on the old blog. The project was entitled “Browser Friendly Feed Reader.” This project consisted of three simple pages. The first was the submitting form where users could enter their rss or xml feed. The contents of this feed could be output in the web browser to displaying it inside of the site framework that was created.
Related posts:<ol>
<li><a href='http://codewithdesign.com/2010/03/26/going-through-website-creation-part-2-backend/' rel='bookmark' title='Going through website creation part 2: Backend'>Going through website creation part 2: Backend</a></li>
<li><a href='http://codewithdesign.com/2010/05/18/recycle-pages-by-splitting-your-website-into-pieces-with-php/' rel='bookmark' title='Recycle pages by splitting your website into pieces with PHP'>Recycle pages by splitting your website into pieces with PHP</a></li>
<li><a href='http://codewithdesign.com/2009/09/29/the-beginners-guide-to-php/' rel='bookmark' title='The Beginners Guide to PHP'>The Beginners Guide to PHP</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div style = 'float:left; margin-right:5px;'>            <a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-text="Going Through Website Creation Part 1: Layout" data-via="" data-url="http://codewithdesign.com/2009/11/13/going-through-website-creation-part-1-layout/" en>Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="tall" href="http://codewithdesign.com/2009/11/13/going-through-website-creation-part-1-layout/"></g:plusone></div><h2>Starting Up An Old Project</h2>
<div id="content_div-141">
<p>A few months ago I posted an old project on the old blog. The project was entitled “<a href="http://rss.skorg.org/">Browser Friendly Feed Reader.</a>” This project consisted of three simple pages. The first was the submitting form where users could enter their rss or xml feed. The contents of this feed could be output in the web browser to displaying it inside of the site framework that was created.</p>
<p><a rel="lightbox[141]" href="../wp-content/uploads/2009/11/rss_skorg_atchison.jpg"><img title="rss_skorg_atchison" src="../wp-content/uploads/2009/11/rss_skorg_atchison.jpg" alt="rss_skorg_atchison" width="490" height="453" /></a></p>
<p><strong>Process.php<br />
Forum.php<br />
View.php</strong></p>
<p>The site was very simple but it was more built for the idea behind viewing a feed in the browser. Since then I wanted to create a more advanced version of the site that relied on a database and the ability to subscribe to the feeds. This is when I decided to restart to the old project and completely rework how everything is set from the ground up.</p>
<h2>Working With The Framework</h2>
<h2><a href="http://codewithdesign.com/wp-content/uploads/2009/11/framework.jpg" rel="lightbox[151]"><img class="alignnone size-full wp-image-152" title="framework" src="http://codewithdesign.com/wp-content/uploads/2009/11/framework.jpg" alt="framework" width="540" height="524" /></a></h2>
<p>When starting to create a new project or just recreating one the first thing that you will need is a frame work. The frame work is a quick drawing of how you would like to have everything setup. Some people like to create theirs with programs such as In Design or Illustrator but I prefer to use a graphing set, a notepad and whatever pen is closest to me. I should be using pencil but I normally have a plan in my head prior to starting something.</p>
<p><a rel="lightbox[141]" href="../wp-content/uploads/2009/11/dreamweaver_create_a_page.jpg"><img title="dreamweaver_create_a_page" src="../wp-content/uploads/2009/11/dreamweaver_create_a_page.jpg" alt="dreamweaver_create_a_page" width="582" height="460" /></a></p>
<p>Once you have the general idea of how things are going to work it is a good idea to draw out how you would like to store the key components of a site. I use a notepad throughout the whole process and it usually starts with me laying out something that looks like this.</p>
<h2>Contents of index</h2>
<p><strong>Header</strong> (include not secure page)<br />
Main image<br />
Nav bar (include)<br />
<strong> </strong></p>
<p><strong>Sidebar</strong> (include)<br />
Sidebar components (include single and double width items)<br />
Navigation (include)</p>
<p><strong>Main content</strong> (not included)<br />
Post data</p>
<p><strong>Footer</strong> (include)<br />
Blocks of meta and links (include)<br />
Bottom strip (include)</p>
<h2>Order of Operations When Designing the Index</h2>
<p>Once this has been worked up I then head into Adobe Dreamweaver to begin the process of changing my framework into an actual css ready site with all of the divs. This process takes a fair amount of time and the content usually created in this order. First note that Dreamweaver automatically creates the untitled.php page and the css page. At this point I only have the two items on my testing server. Back to showing you the order of operations.</p>
<ol>
<li>Change the CSS page to create the proper widths for main content, sidebar, and post.</li>
<li>Change padding properties, select fonts, change margin properties.</li>
<li>Create the divs within the untitled document ie the divs in the header that hold link menus.</li>
<li> Add the div id and classes to the CSS file. (remember to work down the content as it appears within your page. Start with the header then go to sidebar, etc.)</li>
<li>Create and fill the pages with fake content and see if this is how you would like the pages to be displayed.</li>
<li>Go through and tweak anything that makes you unhappy.</li>
</ol>
<h2>Pulling Apart the Index.php Page</h2>
<p>Now that you have created your base index page and you are somewhat happy with the content you can go ahead and begin to pull the page apart. This is where the layout of includes will come in handy. This process consists of cutting and pasting section of code into new php files. The naming of these files is up to you but I normally go with “pt_” as a prefix for “Part” which is a part of a page and “pg_” which stands for “Page” meaning that it is a whole page. An example of this is “pg_authors.php” or pg_feeds_addfeed.php” The next section of naming a page comes from the actual section that is within the page. On the friendly browser feed viewer project I started there are sections of pages that relate to feeds. If I wanted to create a page where users could subscribe to a feed I would name it “pg_feed_subscribe” this tells me what the php file is, its subject and what the page is for. Another type of file I often contain is the prefix “process_” This is a page that requires a form to post to or backend piece of date. The page naming is completely up to you I just wanted to share how I go about naming my webpages.</p>
<p>Now we will go through pulling the pages apart. Now that we have gone through a little lesson on proper page names it is now time to actually pull something apart. For this I will not be using the <a href="http://rss.skorg.org/">rss.skorg.org</a> site but a new site with no content instead.</p>
<p><strong>Here is the full index.php page that we will be working with.</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;Test&lt;/title&gt;
&lt;link href=&quot;style.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
&lt;!--[if IE 5]&gt;
&lt;style type=&quot;text/css&quot;&gt;
/* place css box model fixes for IE 5* in this conditional comment */
.twoColFixRtHdr #sidebar1 { width: 220px; }
&lt;/style&gt;
&lt;![endif]--&gt;&lt;!--[if IE]&gt;
&lt;style type=&quot;text/css&quot;&gt;
/* place css fixes for all versions of IE in this conditional comment */
.twoColFixRtHdr #sidebar1 { padding-top: 30px; }
.twoColFixRtHdr #mainContent { zoom: 1; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
&lt;/style&gt;
&lt;![endif]--&gt;&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;container&quot;&gt;
&lt;div id=&quot;header&quot;&gt;
&lt;h1&gt;Header&lt;/h1&gt;
&lt;!-- end #header --&gt;&lt;/div&gt;
&lt;div id=&quot;sidebar1&quot;&gt;
&lt;h3&gt;Sidebar1 Content&lt;/h3&gt;
&lt;p&gt;The background color on this div will only show for the length of the content. If you'd like a dividing line instead, place a border on the right side of the #mainContent div if it will always contain more content. &lt;/p&gt;
&lt;p&gt;Donec eu mi sed turpis feugiat feugiat. Integer turpis arcu, pellentesque  eget, cursus et, fermentum ut, sapien. Fusce metus mi, eleifend  sollicitudin, molestie id, varius et, nibh. Donec nec libero.&lt;/p&gt;
&lt;!-- end #sidebar1 --&gt;&lt;/div&gt;
&lt;div id=&quot;mainContent&quot;&gt;
&lt;h1&gt; Main Content &lt;/h1&gt;
&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam,  justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam  ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo  porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis  ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean  sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at,  odio. Donec et ipsum et sapien vehicula nonummy. Suspendisse potenti. Fusce  varius urna id quam. Sed neque mi, varius eget, tincidunt nec, suscipit id,  libero. In eget purus. Vestibulum ut nisl. Donec eu mi sed turpis feugiat  feugiat. Integer turpis arcu, pellentesque eget, cursus et, fermentum ut,  sapien. Fusce metus mi, eleifend sollicitudin, molestie id, varius et, nibh.  Donec nec libero.&lt;/p&gt;
&lt;h2&gt;H2 level heading &lt;/h2&gt;
&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam,  justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam  ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo  porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis  ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean  sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio.&lt;/p&gt;
&lt;!-- end #mainContent --&gt;&lt;/div&gt;
&lt;!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --&gt;&lt;br /&gt;
&lt;div id=&quot;footer&quot;&gt;
&lt;p&gt;Footer&lt;/p&gt;
&lt;!-- end #footer --&gt;&lt;/div&gt;
&lt;!-- end #container --&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></td></tr></table></div>

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

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

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

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

<p>Inside the two sections is where you want the head data that will change for each page. The following code is what pt_head_main.php consists of.</p>

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

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

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

<p>Now you should be able to create a site that is fully based off of your index. If you need to change things around like the css link based on different pages there is always PHP code for things like that.</p>
<p><a href="http://codewithdesign.com/2010/03/26/going-through-website-creation-part-2-backend/">Continue on to read part 2</a></p>
<p>By: Caleb Jonasson</p>
</div>
<img src="http://codewithdesign.com/?ak_action=api_record_view&id=151&type=feed" alt="" /><p>Related posts:<ol>
<li><a href='http://codewithdesign.com/2010/03/26/going-through-website-creation-part-2-backend/' rel='bookmark' title='Going through website creation part 2: Backend'>Going through website creation part 2: Backend</a></li>
<li><a href='http://codewithdesign.com/2010/05/18/recycle-pages-by-splitting-your-website-into-pieces-with-php/' rel='bookmark' title='Recycle pages by splitting your website into pieces with PHP'>Recycle pages by splitting your website into pieces with PHP</a></li>
<li><a href='http://codewithdesign.com/2009/09/29/the-beginners-guide-to-php/' rel='bookmark' title='The Beginners Guide to PHP'>The Beginners Guide to PHP</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://codewithdesign.com/2009/11/13/going-through-website-creation-part-1-layout/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

