<?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>TechKnack &#187; design</title>
	<atom:link href="http://techknack.net/category/design/feed/" rel="self" type="application/rss+xml" />
	<link>http://techknack.net</link>
	<description>The rantings of a techie</description>
	<lastBuildDate>Thu, 24 Dec 2009 19:53:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP Templating: Variable Date</title>
		<link>http://techknack.net/php-templating-variable-date/</link>
		<comments>http://techknack.net/php-templating-variable-date/#comments</comments>
		<pubDate>Sun, 29 Mar 2009 01:38:55 +0000</pubDate>
		<dc:creator>eternicode</dc:creator>
				<category><![CDATA[blogs]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://techknack.net/?p=282</guid>
		<description><![CDATA[In building a template system, you may want some way to inject date info using a timestamp (perhaps generated through mktime() ) and date().  But you don&#8217;t want the format to be dependent on the template parser, but rather specified through the variable in the template itself.

$template = preg_replace(
    &#34;#\%date(\:\s*(.*?))?\%#ei&#34;,
  [...]]]></description>
			<content:encoded><![CDATA[<p>In building a template system, you may want some way to inject date info using a timestamp (perhaps generated through mktime() ) and date().  But you don&#8217;t want the format to be dependent on the template parser, but rather specified through the variable in the template itself.</p>
<pre class="brush: php;">
$template = preg_replace(
    &quot;#\%date(\:\s*(.*?))?\%#ei&quot;,
    &quot;date(('\\2'!=\&quot;\&quot;?'\\2':\$date_format), \$timestamp)&quot;,
    $template
);
</pre>
<p>This falls on the &#8220;advanced&#8221; side of intermediate, I would think, so here&#8217;s an explanation:</p>
<p>This is a standard preg_replace($pattern, $replacement, $source_string).  What we want to do is replace the variable %date% in $template with a date string generated from $timestamp.  But %date% is too limiting; within the template, we&#8217;d like to write something like %date: F j, Y% to get a date like &#8220;March 12, 2009,&#8221; or any other format.</p>
<p>The regular expression is like so: <strong>#\%date(\:\s*(.*?))?\%#ei</strong>.  The &#8220;hashes&#8221; (#) here act as delimiters for the regex; the <em>e</em> and <em>i</em> after the second hash turn on &#8220;eval&#8217;d replacement&#8221; and &#8220;case-insensitivty&#8221;, respectively (<a href="http://us.php.net/manual/en/reference.pcre.pattern.modifiers.php">learn more about PCRE regex modifiers at php.net</a>).  So the regex to deal with is <strong>\%date(\:\s*(.*?))?\%</strong>.  The <strong>\%</strong> are the markers for our template variables; <strong>date</strong> is the name of the variable to look for.  <strong>(\:\s*(.*?))?</strong> matches zero or one instances of our &#8220;variable modifier&#8221;: a colon, followed by any amount of whitespace (including none), followed by any number of any characters (where the extra <strong>?</strong> makes the <strong>.*</strong> &#8220;non-greedy&#8221;; it&#8217;ll stop &#8220;eating&#8221; characters when it reaches the next percent sign).  For preg_replace, this will place our date() format in &#8220;\\2&#8243; if it is present; if it is not present, &#8220;\\2&#8243; will not be set.</p>
<p>The replacement is as follows: <strong>&#8220;date((&#8217;\\2&#8242;!=\&#8221;\&#8221;?&#8217;\\2&#8242;:\$date_format), \$timestamp)&#8221;</strong>.  preg_replace will insert the matched date format from the regex into every occurrence of &#8220;\\2&#8243; in the replacement string, and then run eval() on the resulting string to get the replacement value (all thanks to the <em>e</em> modifier in the regex).  Assuming our regex matched &#8220;F j, Y&#8221; as the match, we&#8217;ll get <strong>&#8220;date((&#8217;F j, Y&#8217;!=\&#8221;\&#8221;?&#8217;F j, Y&#8217;:\$date_format), \$timestamp)&#8221;</strong>.  The <strong>(&#8217;F j, Y&#8217;!=\&#8221;\&#8221;?&#8217;F j, Y&#8217;:\$date_format)</strong> part chooses the date format; if the match is not set (ie, an empty string), use whatever is in the variable $date_format; else, if the date format was matched, use it.  This allows us to use %date% in the template, to default to a server-side specified format.</p>
<p>And there it is.  You can now put &#8220;%date: F j, Y%&#8221; in your template, and it will be expanded to &#8220;March 12, 2009&#8243; (depending on the actual date, of course <img src='http://techknack.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ).  That is, if your templating system works in the first place&#8230;</p>
<img src="http://techknack.net/?ak_action=api_record_view&id=282&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://techknack.net/php-templating-variable-date/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Layout</title>
		<link>http://techknack.net/new-layout/</link>
		<comments>http://techknack.net/new-layout/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 06:04:40 +0000</pubDate>
		<dc:creator>eternicode</dc:creator>
				<category><![CDATA[blogs]]></category>
		<category><![CDATA[design]]></category>

		<guid isPermaLink="false">http://techknack.net/?p=180</guid>
		<description><![CDATA[I know, I updated the site design less than a year ago.  I decided I could do better than a fixed-width design built for 800 by 600 resolution displays.
The new layout, also my first WordPress theme (yay), is a bit more flexible.  By default, it is full-browser-width, with reasonable space allotted to the [...]]]></description>
			<content:encoded><![CDATA[<p>I know, I updated the site design <a href="http://techknack.net/time-for-a-redesign/">less than a year ago</a>.  I decided I could do better than a fixed-width design built for 800 by 600 resolution displays.</p>
<p>The new layout, also my first WordPress theme (yay), is a bit more flexible.  By default, it is full-browser-width, with reasonable space allotted to the right sidebar and the main content areas.  For modern browsers that support max-width CSS, the design will stop &#8220;growing&#8221; at 1,000 pixels, just short of full-width on a 1024&#215;768 resolution.  The content and sidebar columns have, in addition to their own (possibly redundant) max-widths, reasonable min-widths.  This is to prevent the content from being squashed beyond recognition should someone with an abnormally small browser come along.  In this case, the sidebar will drop below the content area when the point-of-no-more-shrinkage is reached.</p>
<p>There&#8217;s a whopping 6.3KB worth of images to load per page.  Unfortunately, they&#8217;re almost all translucent gradients, so IE6 users will receive *html hacks in the CSS to clear most of them, to avoid unsightly grey blocks that would otherwise obscure text.  The color scheme was heavily based on <i>Cool Grays Lavender</i> by julievonderropp on <a href="http://kuler.adobe.com/">Kuler</a>.</p>
<p>In addition to the right-hand sidebar, I put two separate &#8220;widget areas&#8221; in the footer, one above the other.  The bottom section is primarily for displaying the archives links &#8212; there are a lot of them (one for each month the site&#8217;s been up), and they don&#8217;t fit very nicely in vertical sidebars.  The top section is simply another sidebar, designed to fit up to three widgets.</p>
<p>A decent amount of work went into the comments section, along with some help and ideas from a comments template posted at <a href="http://www.christianmontoya.com/2006/10/15/full-featured-commentsphp-template-for-wordpress/">ChristianMontoya.com</a>.  Even/odd comments are striped for easy differentiation.  The post&#8217;s author&#8217;s name is retrieved via an extra database query, and comments made by that author are given an additional class name, used to attach another gradient image to the background.  Also, comments and pingbacks are listed separately, comments first, along with their respective counts.  This change is extended to the front and search pages, where another extra query is executed for each post to obtain the number of actual comments for that post.  A small amount of extra overhead, but it might be worth it for the extra accuracy.  Unfortunately, I haven&#8217;t yet thought of a succinct way of displaying the total number of responses (comments plus pingbacks).</p>
<p>Concerning the actual theme construction, at the outset, I really had no clue about making WordPress themes, other than that it involved PHP, HTML, CSS, and some MySQL.  The design itself started as an HTML file on my local harddrive, just an idea I started tweaking around.  Fortunately, in my research I ran across a <a href="http://www.wpdesigner.com/2007/02/19/so-you-want-to-create-wordpress-themes-huh/">full-fledged WordPress theme tutorial</a> on WPDesigner.com; it&#8217;s really a great tutorial for beginners to the whole WordPress skinning idea.  For what the tutorial lacked, the <a href="http://codex.wordpress.org/">WordPress Codex</a> was a great reference, along with a couple of google searches for some unclear topics.  I did have to consult <a href="http://php.net/">PHP.net</a> a couple of times, but that&#8217;s normal for any PHP project.  Overall, though, it wasn&#8217;t too difficult, just a matter of putting the right pieces in the right places <img src='http://techknack.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  .</p>
<p>So, there you have it.  My first post in almost a month (sorry <img src='http://techknack.net/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  ) is a self-centered look-at-me post.  Criticisms, comments, and congratulations on the design are welcome.  As are lectures about what coding, design, or WordPress standards I may have broken <img src='http://techknack.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  .  In other words, I look forward to your feedback.</p>
<img src="http://techknack.net/?ak_action=api_record_view&id=180&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://techknack.net/new-layout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sticky Page Footers</title>
		<link>http://techknack.net/sticky-page-footers/</link>
		<comments>http://techknack.net/sticky-page-footers/#comments</comments>
		<pubDate>Sat, 12 Jul 2008 18:53:00 +0000</pubDate>
		<dc:creator>eternicode</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://blog.techknack.net/sticky-page-footers/</guid>
		<description><![CDATA[Occasionally you&#8217;ll be coding out a site, and you want a &#8220;sticky footer&#8221;, a footer that sticks to the bottom of the browser viewport or the bottom of the main content section, whichever is lowest.
There are a few notable sites that have posted methods for doing this, but the short answer is it doesn&#8217;t work [...]]]></description>
			<content:encoded><![CDATA[<p>Occasionally you&#8217;ll be coding out a site, and you want a &#8220;sticky footer&#8221;, a footer that sticks to the bottom of the browser viewport or the bottom of the main content section, whichever is lowest.</p>
<p>There are a few notable sites that have posted methods for doing this, but the short answer is it doesn&#8217;t work unless you meet certain requirements.  Probably the most popular example (which is also the first google result for &#8220;sticky footer&#8221;) is <a href='http://ryanfait.com/sticky-footer/'>A CSS Sticky Footer</a>.  However, as <a href='http://ryanfait.com/resources/footer-stick-to-bottom-of-page/'>the explanation page</a> shows, the method uses extraneous markup to push the footer down below the content.  Also, this method only works with static-height footers.</p>
<p>Another good example comes from <a href='http://www.alistapart.com/articles/footers'>AListApart: Exploring Footers</a>.  The method involves using relative positioning on a container and absolutely positioning the footer to the bottom of that container.  Inexplicably, this works, though for my implementation, I used the body element as my wrapper.  Unfortunately, you have to apply appropriate padding or margin to the bottom of the content div, which in turn squashes the idea of having a dynamic-height footer.</p>
<p>Given these examples, which are perfect for fixed-height footers, it seems sticky, dynamic-height footers are not meant to be under current browser implementations.  If you&#8217;re insistent on having a dynamic-height sticky, you&#8217;ll have to go the way of the faux footer (along the lines of the <a href='http://www.alistapart.com/articles/fauxcolumns/'>faux columns</a>, which I&#8217;ve always thought to be cheating <img src='http://techknack.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ).  I couldn&#8217;t find any links talking about faux columns (in this sense, anyway), but one site which currently implements it is <a href='http://kilianvalkhof.com/'>KilianValkhof.com</a>.  If you look into his code, you&#8217;ll see that the background of the footer is actually set in the body.</p>
<img src="http://techknack.net/?ak_action=api_record_view&id=147&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://techknack.net/sticky-page-footers/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Lists, Useful For More Than Menus</title>
		<link>http://techknack.net/lists-useful-for-more-than-menus/</link>
		<comments>http://techknack.net/lists-useful-for-more-than-menus/#comments</comments>
		<pubDate>Sun, 11 May 2008 19:23:00 +0000</pubDate>
		<dc:creator>eternicode</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://blog.techknack.net/lists-useful-for-more-than-menus/</guid>
		<description><![CDATA[I came across a page recently that uses ordered lists for the entire layout &#8212; not just the menu.  The entire layout is in two parts: one ordered list for the header/body/footer, and another ordered list for the three columns inside the body.
I find this to be an interesting approach to multi-column layouts.  [...]]]></description>
			<content:encoded><![CDATA[<p>I came across a page recently that uses <a href='http://www.tjkdesign.com/articles/css-layout/no_div_no_float_no_clear_no_hack_no_joke.asp'>ordered lists for the entire layout</a> &#8212; not just <a href='http://www.dynamicdrive.com/style/csslibrary/category/C2/'>the menu</a>.  The entire layout is in two parts: one ordered list for the header/body/footer, and another ordered list for the three columns inside the body.</p>
<p>I find this to be an interesting approach to multi-column layouts.  Better yet, the author claims that it works in <i>all</i> major browsers on the three major operating systems.</p>
<p>However, are ordered lists the proper elements to use in this case?  Is it &#8220;semantically correct&#8221;?  What about unordered versus ordered lists?  It&#8217;d be terribly simple to convert the layout to work with unordered lists, but which is more &#8220;correct&#8221;.</p>
<p>Regardless of correctness, though, &#8220;no floats, no divs, no clears&#8221; is rather appealing.</p>
<img src="http://techknack.net/?ak_action=api_record_view&id=128&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://techknack.net/lists-useful-for-more-than-menus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Circular Menus and Usability</title>
		<link>http://techknack.net/circular-menus-and-usability/</link>
		<comments>http://techknack.net/circular-menus-and-usability/#comments</comments>
		<pubDate>Thu, 08 May 2008 19:54:00 +0000</pubDate>
		<dc:creator>eternicode</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[ideas]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://blog.techknack.net/circular-menus-and-usability/</guid>
		<description><![CDATA[Circular menus.  Ever heard of them?  I&#8217;m not sure if they have an &#8220;official&#8221; or &#8220;common&#8221; name, but this name is pretty descriptive.
 Circular menus are superior in usability to the typical rectangular slide-out menu.  Why?  Because, ideally, each menu item is the same distance from the initial pointer position as [...]]]></description>
			<content:encoded><![CDATA[<p>Circular menus.  Ever heard of them?  I&#8217;m not sure if they have an &#8220;official&#8221; or &#8220;common&#8221; name, but this name is pretty descriptive.</p>
<p><a href="http://bp3.blogger.com/_6C7jhrvrP14/SCIU9EvvNBI/AAAAAAAAAIs/VvMq-7PczFU/s1600-h/ipod_shuffle_3gen_7.jpg"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_6C7jhrvrP14/SCIU9EvvNBI/AAAAAAAAAIs/VvMq-7PczFU/s200/ipod_shuffle_3gen_7.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5197739959417517074" /></a> Circular menus are superior in usability to the typical rectangular slide-out menu.  Why?  Because, ideally, each menu item is the same distance from the initial pointer position as each other item.  Look at the iPod buttons, for example.  Play/Pause, the most common function, is in the middle, and the other functions are equal distances from there.</p>
<p><a href="http://bp2.blogger.com/_6C7jhrvrP14/SCIVk0vvNCI/AAAAAAAAAI0/QbqbFj_uLEM/s1600-h/roue_selection_m.jpg"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_6C7jhrvrP14/SCIVk0vvNCI/AAAAAAAAAI0/QbqbFj_uLEM/s200/roue_selection_m.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5197740642317317154" /></a> Also check out the SecondLife context &#8220;spin menu&#8221;.  The pie pops up surrounding the cursor, and all the available options are an equal twitch away from the center.</p>
<p>Submenus?  Just expand the circle.  For example, here&#8217;s a quick mockup I made converting much of my current FireFox context menu into a pie menu: <a href="http://bp2.blogger.com/_6C7jhrvrP14/SCIXQ0vvNFI/AAAAAAAAAJM/cCtvGNWR0co/s1600-h/menu.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_6C7jhrvrP14/SCIXQ0vvNFI/AAAAAAAAAJM/cCtvGNWR0co/s400/menu.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5197742497743189074" /></a></p>
<p>But how feasible would such menus be inside a website?  WebToolkit.info has a <a href='http://www.webtoolkit.info/javascript-pie-menu.html'>mostly-working demo</a> that uses images exclusively.  I tried substituting text for the images, but the menu simply disappeared.</p>
<p><i>Credit for image: <a href='http://www.jjmehta.com/products/ipod_shuffle_3gen.html'>iPod image</a> and <a href='http://www.ldmag.com/en/post/2007/04/15/Second-Lifes-Builders'>SecondLife image</a></i></p>
<img src="http://techknack.net/?ak_action=api_record_view&id=127&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://techknack.net/circular-menus-and-usability/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Alternative Link Underlining</title>
		<link>http://techknack.net/alternative-link-underlining/</link>
		<comments>http://techknack.net/alternative-link-underlining/#comments</comments>
		<pubDate>Sun, 20 Apr 2008 03:07:00 +0000</pubDate>
		<dc:creator>eternicode</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://blog.techknack.net/alternative-link-underlining/</guid>
		<description><![CDATA[ Ever seen the odd site that, instead of solid or absent underlining, has a dotted or dashed underline?  Ever wonder how it&#8217;s done?  It&#8217;s really simple: border-style.
All you need to do to get an alternative underlining effect is to, first off, hide the default underline with text-decoration:none, and then specify a bottom [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://bp2.blogger.com/_6C7jhrvrP14/SAgmDjGOMGI/AAAAAAAAAHY/BvbBm2uPMWo/s1600-h/screenshot1.png"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_6C7jhrvrP14/SAgmDjGOMGI/AAAAAAAAAHY/BvbBm2uPMWo/s320/screenshot1.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5190440412947296354" /></a> Ever seen the odd site that, instead of solid or absent underlining, has a dotted or dashed underline?  Ever wonder how it&#8217;s done?  It&#8217;s really simple: border-style.</p>
<p>All you need to do to get an alternative underlining effect is to, first off, hide the default underline with text-decoration:none, and then specify a bottom border for the affected links:</p>
<pre class="brush: css;">
a:link {
    text-decoration: none;
    border-bottom: #000 dashed 1px;
}
</pre>
<p>To make the effect stand out, you could also make the link and border separate colors, either on hover or all the time.</p>
<img src="http://techknack.net/?ak_action=api_record_view&id=120&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://techknack.net/alternative-link-underlining/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pretty Up Your Forms with CSS</title>
		<link>http://techknack.net/pretty-up-your-forms-with-css/</link>
		<comments>http://techknack.net/pretty-up-your-forms-with-css/#comments</comments>
		<pubDate>Sat, 12 Apr 2008 16:58:00 +0000</pubDate>
		<dc:creator>eternicode</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://blog.techknack.net/pretty-up-your-forms-with-css/</guid>
		<description><![CDATA[Let&#8217;s face it: form elements au naturel are NOT pretty.  So what do we do with them?

We add a border thickness here, a border color there, leaving the whole thing largely unchanged.  And still ugly.  Time to change that.
I&#8217;m going to use the Tableless CSS Forms code provided by DynamicDrive&#8217;s CSS library [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s face it: form elements <a href='http://dictionary.reference.com/browse/au%20naturel' title='Yeah, that&#39;s right -- uncooked form elements...'>au naturel</a> are NOT pretty.  So what do we do with them?<br />
<a href="http://bp3.blogger.com/_6C7jhrvrP14/R_pzysK5v6I/AAAAAAAAAFQ/TtjZ5MQoIVU/s1600-h/screenshot4.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_6C7jhrvrP14/R_pzysK5v6I/AAAAAAAAAFQ/TtjZ5MQoIVU/s320/screenshot4.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5186585235558088610" /></a><br />
We add a border thickness here, a border color there, leaving the whole thing largely unchanged.  And still ugly.  Time to change that.</p>
<p>I&#8217;m going to use the <a href='http://www.dynamicdrive.com/style/csslibrary/item/css-tableless-form/'>Tableless CSS Forms</a> code provided by DynamicDrive&#8217;s CSS library contributors.  This gives us the basic layout and essential elements without too much trouble:<br />
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_6C7jhrvrP14/R_p2EsK5v8I/AAAAAAAAAFg/XPcDsbG5UTg/s1600-h/screenshot5.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_6C7jhrvrP14/R_p2EsK5v8I/AAAAAAAAAFg/XPcDsbG5UTg/s320/screenshot5.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5186587743818989506" /></a></p>
<p>We&#8217;ll start with the basics: borders and background.  In Web 2.0, simplicity is king.  Beveled corners?  Sooo Web 1.0.  Sooo not pretty.  We&#8217;ll make the borders solid, with uniform color, and thin to keep the simplicity.  And we&#8217;ll specify a white background to avoid any cross-browser issues:</p>
<pre class="brush: css;">
.cssform input, .cssform textarea {
    border: #999 solid 1px;
    background: #FFF;
}
</pre>
<p><a href="http://bp0.blogger.com/_6C7jhrvrP14/R_p3G8K5v-I/AAAAAAAAAFw/Edh5vVaK9RY/s1600-h/screenshot6.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp0.blogger.com/_6C7jhrvrP14/R_p3G8K5v-I/AAAAAAAAAFw/Edh5vVaK9RY/s320/screenshot6.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5186588881985322978" /></a><br />
A nice, neutral gray tones down the harshness of the input areas&#8217; borders, and the solid-1px all the way around eliminates any doubts as to where the areas begin and end.</p>
<p>Next we want to make it a li&#8217;l roomier.  How do <i>you</i> like cramming text into zero-padding textboxes?</p>
<pre class="brush: css;">
.cssform input {
    padding: 3px 5px;
}
.cssform textarea {
    padding: 5px;
}
</pre>
<p><a href="http://bp2.blogger.com/_6C7jhrvrP14/R_p3xcK5v_I/AAAAAAAAAF4/Zi8343ObyjA/s1600-h/screenshot7.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_6C7jhrvrP14/R_p3xcK5v_I/AAAAAAAAAF4/Zi8343ObyjA/s320/screenshot7.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5186589612129763314" /></a><br />
Here&#8217;s when you start getting into trouble with the disparities in browsers&#8217; box models, though as long as the width of the elements isn&#8217;t an issue, you should be fine.</p>
<p>Now that we&#8217;ve covered the foundation, time to break out the makeup: images!  Using a very small, <i>very</i> subtle gradient image, we can add a simple inner shadow to each input field.  While this is &#8220;adding features&#8221;, I feel it actually adds to the feeling of simplicity:</p>
<pre class="brush: css;">
.cssform input, .cssform textarea {
    border: #999 solid 1px;
    background: #FFF url(formgrad.png) repeat-x top left;
}
</pre>
<p><a href="http://bp2.blogger.com/_6C7jhrvrP14/R_p6GcK5wAI/AAAAAAAAAGA/IDUUpDZoRbc/s1600-h/screenshot8.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_6C7jhrvrP14/R_p6GcK5wAI/AAAAAAAAAGA/IDUUpDZoRbc/s320/screenshot8.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5186592171930271746" /></a><br />
The gradient image is a 1px wide by 15px high PNG image with a gradient of hex colors #EEEEEE (top) to #FFFFFF (bottom).  The slightest difference in color makes for a very nice effect.</p>
<p>We could very well stop here &#8212; all the form elements are styled nicely, even the submit and reset buttons.  But why stop there when you can make the buttons intuitive as well?</p>
<pre class="brush: css;">
.cssform .submit {
    background: #FFF url(submitgrad.png) repeat-x bottom left;
}
.cssform .reset {
    background: #FFF url(resetgrad.png) repeat-x bottom left;
}
</pre>
<p><a href="http://bp1.blogger.com/_6C7jhrvrP14/R_p7dMK5wEI/AAAAAAAAAGg/ybLGxh9767o/s1600-h/screenshot10.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://bp1.blogger.com/_6C7jhrvrP14/R_p7dMK5wEI/AAAAAAAAAGg/ybLGxh9767o/s320/screenshot10.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5186593662283923522" /></a><br />
Here we use <a href='http://www.dynamicdrive.com/style/csslibrary/item/stylish-submit-buttons/'>another technique found at DynamicDrive</a>.  This simply adds two other colored gradient images to the background of the appropriate buttons.  Of course, you must add the appropriate classes to the buttons for this to work.  If you want to take full advantage of CSS standards and leave IE6 and below behind in the dust, you could just use the attribute selector:</p>
<pre class="brush: css;">
.cssform input[type=&quot;submit&quot;] {
    background: #FFF url(submitgrad.png) repeat-x bottom left;
}
.cssform input[type=&quot;reset&quot;] {
    background: #FFF url(resetgrad.png) repeat-x  bottom left;
}
</pre>
</p>
<p>And there you have it.  With no more than three images (or one, if you prefer), some very simple CSS, and an eye for simplicity, we&#8217;ve made our form elements <i>nice looking</i>.</p>
<p>Additional links:</p>
<ul>
<li><a href='http://www.box.net/shared/peda9viv4w'>Download the example</a></li>
<li><a href='http://techknack.net/examples/prettyform/prettyforms.html'>View the example page</a></li>
<li><a href='http://techknack.net/examples/prettyform/'>Browse the files</a></li>
<li><a href='http://www.dynamicdrive.com/style/csslibrary/item/css-tableless-form/'>DynamicDrive: CSS Tableless Forms</a></li>
<li><a href='http://www.dynamicdrive.com/style/csslibrary/item/stylish-submit-buttons/'>DynamicDrive: Stylish Submit Buttons</a></li>
</ul>
<img src="http://techknack.net/?ak_action=api_record_view&id=118&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://techknack.net/pretty-up-your-forms-with-css/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Promote Standards Awareness with CSS Naked</title>
		<link>http://techknack.net/promote-standards-awareness-with-css-naked/</link>
		<comments>http://techknack.net/promote-standards-awareness-with-css-naked/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 19:15:00 +0000</pubDate>
		<dc:creator>eternicode</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://blog.techknack.net/promote-standards-awareness-with-css-naked/</guid>
		<description><![CDATA[CSS Naked is a standards-awareness initiative led/organized by Dustin Diaz.  On the specified date, April 9th, all participating websites will strip their sites of their CSS, allowing the world to see the underlying clean-code usability:
The idea behind this event is to promote Web Standards. Plain and simple. This includes proper use of (x)html, semantic [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://naked.dustindiaz.com/'>CSS Naked</a> is a standards-awareness initiative led/organized by <a href='http://dustindiaz.com/'>Dustin Diaz</a>.  On the specified date, April 9th, all participating websites will strip their sites of their CSS, allowing the world to see the underlying clean-code usability:</p>
<blockquote><p>The idea behind this event is to promote Web Standards. Plain and simple. This includes proper use of (x)html, semantic markup, a good hierarchy structure, and of course, a good &#8216;ol play on words. It&#8217;s time to show off your &lt;body&gt;.</p>
</blockquote>
<p>While I would love to participate in this, I wouldn&#8217;t recommend it for Blogger users.  The building blocks of Blogger blogs, widgets, produce all sort of irrelevant divs and such that are used exclusively as CSS hooks.  Aside from the fact that the underlying code is NOT semantic, disabling styles on Blogger sites (well, this one anyway) is NOT pretty (or, for that matter, usable).  If you must see the results of such an inadvisable act as disabling CSS, you can (using FireFox) go to View -&gt; Page Style -&gt; No Style.  This will disable styles for the current page (or the current tab, I&#8217;m not exactly sure).</p>
<p>So, to reverse Dustin&#8217;s little play on words &#8212; sorry, you don&#8217;t get to see my &lt;body&gt; <img src='http://techknack.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<img src="http://techknack.net/?ak_action=api_record_view&id=115&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://techknack.net/promote-standards-awareness-with-css-naked/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Got Mad Coding Skills?</title>
		<link>http://techknack.net/got-mad-coding-skills/</link>
		<comments>http://techknack.net/got-mad-coding-skills/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 16:20:00 +0000</pubDate>
		<dc:creator>eternicode</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://blog.techknack.net/got-mad-coding-skills/</guid>
		<description><![CDATA[Think you got what it takes to slice up a PSD file into a valid and usable (X)HTML template?  Then check out CSS Off, a contest that gives you the opportunity to do just that.  At one minute past midnight CST on April 5, a PSD file will be uploaded for contestants to [...]]]></description>
			<content:encoded><![CDATA[<p>Think you got what it takes to slice up a PSD file into a valid and usable (X)HTML template?  Then check out <a href='http://cssoff.com/2008/03/20/next-contest-is-april-4-2008/'>CSS Off</a>, a contest that gives you the opportunity to do just that.  At one minute past midnight CST on April 5, a PSD file will be uploaded for contestants to download.  Contestants will have up to 24 hours to submit their completed entry.</p>
<p><a href='http://answers.yahoo.com/question/index?qid=20061003221806AAdLmsE'>Don&#8217;t have Photoshop?</a>  Check out the <a href='http://gimp.org/'>GIMP</a>!  I&#8217;m hoping that the PSD file is GIMP-compatible.  You could try to convert it one way (using an <a href='http://fivepointsome1.blogspot.com/2007/12/how-to-convert-your-files-online-into.html'>online service</a>) or another (<a href='http://www.gimptalk.com/forum/topic/Can-Gimp-Open-A-Psd-File-4722-1.html'>directly in the GIMP</a>),but there&#8217;s always the issue of unsupported layer effects getting messed up.</p>
<p>And, no, this is not an <acronym title='April Fool&#39;s Day'>AFD</acronym> trick.  At least, I hope it isn&#8217;t&#8230;</p>
<img src="http://techknack.net/?ak_action=api_record_view&id=114&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://techknack.net/got-mad-coding-skills/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Faviconize your blog</title>
		<link>http://techknack.net/faviconize-your-blog/</link>
		<comments>http://techknack.net/faviconize-your-blog/#comments</comments>
		<pubDate>Tue, 25 Mar 2008 20:06:00 +0000</pubDate>
		<dc:creator>eternicode</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://blog.techknack.net/faviconize-your-blog/</guid>
		<description><![CDATA[Favicons.  Those little icons that appear on FireFox&#8217;s tabs, IE&#8217;s favorites bar, and various other places in web-related applications.  Simple little icons, no larger than 32 pixels square, yet they are a part of your site&#8217;s identity.
Why have a favicon?  Kiseki.co.uk puts it well:
A favicon can help people identify your site quickly [...]]]></description>
			<content:encoded><![CDATA[<p>Favicons.  Those little icons that appear on FireFox&#8217;s tabs, IE&#8217;s favorites bar, and various other places in web-related applications.  Simple little icons, no larger than 32 pixels square, yet they are a part of your site&#8217;s identity.</p>
<p>Why have a favicon?  <a href='http://www.kiseki.co.uk/'>Kiseki.co.uk</a> puts it well:</p>
<blockquote><p>A favicon can help people identify your site quickly and easily in, say, a long list of bookmarks&#8230;.It is only a small detail, but it can be useful for people to recognise your site.</p>
</blockquote>
<p>A favicon is an instant visual cue that, when a visitor sees it, conjures your website in their minds.  As <a href='http://www.abstractpromotion.com/if-you-dont-have-a-favicon-your-users-will-forget-about-you'>AbstractPromotion.com</a> says, &#8220;If you don’t have a favicon, your users will forget about you&#8221;.</p>
<p>Making a favicon is fairly straightforward: churn up your creative juices, fire up the gimp, create a new 16&#215;16px or 32&#215;32px image, brand away, save as an ICO, GIF, or PNG file, then upload the image to a file hosting site.  I personally enjoy <a href='http://www.villagephotos.com'>Village Photos&#8217;</a> free account, though there&#8217;s always PhotoBucket, ImageShack, or Google&#8217;s own <a href='http://picasaweb.google.com/'>Picasa service</a>.  After the image is web-accessible, add the following lines to the &lt;head&gt; section of your blog HTML template:</p>
<pre class="brush: xml;">
&lt;link href=&quot;http://host.com/path/to/image.png&quot; rel=&quot;shortcut icon&quot; type=&quot;image/png&quot; /&gt;
&lt;link href=&quot;http://host.com/path/to/image.png&quot; rel=&quot;icon&quot; type=&quot;image/png&quot; /&gt;
</pre>
<p>And, voila!  You should obviously replace the href and type attributes to fit your situation.  For type, use image/png for PNG, image/gif for GIF, and image/ico for ICO, in case you were wondering <img src='http://techknack.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Why two nigh-identical tags?  To answer a question with a question, what browser has, in decades past, caused us all so much pain?  That&#8217;s right.  It seems that older versions of IE need the &#8220;shortcut icon&#8221; link just to see the favicon image&#8230;whether or not they decide to display it.</p>
<p><a href='http://www.w3.org/2005/10/howto-favicon'>According to the W3C</a>, the rel attribute&#8217;s value should, &#8220;officially&#8221;, be &#8220;icon&#8221;.  Interestingly, they also recommend putting a &#8220;profile&#8221; attribute in the &lt;head&gt; tag, &#8220;to define what the ["icon"] value means&#8221;.  Their version:</p>
<pre class="brush: xml;">
&lt;head profile=&quot;http://www.w3.org/2005/10/profile&quot;&gt;
&lt;link rel=&quot;icon&quot;
      type=&quot;image/png&quot;
      href=&quot;/somewhere/myicon.png&quot; /&gt;
</pre>
<p>Though I don&#8217;t know for sure how well this will make IE6 behave&#8230;if such a thing is indeed possible.</p>
<img src="http://techknack.net/?ak_action=api_record_view&id=111&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://techknack.net/faviconize-your-blog/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

