<?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>BreeRadloff.com &#187; Code</title>
	<atom:link href="http://www.breeradloff.com/category/articles/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.breeradloff.com</link>
	<description>Interactive &#38; UX Design</description>
	<lastBuildDate>Thu, 06 May 2010 03:53:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Stylesheets For Printing</title>
		<link>http://www.breeradloff.com/2009/03/stylesheets-for-printing/</link>
		<comments>http://www.breeradloff.com/2009/03/stylesheets-for-printing/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 13:19:41 +0000</pubDate>
		<dc:creator>Bree</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[print]]></category>
		<category><![CDATA[printing]]></category>
		<category><![CDATA[stylesheet]]></category>
		<category><![CDATA[stylesheets]]></category>

		<guid isPermaLink="false">http://www.breeradloff.com/?p=26</guid>
		<description><![CDATA[Using a special stylesheet to help with your printable content can save you a ton of headache.  You may have read that tailoring your content to print properly is a lot of work or can be a frustrating experience, setting you at odds with printers and clients alike.  When executed properly, it&#8217;s a [...]]]></description>
			<content:encoded><![CDATA[<p>Using a special stylesheet to help with your printable content can save you a ton of headache.  You may have read that tailoring your content to print properly is a lot of work or can be a frustrating experience, setting you at odds with printers and clients alike.  When executed properly, it&#8217;s a very simple process that requires only one file (print.css) and yields a few tangible benefits.</p>
<p><span id="more-26"></span></p>
<h3>Quantify What Needs To Be Print Friendly</h3>
<p>Have you ever experienced the sublime joy of a boss or client who suddenly realized that a page or portion of your site doesn&#8217;t print well?  You might be asked to make pages printable as-is, rather than via some print-friendly intermediary.  Even worse, you might be asked to make traditionally unprintable content print correctly; home pages, flash content, animations or even application interfaces.  Explaining the vagaries of printable backgrounds and margin-friendly markup is a complete waste of time. They don&#8217;t care about the details, they just want it how they want it.  Your frustrations rise as you try to complete an awkward task for an increasingly disappointed client.</p>
<p>Before we get into the details of those gnarly and undesirable tasks, let&#8217;s take a lesson from my Sabumnim and try to avoid these perils completely.  What was the first error in the hypothetical situation above?  Was it coding the site improperly or not using a certain methodology?  Nope.  Was it not knowing what the client would ask for until it was too late?  Again, no.  The problem was that the client&#8217;s expectations (in regards to printable content0) were not managed early on, leaving them opportunity to invent potentially difficult goals imposed at unfortuitous times.</p>
<p>Do yourself a favor; review all the content of a site you&#8217;re building and make note of what looks like a good candidate for being properly printable.  Discuss that with other project members such as the project manager and the project stakeholders (the people with veto power).  By defining your set of print pages you have:</p>
<ul>
<li>Quantified this task into a finite, deliverable goal</li>
<li>Sold it as a feature to project stakeholders</li>
<li>Exempted irrelevant and potentially problematic content from the scope of the task.</li>
</ul>
<p>Typically you should plan to provide print-friendly versions of most legalese pages, informative articles, help content &amp; FAQ&#8217;s, product listings and detail sheets, as well as directions a user might need to complete a task.  Often times you can exempt several types of pages from the print-friendly objective: most home pages, application interfaces, animated pages &amp; images, advertising content and data entry forms.</p>
<h3>The basics of a print media CSS</h3>
<ul>
<li>Change the page&#8217;s colors to black and white; colors and median shades of gray might not print well.</li>
<li>Use a font with serifs, it&#8217;s easier to read in print.</li>
<li>Left-align your text and columns.</li>
<li>Choose a font size that is easy on the eyes and affords paragraphs of a desirable length.</li>
<li>Underline all links so the reader can still identify them.</li>
<li>Remove non-essential images, especially advertising.</li>
<li>Remove the navigation and site-frame images, as they are prone to lose context.</li>
<li>Remove all JavaScript, Flash, and animated images.</li>
<li>Formally cite references and contributors.</li>
</ul>
<p>I&#8217;ve created an example print stylesheet that does what I&#8217;ve described above.  You may use it as a starting point when designing your own.  It&#8217;s full of notes, feel free to delete those as you see fit.</p>
<h3>How to invoke your print-friendly stylesheet</h3>
<p>In the HEAD of your document, you&#8217;ll add in the print CSS file just like you would a normal one, with a few tweaks.</p>
<pre>&lt;LINK rel="stylesheet" type"text/css" href="print.css" media="print"&gt;</pre>
<p>You&#8217;ll notice that the media is specified as print, and that&#8217;s the important part.  That instructs your browser to apply the styles within only when the page is printed.  The other media type that applies when printing is &#8220;all&#8221; &#8230; you can <a title="Google Search: CSS Media Type" href="http://www.google.com/search?hl=en&amp;q=css+media+type&amp;btnG=Search" target="_blank">read more about the various media types</a> if you like, but that&#8217;s out of this article&#8217;s scope.</p>
<p>So that&#8217;s it, you define a second (smaller) set of CSS rules to handle printable content, link the stylesheet only in the pages which users may need to print, and bam &#8211; your browser does the rest.  You don&#8217;t have to maintain a second site template, it only requires one extra file and your boss is happy.</p>
<p>Yay!</p>
<p>Reference materials:</p>
<ul>
<li><a href="http://www.netmechanic.com/news/vol4/design_no8.htm" target="_blank">http://www.netmechanic.com/news/vol4/design_no8.htm</a></li>
<li><a href="http://www.maratz.com/blog/archives/2004/09/21/10-minutes-to-printer-friendly-page/" target="_blank">http://www.maratz.com/blog/archives/2004/09/21/10-minutes-to-printer-friendly-page/</a></li>
<li><a href="http://www.alistapart.com/articles/goingtoprint/" target="_blank">http://www.alistapart.com/articles/goingtoprint/</a></li>
<li><a href="http://meyerweb.com/eric/articles/webrev/200001.html" target="_blank">http://meyerweb.com/eric/articles/webrev/200001.html</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.breeradloff.com/2009/03/stylesheets-for-printing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using a CSS Reset</title>
		<link>http://www.breeradloff.com/2009/01/using-a-css-reset/</link>
		<comments>http://www.breeradloff.com/2009/01/using-a-css-reset/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 20:18:20 +0000</pubDate>
		<dc:creator>Bree</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[cross-browser]]></category>
		<category><![CDATA[css reset]]></category>
		<category><![CDATA[eric meyer]]></category>

		<guid isPermaLink="false">http://www.breeradloff.com/?p=3</guid>
		<description><![CDATA[Use a CSS reset to avoid common rendering issues.]]></description>
			<content:encoded><![CDATA[<p>A CSS reset is a set of CSS rules you use as a starting point in order to preemptively quell bugs that may arise due to the Browser Wars. A CSS reset does this by applying consistent values to elements that browsers typically render differently by default (such as margin, padding and font-inheritance). Below is a reset you can use, originally written by <a title="CSS Reloaded by Eric Meyer" href="http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/" target="_blank">Eric Meyer</a>.</p>
<p><span id="more-3"></span></p>
<p><img title="More..." src="http://www.bay70.com/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" /></p>
<pre>html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
	margin: 0;
	padding: 0;
	border: 0;
	outline: 0;
	font-weight: inherit;
	font-style: inherit;
	font-size: 100%;
	font-family: inherit;
	vertical-align: top;
}
/* remember to define focus styles! */
:focus {
	outline: 0;
}
body {
	line-height: 1;
	color: black;
	background: white;
}
ol, ul {
	list-style: none;
}
/* tables still need 'cellspacing="0"' in the markup */
table {
	border-collapse: separate;
	border-spacing: 0;
}
caption, th, td {
	text-align: left;
	font-weight: normal;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: "";
}
blockquote, q {
	quotes: "" "";
}</pre>
<p>The only thing I&#8217;ve really changed here is that I&#8217;ve set a default vertical-align to &#8220;top&#8221; rather than baseline.  I&#8217;ve found it requires less work and provides more expected behavior &#8211; but hey, what do I know?  Mod this however you see fit.  Incidentally, if you are a fan of the <a title="The Yahoo! User Interface Library (YUI)" href="http://developer.yahoo.com/yui/" target="_blank">YUI</a> way to do things, then you can <a href="http://developer.yahoo.com/yui/3/cssreset/" target="_blank">grab their CSS reset</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.breeradloff.com/2009/01/using-a-css-reset/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DOCTYPE Explained</title>
		<link>http://www.breeradloff.com/2009/01/doctype-explained/</link>
		<comments>http://www.breeradloff.com/2009/01/doctype-explained/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 13:59:55 +0000</pubDate>
		<dc:creator>Bree</dc:creator>
				<category><![CDATA[XHTML & HTML5]]></category>
		<category><![CDATA[DOCTYPE]]></category>

		<guid isPermaLink="false">http://www.breeradloff.com/?p=56</guid>
		<description><![CDATA[What is DOCTYPE and why do I care?
The DOCTYPE declaration is the first line of code in any web document. It tells  the browser what type of markup you wrote. Declaring one but coding for another may result in errors or inconsistencies across the spectrum of browsers. I&#8217;ve offered a few downloads that you [...]]]></description>
			<content:encoded><![CDATA[<h3>What is DOCTYPE and why do I care?</h3>
<p>The DOCTYPE declaration is the first line of code in any web document. It tells  the browser what type of markup you wrote. <span id="more-56"></span>Declaring one but coding for another may result in errors or inconsistencies across the spectrum of browsers. I&#8217;ve offered a few downloads that you can set as blank starting documents, automating a few lines of code that you&#8217;ll potentially type hundreds of thousands of times.</p>
<h3>What Are The Different DOCTYPEs?</h3>
<ul>
<li><strong>Strict</strong>: Does not contain any presentation code such as the  &lt;FONT&gt; tag &#8211; it is purely <em>structural</em>.</li>
<li><strong>Transitional</strong>: Allows presentation code, but does not  contain frame-related markup.</li>
<li><strong>Frameset</strong>: Allows presentation code and contains  frame-related markup.</li>
</ul>
<h3>How Do I Choose What DOCTYPE to Declare?</h3>
<ul>
<li><strong>Strict</strong>: You are an <em>adept</em> web geek, perhaps a seasoned veteran of the Browser Wars; your markup is lean and your CSS is tight. You might be thinking ahead to accessibility or dynamic layouts.</li>
<li><strong>Transitional</strong>: You are unsure what to choose; you think you  might commit a <em>faux pas</em> and include presentation code in your markup.  You might be supporting older code (the horror!).</li>
<li><strong>Frameset</strong>: For when you <em>cannot avoid</em> using frames.  In this mode the FRAMESET replaces the BODY element.</li>
</ul>
<h3>What Do They Look Like?</h3>
<p>The very first line in any of your pages should be one of the following:</p>
<p class="codeExample">&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Strict//EN&#8221;<br />
&#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&#8221;&gt;</p>
<p class="codeExample">&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&#8221;<br />
&#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221;&gt;</p>
<p class="codeExample">&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Frameset//EN&#8221;<br />
&#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd&#8221;&gt;</p>
<h3>Validating Your Page</h3>
<p>The first step in eliminating rendering errors and cross browser battles is to ensure that your document is valid code (of the specified DOCTYPE). Paste your code or URL into the <a title="W3C Markup Validation Service" href="http://validator.w3.org/" target="_blank">W3C validation  service</a> and go from there.</p>
<h3>Downloads</h3>
<p>Most HTML editors and development environments will allow you to specify the blank starting documents that are used as templates when you create a new file. Download these three HTML pages and set them up in your editor to be sure your DOCTYPE is declared correctly every time without manually typing it.</p>
<p><a title="XHTML Starters (zip)" href="http://www.bay70.com/files/code/XHTMLstarters.zip">XHTML Starters</a></p>
<h3>More Reading About the DOCTYPE:</h3>
<p>Believe it or not, it&#8217;s possible to geek out on the DOCTYPE even more. Explore the links below to learn about such highly <em>exotic nuances</em> such as DOCTYPE switching, other DOCTYPE declarations and more.</p>
<ul>
<li><a title="Recommended DTD's" href="http://www.w3.org/QA/2002/04/valid-dtd-list.html" target="_blank">Recommended DTD&#8217;s</a> @ W3C</li>
<li><a title="Fix Your Site With The Right DOCTYPE!" href="http://www.alistapart.com/articles/doctype/" target="_blank">Fix Your Site With the Right DOCTYPE!</a> @ A List Apart</li>
<li><a title="Beyond DOCTYPE" href="http://www.alistapart.com/articles/beyonddoctype" target="_blank">Beyond DOCTYPE:</a> Web Standards, Forward Compatibility &amp; IE8</li>
<li><a title="The HTML DOCTYPE Tag" href="http://www.w3schools.com/tags/tag_DOCTYPE.asp" target="_blank">The HTML DOCTYPE Tag</a> @ W3Schools</li>
<li><a title="DOCTYPE Explained" href="http://www.oreillynet.com/pub/a/javascript/synd/2001/08/28/doctype.html" target="_blank">DOCTYPE Explained</a> @ The O&#8217;Reilly Web DevCenter</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.breeradloff.com/2009/01/doctype-explained/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Random Quote PHP Script</title>
		<link>http://www.breeradloff.com/2009/01/random-quote-php-script/</link>
		<comments>http://www.breeradloff.com/2009/01/random-quote-php-script/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 13:51:46 +0000</pubDate>
		<dc:creator>Bree</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[random quote]]></category>
		<category><![CDATA[random text]]></category>

		<guid isPermaLink="false">http://www.breeradloff.com/?p=48</guid>
		<description><![CDATA[The script below displays a random string of text each time your page is loaded or refreshed. It is not the most fancy or flexible &#8211; but it is extremely simple and easy. This could prove useful if you are doing something with limited scope.

&#60;?php

function randomQuote() {

	$quotes[] = '"Quote goes here"';
	$quotes[] = '"Quote goes here"';
	$quotes[] [...]]]></description>
			<content:encoded><![CDATA[<p>The script below displays a random string of text each time your page is loaded or refreshed. It is not the most fancy or flexible &#8211; but it is extremely simple and easy. This could prove useful if you are doing something with limited scope.</p>
<p><span id="more-48"></span></p>
<pre>&lt;?php

function randomQuote() {

	$quotes[] = '"Quote goes here"';
	$quotes[] = '"Quote goes here"';
	$quotes[] = '"Quote goes here"';
	$quotes[] = '"Quote goes here"';

	srand ((double) microtime() * 1000000);
	$random_number = rand(0,count($quotes)-1);

	echo '&lt;p&gt;' . ($quotes[$random_number]) . '&lt;/p&gt;';
}
?&gt;</pre>
<p>Add as many quotes as you like, and you can add HTML and CSS between the quotes. For example, I wanted to provide a link (the author&#8217;s name) to more information about the quote or author.</p>
<pre>$quotes[] = '"The Quote"&lt;br /&gt;&amp;mdash; &lt;a href="URL"&gt;Author&lt;/a&gt;';</pre>
<p>To use this script on your site, include the file in your html document:</p>
<pre>&lt;?php include ("includes/quotes.php"); ?&gt;</pre>
<p>Then call the randomQuote function in the spot you want the quotes:</p>
<pre>&lt;?php randomQuote();?&gt;</pre>
<p>You can <a title="Random Quotes PHP Script . ZIP" href="http://www.bay70.com/files/code/php/randomQuotes.zip">download a zip file of this demo</a> if you prefer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.breeradloff.com/2009/01/random-quote-php-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Test Your Server&#8217;s PHP Mail</title>
		<link>http://www.breeradloff.com/2009/01/test-your-servers-php-mail/</link>
		<comments>http://www.breeradloff.com/2009/01/test-your-servers-php-mail/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 13:50:34 +0000</pubDate>
		<dc:creator>Bree</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.breeradloff.com/?p=46</guid>
		<description><![CDATA[Is your server&#8217;s PHP mail function enabled or disabled? Test it with this quick script. If you get an email, it works!

&#60;?php
     mail("username@domain.com", "Test Subject", "Test Message Body");
?&#62;
]]></description>
			<content:encoded><![CDATA[<p>Is your server&#8217;s PHP mail function enabled or disabled? Test it with this quick script. If you get an email, it works!</p>
<p><span id="more-46"></span></p>
<pre>&lt;?php
     mail("username@domain.com", "Test Subject", "Test Message Body");
?&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.breeradloff.com/2009/01/test-your-servers-php-mail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Let Google Serve Your jQuery</title>
		<link>http://www.breeradloff.com/2009/01/let-google-serve-your-jquery/</link>
		<comments>http://www.breeradloff.com/2009/01/let-google-serve-your-jquery/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 13:25:17 +0000</pubDate>
		<dc:creator>Bree</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.breeradloff.com/?p=37</guid>
		<description><![CDATA[Whether you have moved to jQuery or are using prototype.js, you can include your JS library directly from Google&#8217;s code library.
Getting your library from google gives you an awesome perk: There&#8217;s a good chance that users visiting your site have it cached because they&#8217;ve previously visited Google (or another site getting the code from google). [...]]]></description>
			<content:encoded><![CDATA[<p>Whether you have moved to jQuery or are using prototype.js, you can include your JS library directly from Google&#8217;s code library.</p>
<p>Getting your library from google gives you an awesome perk: There&#8217;s a good chance that users visiting your site have it cached because they&#8217;ve previously visited Google (or another site getting the code from google). This essentially makes it a freebie. Genius!</p>
<p>If you&#8217;re a big-shot you professional, you&#8217;ll probably want to use the extra-flexible google.load method:</p>
<p>google.load(&#8220;jquery&#8221;, &#8220;1.2.6&#8243;);</p>
<p>If you&#8217;re just interested in doing it simply, here is the path for direct inclusion:</p>
<p>http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js</p>
<p>Read all about it at Google.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.breeradloff.com/2009/01/let-google-serve-your-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
