<?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; css</title>
	<atom:link href="http://techknack.net/category/css/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>A Method for CSS Variables</title>
		<link>http://techknack.net/a-method-for-css-variables/</link>
		<comments>http://techknack.net/a-method-for-css-variables/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 21:33:57 +0000</pubDate>
		<dc:creator>eternicode</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://techknack.net/?p=279</guid>
		<description><![CDATA[Jay Salvat at nettuts has written an article on adding variables to your css files.  I like the approach, which includes caching the results, though the code presented is not 100% secure, as commenter Pelle has noted.
As for the most popular response, having apache run css files as php code, there are a few [...]]]></description>
			<content:encoded><![CDATA[<p>Jay Salvat at <a href="http://net.tutsplus.com">nettuts</a> has written an article on <a href="http://net.tutsplus.com/tutorials/html-css-techniques/how-to-add-variables-to-your-css-files/">adding variables to your css files</a>.  I like the approach, which includes caching the results, though the code presented is not 100% secure, as <a href="http://net.tutsplus.com/tutorials/html-css-techniques/how-to-add-variables-to-your-css-files/#comment-45724">commenter Pelle</a> has noted.</p>
<p>As for the most popular response, having apache run css files as php code, there are a few issues that come to mind that the article&#8217;s approach takes care of: caching, cleanliness, and portability.</p>
<p>Caching, as the author notes, reduces the number of CPU cycles the server must devote to php processing of the css files.  The parser also implements HTTP features for determining if the file has been modified and needs reloading.  Simply setting the server to parse CSS files, you may or may not lose these features, depending on your server settings.</p>
<p>The method is also clean; using a parsing class lets you put simple variable assignments directly in the CSS file.  Associating CSS with the PHP parser requires you to use the PHP tags and all the appropriate PHP markers ( &lt;?php $var = &#8220;whatever&#8221;; ?&gt; ); if you miss a semicolon, a quote, a dollar sign, or any other part of the required &#8220;PHP syntax&#8221;, your css file at best will contain a php error or warning message, making the code invalid, or at worst will not display at all, giving a blank css file.  The parser Jay gives, while requiring a syntax of its own, is much simpler to use.</p>
<p>Jay&#8217;s solution is portable; the only server configuration necessary is enabling apache&#8217;s mod_rewrite module, which should be enabled anyway.  If that is done, you can move the .htaccess and enhanced_css.php files to any server, and it will work without further server config.</p>
<p>As commenter Pelle notes, however, if someone knows you&#8217;re using this method and they know the path to your enhanced_css.php file, they could use it maliciously.  Jay responds with a quick fix that makes sure the class only parses files ending with &#8220;css&#8221;, but I believe that further security could be provided, though I&#8217;ve not taken the time to analyze the code enough to make suggestions.</p>
<p><a href="http://net.tutsplus.com/tutorials/html-css-techniques/how-to-add-variables-to-your-css-files/#comment-45795">Chris Pratt</a> made a suggestion of changing the parser to hunt out <a href="http://disruptive-innovations.com/zoo/cssvariables/#mozTocId992035">CSS variables as proposed by Daniel Glazman and David Hyatt</a>.  I thought this would be a good idea; the syntax proposed in that doument is much more like the CSS3 stuff we&#8217;re slowly getting used to, such as :not() and attr().</p>
<p>For those interested, you could read <a href="http://www.w3.org/People/Bos/CSS-variables">why some think CSS variables are harmful</a>.</p>
<img src="http://techknack.net/?ak_action=api_record_view&id=279&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://techknack.net/a-method-for-css-variables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Basics of CSS-P in 10 Tabs</title>
		<link>http://techknack.net/the-basics-of-css-p-in-10-tabs/</link>
		<comments>http://techknack.net/the-basics-of-css-p-in-10-tabs/#comments</comments>
		<pubDate>Sun, 28 Dec 2008 23:09:30 +0000</pubDate>
		<dc:creator>eternicode</dc:creator>
				<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://techknack.net/?p=206</guid>
		<description><![CDATA[I came across this small page that goes through ten css-positioning tidbits available when coding a site.  And, thanks to javascript, you can see real-time effects caused by the css changes mentioned in the tab you click.
And what did I learn from this?  I learned that &#8220;static&#8221; is the default position for elements. [...]]]></description>
			<content:encoded><![CDATA[<p>I came across this small page that goes through <a href="http://www.barelyfitz.com/screencast/html-training/css/positioning/">ten css-positioning tidbits</a> available when coding a site.  And, thanks to javascript, you can see real-time effects caused by the css changes mentioned in the tab you click.</p>
<p>And what did I learn from this?  I learned that &#8220;static&#8221; is the default position for elements.  I didn&#8217;t even know &#8220;position:static&#8221; existed.</p>
<img src="http://techknack.net/?ak_action=api_record_view&id=206&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://techknack.net/the-basics-of-css-p-in-10-tabs/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>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>Progressively Enhance copyable code blocks</title>
		<link>http://techknack.net/progressively-enhance-copyable-code-blocks/</link>
		<comments>http://techknack.net/progressively-enhance-copyable-code-blocks/#comments</comments>
		<pubDate>Tue, 12 Feb 2008 17:17:00 +0000</pubDate>
		<dc:creator>eternicode</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.techknack.net/progressively-enhance-copyable-code-blocks/</guid>
		<description><![CDATA[Update 8/17/09: I&#8217;ve installed the SyntaxHighlighter Evolved wordpress plugin, which not only highlights code, but also gives access to plaintext source and copy-to-clipboard functionality.
After the upgrade to WordPress, I haven&#8217;t updated the theme to include this feature.  I may just stick to code highlighting for now.
I&#8217;ve employed a bit of progressive JS here on [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update 8/17/09:</strong> I&#8217;ve installed the <a href="http://wordpress.org/extend/plugins/syntaxhighlighter/">SyntaxHighlighter Evolved</a> wordpress plugin, which not only highlights code, but also gives access to plaintext source and copy-to-clipboard functionality.</p>
<p><em>After the upgrade to WordPress, I haven&#8217;t updated the theme to include this feature.  I may just stick to code highlighting for now.</em></p>
<p>I&#8217;ve employed a bit of progressive JS here on the blog to make it easier for readers to copy the blocks of code that I post.  Go ahead, try it: click within the code block, and the entire thing is selected.  Makes for pretty easy copying, rather than having to carefully select <i>just</i> the text inside the box&#8230;</p>
<pre class="brush: plain;">
// I'm code!!  Copy me!!
$ hello world
// w00t...
</pre>
</p>
<h3>The way it works</h3>
<p>Here&#8217;s how it works: I&#8217;ve defined a function which goes over every single &lt;code&gt; element on the page.  For each code element, a textarea element is created and inserted into the DOM tree directly before the corresponding code element.  Once a textarea is added to the DOM, it is hidden via CSS.  The textarea is given, as child nodes, recursive clones of code&#8217;s DOM child nodes.  Then, the onclick event of the code element and the onblur event of the textarea are set to different functions.  The code&#8217;s onclick function hides the code element, un-hides the textarea element gives the textarea the focus, and selects the textarea&#8217;s contents.  The textarea&#8217;s onblur function hides the textarea and un-hides the corresponding code element.</p>
<p>It&#8217;s possible to have the script do this for <i>all</i> code elements on the page, but I&#8217;ve implemented it to only target those code elements to which I&#8217;ve given a class name of &#8220;copyable&#8221;.</p>
<h3>The CSS</h3>
<p>The hiding-un-hiding tricks aren&#8217;t possible without CSS.  Well, they&#8217;re possible, but such an implementation would make the JS much messier.  Here I&#8217;ve used CSS to similarly style both code elements and elements with a class name of &#8220;codeenhance&#8221; (which is used to identify the inserted textareas).</p>
<pre class="brush: css;">
.codeenhance, code {
    width: 430px;
    color: #000;
    display: block;
    background: #eee;
    padding: 0 10px;
    padding-bottom: 1em;
    margin: 0;
    border-width: 3px 1px !important;
    border: #99f solid;
    overflow: auto;
    line-height: 1.4em;
    font-family: monospace;
    font-size: 1.1em;
}
.codeenhance, .copyable {
    height: 250px;
}
code {
    white-space: pre;
}
.codeenhance {
    padding: 0;
}
.codeenhance-off {
    display: none;
}
</pre>
<p>The first declaration is the main styling for the code elements.  The height specification for .codeenhance and .copyable fix the height of copyable code blocks, so your 159 lines of copyable JS don&#8217;t take up too much space.  I&#8217;ve left the height out of the main declaration, to allow the other code blocks to expand/retract to their contents&#8217; size.  The white-space declaration for code elements maintains the whitespace as you typed it.  The padding declaration for .codeenhance fixes an interesting jumping issue with the textareas.  And the display declaration for .codeenhance-off is what hides the appropriate items.</p>
<h3>The Javascript</h3>
<p>Here&#8217;s the JS.  The explanations are in the code comments <img src='http://techknack.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<pre class="brush: jscript;">
// Enable click-select on code elements
function enhanceCode() {
    // Get all code tags
    var codes = document.getElementsByTagName(&quot;code&quot;);
    // loop over code tags
    for (i=0; i&amp;lt;codes.length; i++) {
        // working only on tags of class &quot;copyable&quot;
        if (codes[i].className.match('copyable')) {
            // for each tag, create a new textarea
            var text = document.createElement(&quot;textarea&quot;);
            // copy the code's children over
            for (j=0; j&amp;lt;codes[i].childNodes.length; j++) {
                // special code for Blogger, to take care of extra br elements
                if (codes[i].childNodes[j].nodeName == &quot;BR&quot;)
                    text.appendChild(document.createTextNode('\r\n'));
                else
                    text.appendChild(codes[i].childNodes[j].cloneNode(true));
            }
            // set the initial classname
            //    (use .className rather than .setAttribute('clas', 'blah')
            //    because IE6 doesn't like the latter
            text.className = &quot;codeenhance codeenhance-off&quot;;
            // setup the onblur event
            text.onblur = decodex;
            // insert the textarea before the code
            codes[i].parentNode.insertBefore(text, codes[i]);
            // setup the onclick event
            codes[i].onclick = codex;
        }
    }
}

// this = code element; this.previousSibling = textarea element
function codex() {
    // show the textarea
    this.previousSibling.className =
        this.previousSibling.className.replace(/ ?codeenhance\-off/, &quot;&quot;);
    // hide the code
    this.className = this.className+&quot; codeenhance-off&quot;;
    // focus and select the textarea
    this.previousSibling.focus();
    this.previousSibling.select();
}

// this = textarea; this.nextSibling = code
function decodex() {
    // show the code
    this.nextSibling.className =
        this.nextSibling.className.replace(/ ?codeenhance\-off/, &quot;&quot;);
    // hide the textarea
    this.className = this.className+&quot; codeenhance-off&quot;;
}

window.onload = function() {
    // run the enhancement /after/ the window has loaded
    enhanceCode();
}
</pre></p>
<img src="http://techknack.net/?ak_action=api_record_view&id=100&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://techknack.net/progressively-enhance-copyable-code-blocks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A well-designed website: many things to many people</title>
		<link>http://techknack.net/a-well-designed-website-many-things-to-many-people/</link>
		<comments>http://techknack.net/a-well-designed-website-many-things-to-many-people/#comments</comments>
		<pubDate>Fri, 01 Feb 2008 22:44: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[web]]></category>

		<guid isPermaLink="false">http://blog.techknack.net/a-well-designed-website-many-things-to-many-people/</guid>
		<description><![CDATA[In my Advanced Web Design class at school, my professor asked us to post what we thought defined a well-designed website.  I thought I&#8217;d share my answer here.  I&#8217;m sure he wasn&#8217;t expecting anything so involved as this  
&#8220;What makes a well-designed website?&#8221;  That&#8217;s quite a question.
As a dabbler in web [...]]]></description>
			<content:encoded><![CDATA[<p>In my Advanced Web Design class at school, my professor asked us to post what we thought defined a well-designed website.  I thought I&#8217;d share my answer here.  I&#8217;m sure he wasn&#8217;t expecting anything so involved as this <img src='http://techknack.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>&#8220;What makes a well-designed website?&#8221;  That&#8217;s quite a question.</p>
<p>As a dabbler in web design, I would say a well-designed website is &#8220;good-looking&#8221;.  It should look somewhat elegant.  The &#8220;Web 2.0 style&#8221; &#8212; glossy buttons, spacious openness, minimalistic simplicity, and copious use of gradients &#8212; comes to mind.  I can&#8217;t think of any sites that strictly adhere to all these points, but <a href="http://dynamicdrive.com/">DynamicDrive</a> is a good-looking site.</p>
<p>As an <acronym title="Human-Computer Interaction">HCI</acronym>-minded individual, a well-designed website is made by more than its layout. A well-designed website makes it obvious what the site&#8217;s purpose is, what can be done on the site, how to go about doing it, etc.  Again, simplicity is king, and clutter is sin.  Content is easy to skim and understand.  The layout does not make it difficult to navigate.  If a feature breaks, the site will either <em>gently</em> tell the user so, and make it easy for the user to report the breakage; or the site will function in such a way that the user doesn&#8217;t notice the difference, and the developer will be alerted.  I think <a href="http://digg.com/">Digg</a> is a fairly usable, well-designed site.</p>
<p>As a web developer at heart, a well-designed website is all in the code.  Separation of structure, content, presentation, and functionality is something to be strived for.  It should be built as follows:</p>
<ol>
<li>First build a mock page (with the final site&#8217;s design in mind) which contains either mock or real content, and only structure-oriented HTML markup.  Presentational markup is sin <img src='http://techknack.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   This page is not design-oriented; its only purpose is to structure the page&#8217;s content in a semantically meaningful way.  Any tags that do not directly relate to the structure and/or content of the page should be struck down with a flaming sword of death.  Organize things in such a ay that they flow logically along the page.</li>
<li>Develop the CSS in an externally linked file.  Introduce any design-specific images through the CSS, if possible (and it should be possible).  Strive for cross-browser compatibility within the CSS, making the site look as similar as possible from one browser to the next.  If any additional markup is required for the design of the site, the CSS should be developed to make the site look good without it; if still necessary, the necessary markup can be added through the next step.  Use what you have to get what you want.</li>
<li>Develop the functionality (using JavaScript) in another externally linked file.  Nonintrusive javascript should be used, progressively enhancing the site after it has loaded.  Nonintrusive javascript should also be used to add any necessary additional markup to be used by the CSS.  Again, use what you have to get what you want.</li>
<li>If possible, convert the finished page layout into a template, and use a server-side language to fill it with dynamic content.</li>
<li>Finally, when all is said and done, pull up the page in a browser, and make sure everything works.  Turn off javascript, refresh, and make sure everything works.  Turn off css, refresh, and make sure everything works.  Then browse the web for a while&#8230;.and see if it works <img src='http://techknack.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ol>
<p>According to these steps, a well-designed website will work across browsers, degrade gracefully in older browsers, respect the wishes of those with Javascript turned off.<br />
There are lots of websites that use this methodology (using only semantically-meaningful html, etc).  One well-designed website in this case is <a href="http://www.dynamixlabs.com/">Dynamix Labs</a>.  It doesn&#8217;t seem that they use any javascript, and if you turn off CSS, the site is still very readable.</p>
<p>As a user, I want information, and I want simplicity in doing what I want to do.  A lot of the time, I want information that I can talk about in my blog.  I use google as my main go-to source for finding things.  If I find a site that gives me good information on a regular basis, I want to be able to subscribe to its RSS feed, or something similar.  If I find a site that I come back to on a regular basis (whether I be forced to, or do so of my own free will), I want to be able to customize my experience on that site.  I want to be able to change the colors, the landing page content; anything and (usually) everything, I want to customize it to better serve my way of doing things.<br />
One service that I use on a daily basis is <a href="https://www.google.com/reader/view/#">Google Reader</a> (you&#8217;ll have to sign in to your google account), a web-based RSS aggregator.  It features &#8220;folders&#8221; that you can use to organize your feeds, drag-and-drop re-ordering of feeds, and very easy-to-use methods of subscribing and unsubscribing from feeds.<br />
Another service that I use regularly is <a href="http://netvouz.com/">Netvouz</a>, a social bookmarking site.  I chose Netvouz over other bookmarking sites because of its folder organization feature.  You can organize your bookmarks according to category (and sub-category) and make certain bookmarks private.  It&#8217;s also easy to delete or edit my existing bookmarks, and really easy to add new bookmarks using the Netvouz firefox extension.</p>
<p>I must say, though, that my most frequently used and favorite thing is <a href="http://getfirefox.com/">FireFox</a>.  It is customizable in (almost) every way possible; its functionality is infinitely extendable through extensions, which anyone familiar with XML and Javascript can write.  It has excellent support for standards; the upcoming FireFox 3 is said to have passed <a href="http://webstandards.org/acid2">the Acid2 test</a>, which is huge for web developers.</p>
<p>As you can see, from my point(s) of view, a well designed website can and should be many things to many different people.</p>
<p>So, what do you think?  What makes a website &#8220;well-designed&#8221;?  What are some examples of well-designed websites?</p>
<p><b>Note:</b> References to certain things &#8220;being sin&#8221; should not be taken literally.  Putting presentational markup on your page will not send you to hell.  Nor will avoiding clutter send you to heaven.  These are just my personal pet peeves <img src='http://techknack.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://techknack.net/?ak_action=api_record_view&id=96&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://techknack.net/a-well-designed-website-many-things-to-many-people/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

