<?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>Flexknowlogy - Jared Stein &#187; css</title>
	<atom:link href="http://jaredstein.org/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://jaredstein.org</link>
	<description>Education, Technology, Culture, and the Internet</description>
	<lastBuildDate>Fri, 30 Jul 2010 23:18:37 +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>Condensing the &#8220;News&#8221; Feature of My Moodle Using a Show/Hide Javascript</title>
		<link>http://jaredstein.org/2010/05/19/condensing-the-news-feature-of-my-moodle-using-a-showhide-javascript/</link>
		<comments>http://jaredstein.org/2010/05/19/condensing-the-news-feature-of-my-moodle-using-a-showhide-javascript/#comments</comments>
		<pubDate>Wed, 19 May 2010 21:19:34 +0000</pubDate>
		<dc:creator>Jared Stein</dc:creator>
				<category><![CDATA[lms]]></category>
		<category><![CDATA[moodle]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[modifications]]></category>
		<category><![CDATA[mods]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://jaredstein.org/?p=1239</guid>
		<description><![CDATA[The My Moodle feature in Moodle 1.9x displays a list of registered courses to a user after logging in. The nice thing about the list is that each course link is followed by a listing of any recent news or events in the course. Unfortunately in highly active courses this list becomes quite lengthy, and [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://docs.moodle.org/en/My_Moodle">My Moodle feature</a> in <a href="http://moodle.org">Moodle</a> 1.9x displays a list of registered courses to a user after logging in. The nice thing about the list is that each course link is followed by a listing of any recent news or events in the course. Unfortunately in highly active courses this list becomes quite lengthy, and ultimately obnoxious as the length obstructs quick access to other courses in one&#8217;s view.</p>
<p>To remedy this I have, for quite some time, maintained a custom bit of very basic Javascript and CSS that sets the default view of news items to hidden, with a clickable link to show the entire list from the My Moodle page:</p>
<div>
<p><a href="http://www.flickr.com/photos/5tein/4622703444/in/photostream/"><img src="http://farm5.static.flickr.com/4033/4622703444_32679d85df_o.jpg" alt="hidden news in My Moodle" /></a></p>
<p style="font-size: 70%">Clicking &#8220;There is news in this course&#8221; expands the news.</p>
</div>
<div>
<p><a href="http://www.flickr.com/photos/5tein/4622703572/"><img src="http://farm4.static.flickr.com/3357/4622703572_74db8af2a6_o.png" alt="hidden news in My Moodle" /></a></p>
<p style="font-size: 70%">The default for news for each course is &#8220;hidden&#8221;.</p>
</div>
<p>Nothing fancy, and even as I look at it now I can think of improvements&#8230;</p>
<p>We just upgraded to 1.9.8 this semester, and because this snippet modifies Moodle core I had my developer Kevin re-test the snippet before I asked our server admin Paul to replace the existing function as follows:</p>
<pre>file Location:            '/course/lib.php'
file line:                    "800"
function to replace: "function print_overview($courses)"
</pre>
<p>Here&#8217;s the actual replacement function:</p>
<div style="margin: 1em 0em;padding: .75em;border: 1px solid gray font-family: Courier New,monospace;font-size: 75%">
// Begin My Moodle Show-Hide News modification</p>
<p>// Replaces function in &#8220;course/lib.php&#8221; to hide course news by default.<br />
// Hidden news is viewable via Javascript by clicking &#8220;There is news in this course&#8221; link.<br />
// Link does not exist if there is no news in the course.<br />
function print_overview($courses) {</p>
<p>&nbsp;&nbsp;&nbsp;global $CFG, $USER;</p>
<p>&nbsp;&nbsp;&nbsp;$htmlarray = array();</p>
<p>&nbsp;&nbsp;&nbsp;if ($modules = get_records(&#8216;modules&#8217;)) {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach ($modules as $mod) {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (file_exists(dirname(dirname(__FILE__)).&#8217;/mod/&#8217;.$mod-&gt;name.&#8217;/lib.php&#8217;)) {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;include_once(dirname(dirname(__FILE__)).&#8217;/mod/&#8217;.$mod-&gt;name.&#8217;/lib.php&#8217;);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$fname = $mod-&gt;name.&#8217;_print_overview&#8217;;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (function_exists($fname)) {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$fname($courses,$htmlarray);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</p>
<p>&nbsp;&nbsp;&nbsp;}</p>
<p>&nbsp;&nbsp;&nbsp;foreach ($courses as $course) {</p>
<p>&nbsp;&nbsp;&nbsp;   print &#8220;&lt;ul style=\&#8221;margin: 0; padding: 0; list-style: none; width: 96%; \&#8221;&gt;&#8221;;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$linkcss = &#8221;;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (empty($course-&gt;visible)) {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$linkcss = &#8216;class=&#8221;dimmed&#8221;&#8216;;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&#8217;&lt;li class=&#8221;coursebox&#8221; style=&#8221;padding: .5em 1em 1em&#8221;&gt;&lt;h3 style=&#8221;font-size: 120%; font-weight: normal; margin: 0 0 .2em 0&#8243;&gt;&lt;a title=&#8221;&#8216;. format_string($course-&gt;fullname).&#8217;&#8221; &#8216;.$linkcss.&#8217; href=&#8221;&#8216;.$CFG-&gt;wwwroot.&#8217;/course/view.php?id=&#8217;.$course-&gt;id.&#8217;&#8221;&gt;&#8217;. format_string($course-&gt;fullname).&#8217;&lt;/a&gt;&lt;/h3&gt;&#8217;;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (array_key_exists($course-&gt;id,$htmlarray)) {</p>
<p>			print &#8216;&lt;a href=&#8221;#&#8221; id=&#8221;toggler_&#8217;.$course-&gt;id.&#8217;&#8221; onclick=&#8221;document.getElementById(\&#8217;coursenews_&#8217;.$course-&gt;id.&#8217;\').style.display=(document.getElementById(\&#8217;coursenews_&#8217;.$course-&gt;id.&#8217;\').style.display==\&#8217;block\&#8217;?\&#8217;none\&#8217;:\&#8217;block\&#8217;); document.getElementById(\&#8217;toggler_&#8217;.$course-&gt;id.&#8217;\').innerHTML=(document.getElementById(\&#8217;toggler_&#8217;.$course-&gt;id.&#8217;\').innerHTML == \&#8217;There is news in this course&#8230;\&#8217;?\&#8217;Hide course news&#8230;\&#8217;:\&#8217;There is news in this course&#8230;\&#8217;);&#8221;&gt;There is news in this course&#8230;&lt;/a&gt;&lt;div id=&#8221;coursenews_&#8217;.$course-&gt;id.&#8217;&#8221; style=&#8221;display: none&#8221;&gt;&#8217;;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach ($htmlarray[$course-&gt;id] as $modname =&gt; $html) {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo $html;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</p>
<p>			print &#8220;&lt;/div&gt;&lt;!&#8211;end contents&#8211;&gt;&lt;/li&gt;&#8221;;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print &#8220;&lt;/ul&gt;&#8221;;</p>
<p>&nbsp;&nbsp;&nbsp;}</p>
<p>}<br />
//End My Moodle Show-Hide News modification
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://jaredstein.org/2010/05/19/condensing-the-news-feature-of-my-moodle-using-a-showhide-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Joy of CSS max-width</title>
		<link>http://jaredstein.org/2010/04/07/the-joy-of-css-max-width/</link>
		<comments>http://jaredstein.org/2010/04/07/the-joy-of-css-max-width/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 15:38:37 +0000</pubDate>
		<dc:creator>Jared Stein</dc:creator>
				<category><![CDATA[web]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[max-width]]></category>

		<guid isPermaLink="false">http://jaredstein.org/?p=1129</guid>
		<description><![CDATA[The CSS max-width property has long been a favorite of mine, most often used to restrict the flow of content depending on the user&#8217;s browser, such as we see in elastic layouts. Since I began making WordPress themes a couple years ago I&#8217;ve used max-width as a staple rule for media in my stylesheet, starting [...]]]></description>
			<content:encoded><![CDATA[<p>The CSS <a href="http://www.w3schools.com/css/pr_dim_max-width.asp">max-width property</a> has long been a favorite of mine, most often used to restrict the flow of content depending on the user&#8217;s browser, such as we see in <a href="http://www.alistapart.com/articles/elastic/">elastic layouts</a>. Since I began making <a href="http://wordpress.org">WordPress</a> themes a couple years ago I&#8217;ve used max-width as a staple rule for media in my stylesheet, starting with images that might appear in a post (e.g. .post)<span id="more-1129"></span>:</p>
<pre>
.post img { max-width: 100%; }
</pre>
<p>This prevents the sort of thing we often see when an image is slapped into a blog post without being resized especially for that design. Here&#8217;s an example this just popped up in my Google Reader:</p>
<div>
<a href="http://jaredstein.org/files/2010/04/Big-Dog-Little-Dog-Performance-and-ADDIE-Models_1270661882553.jpeg"><img src="http://jaredstein.org/files/2010/04/Big-Dog-Little-Dog-Performance-and-ADDIE-Models_1270661882553.jpeg" alt="Big Dog, Little Dog- Performance and ADDIE Models_1270661882553" /></a>
</div>
<p>In addition to preventing IMGs from breaking out of the box (or, worse, growing the box) this can be applied to other elements as well. In the case of my themes&#8217; CSS I also include OBJECT (and, just to be safe, EMBED):</p>
<pre>
.post img, .post object, .post embed { max-width: 100%; }
</pre>
<p>With the entrance of HTML 5 one can imagine adding/replacing <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html">AUDIO and VIDEO</a> in this list of selectors.</p>
<p>I&#8217;m thinking about this today because on Twitter <a href="http://www.zeldman.com/">Jeffrey Zeldman</a> <a href="http://twitter.com/zeldman/status/11755947217">RT&#8217;ed Stephanie Hobson quoting Ethan Marcotte</a>:</p>
<div>
<a href="http://twitter.com/zeldman/status/11755947217"><img src="http://jaredstein.org/files/2010/04/zeldman-000.jpg" alt="zeldman RT" /></a>
</div>
<p>This is a fine solution, and reminded me that just last week I was talking with colleague Ken Woodward  applying max-width in a more generic fashion&#8211;more generic, even, than to all IMGs:</p>
<pre>
div * { max-width: 100%; }
</pre>
<p>This is very broad, of course, and could cause problems in a number of particular designs, however I&#8217;m thinking the principle is still valid, particularly as it applies to <a href="http://www.w3.org/TR/CSS2/visuren.html#inline-formatting">inline elements, for the W3 reminds us</a>:</p>
<blockquote><p>If an inline box cannot be split (e.g., if the inline box contains a single character, or language specific word breaking rules disallow a break within the inline box, or if the inline box is affected by a white-space value of nowrap or pre), then the inline box overflows the line box. </p></blockquote>
<p>Why wouldn&#8217;t I just write the rule without the DIV ancestor? Most elements that I need to control naturally fall within a DIV, and this limitation helps me feel safer, though I haven&#8217;t done enough testing to see how when/where it might fail. I am certain there is probably not enough specificity to override width problems that may be caused by miscalculated pixel widths of directly targeted descendant elements (i.e. DIVs), but those should probably have been done in percentages anyway. <a href="http://www.stuffandnonsense.co.uk/archives/css_specificity_wars.html">If specificity is a problem</a>, adding a relevant parent CLASS or ID to the selector could probably solve it.</p>
]]></content:encoded>
			<wfw:commentRss>http://jaredstein.org/2010/04/07/the-joy-of-css-max-width/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blackboard Vista Triggers Quirks Mode</title>
		<link>http://jaredstein.org/2009/04/02/blackboard-vista-triggers-quirks-mode/</link>
		<comments>http://jaredstein.org/2009/04/02/blackboard-vista-triggers-quirks-mode/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 16:25:20 +0000</pubDate>
		<dc:creator>Jared Stein</dc:creator>
				<category><![CDATA[blackboard]]></category>
		<category><![CDATA[web dev]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[quirks mode]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[vista]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://flexknowlogy.learningfield.org/?p=626</guid>
		<description><![CDATA[Ever been annoyed by Blackboard Vista&#8217;s (or Campus Edition 6+&#8217;s) rendering of your XHTML + CSS web pages? Yeah, me too&#8211;especially on Internet Explorer. This happens because Bb Vista triggers a browser&#8217;s quirks mode in spite of DOCTYPEs and validated markup.

More than just troublesome for pretty CSS-based pages, quirks mode, triggered on standards-compliant pages, can [...]]]></description>
			<content:encoded><![CDATA[<p>Ever been annoyed by Blackboard Vista&#8217;s (or Campus Edition 6+&#8217;s) rendering of your XHTML + CSS web pages? Yeah, me too&#8211;especially on Internet Explorer. This happens because Bb Vista triggers a browser&#8217;s <a href="http://www.quirksmode.org/css/quirksmode.html">quirks mode</a> in spite of <a href="http://www.w3.org/QA/2002/04/valid-dtd-list.html">DOCTYPE</a>s and <a href="http://www.w3.org/QA/2002/04/valid-dtd-list.html">validated markup</a><span id="more-626"></span>.
</p>
<p>More than just troublesome for pretty CSS-based pages, quirks mode, triggered on standards-compliant pages, can negatively affect the usability and functionality of the learning experience. For example, we use an <a href="http://uvsc.edu/disted/gamegarden/">inline quizzing</a> Javascript that renders questions and answer choices and feedback based on standards mode CSS. In quirks mode this self-assessment tool is useless.</p>
<h3>Blackboard Was Made For Quirks</h3>
<p>
Basically quirks mode means the browser thinks your web skills are not up to snuff, and the browser therefore renders your CSS in a non-standard fashion. Quirks mode is triggered when a DOCTYPE, e.g.:</p>
<pre style="font-size: 90%">
<code>
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
</code>
</pre>
<p>&#8230;is missing, or invalid, or unknown, or not where it should be (i.e. the first line of the document).</p>
<div><img style="border: 1px solid" src="http://flexknowlogy.learningfield.org/files/2009/04/wikis51.jpg" alt="" /></p>
<div style="font-size: 80%">
<em>javascript:alert(document.compatMode)</em> pasted into the Internet Explorer address bar kindly informs us that this browser is rendering <a href="http://resources.qooxdoo.org/download/advanced_boxtest/box_test_standard.html">this page</a> in quirks mode. Firefox will tell you if you go to <em>Tools &gt; Page Info</em>. <a href="http://resources.qooxdoo.org/download/advanced_boxtest/box_test_standard.html">Advanced Box Model Test</a></div>
</div>
<p>But even if you&#8217;ve been careful to put a valid DOCTYPE into your web pages, once it&#8217;s loaded up into Bb Vista and linked to, either from a Folder or a Learning Module, the browser will go into quirks mode. Why does this happen? Simple: <strong>Bb Vista inserts XHTML and JavaScript at the beginning of all web pages onload.</strong> <a href="http://field.5tein.com/files/2009/04/quirkstest1.png">140+ lines</a> of it, to be exact. It&#8217;s an odious thing to do, but, what do you expect? It&#8217;s Blackboard.
</p>
<p>It may (or may not) be important to note that <strong>this does not happen when viewing a page in the File Manager</strong>&#8211;only when a page is loaded from a link within the course.</p>
<h3>What You Can Do</h3>
<p>Not much. And yet this could be <strong>a big issue for Internet Explorer users</strong> (FireFox renders page in quirks mode [not <a href="https://developer.mozilla.org/en/Mozilla%27s_DOCTYPE_sniffing#Almost_Standards_Mode">"Almost Standards Mode"</a> as I'd hoped], yet most standards-compliant XHTML and CSS still render well).
</p>
<p>And though <a href="http://marketshare.hitslink.com/browser-market-share.aspx?qprid=2">most users are still on IE 6 or 7</a> I had some hope for a way out with Internet Explorer 8. You see,  <a href="http://msdn.microsoft.com/en-us/library/dd565650(VS.85).aspx">Microsoft promised that &#8220;a page explicitly opts into standards mode&#8221; when it includes &#8220;a metatag in the page that specifies IE=8 or IE=EmulateIE8&#8243;</a>. For example:</p>
<pre style="font-size: 90%">
<code>&lt;meta http-equiv="X-UA-Compatible" content="IE=IE8" /&gt;
</code>
</pre>
<p>In practice, however, this META tag alone does not force IE8 into standards mode in Bb Vista&#8211;the misplaced XHTML is apparently too much for IE8 to ignore.</p>
<p>So the most practical solutions I can think of are:</p>
<ol>
<li>
<p>
<strong>Write custom CSS for Blackboard</strong> that renders (or re-renders) the page according to <a href="http://en.wikipedia.org/wiki/Internet_Explorer_box_model_bug">the quirks mode box model</a>. This could be done using <a href="">Internet Explorer conditional comments</a>, for example:</p>
<pre style="font-size: 90%">
<code>
&lt;!--[if IE ]&gt;
  &lt;link href="ie-quirks.css" rel="stylesheet" type="text/css" /&gt;
&lt;![endif]--&gt;
</code>
</pre>
<p>I haven&#8217;t yet considered what CSS rules would need to be written to accommodate this, but <em>if it was possible</em> this seem like the most robust and efficient solution.</p>
</li>
<li><strong>Rewrite the page with Javascript.</strong> After Bb has loaded (or begun to load) the page, Javascript triggers a full rewrite of the page, either wiping out or rewriting the Bb XHTML and Javascript in a more appropriate location (e.g. in a targeted, ID&#8217;ed element). I&#8217;ve asked one of my developers to try this out today, but already fear the additional load time it might put on the Bb-hosted page.</li>
</ol>
<p>Any other ideas?</p>
<p>If this were only about appearance I wouldn&#8217;t be raising a fuss, but this can and does affect the usability of certain e-learning tools, and forces developers to ask, &#8220;How will this work in Blackboard?&#8221; yet again.</p>
]]></content:encoded>
			<wfw:commentRss>http://jaredstein.org/2009/04/02/blackboard-vista-triggers-quirks-mode/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Re. &#8220;CSS Angles&#8221; and the Future of Em-Based Scaling</title>
		<link>http://jaredstein.org/2008/12/03/re-css-angles-and-the-future-of-em-based-scaling/</link>
		<comments>http://jaredstein.org/2008/12/03/re-css-angles-and-the-future-of-em-based-scaling/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 18:43:37 +0000</pubDate>
		<dc:creator>Jared Stein</dc:creator>
				<category><![CDATA[web dev]]></category>
		<category><![CDATA[angles]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[em]]></category>
		<category><![CDATA[scaling]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://flexknowlogy.learningfield.org/?p=117</guid>
		<description><![CDATA[Sitepoint offered up an article by Tim Wright (CSSKarma), CSS Angles:  Just the Edge Your Web Page Needs!, which shows that increasing the size of a single border property results in an angular object that can be placed behind things. After some experimentation I found a new solution and a new conundrum.
Tim&#8217;s applied this [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sitepoint.com/">Sitepoint</a> offered up an article by <a href="http://www.csskarma.com/">Tim Wright (CSSKarma)</a>, <cite><a href="http://www.sitepoint.com/article/css-angles-the-edge-you-need/">CSS Angles:  Just the Edge Your Web Page Needs!</a></cite>, which shows that increasing the size of a single <strong>border</strong> property results in an angular object that can be placed behind things. After some experimentation I found a new solution and a new conundrum<span id="more-117"></span>.</p>
<p>Tim&#8217;s applied this to <a href="http://i2.sitepoint.com/graphics/1692_shelf.jpg">&#8220;shelf shadows&#8221;</a>, where a nav item appears to be propped up on a shelf with a shadow below:</p>
<div><a href="http://i2.sitepoint.com/graphics/1692_shelf.jpg"><img src="http://i2.sitepoint.com/graphics/1692_shelf.jpg" alt="shelf" /></a></div>
<p>I looked at the CSS and thought, &#8220;This is cute, but could be more elegant with just two 1kb images.&#8221; <a href="/resources/stein/web/shelf/shelf1.html">So I wrote it,</a> and it turned out fine. In fact, it turned out better, in my opinion, because the shadow edges were <a href="http://en.wikipedia.org/wiki/Anti-aliasing">anti-aliased</a>.  I showed my developer <a href="http://www.facebook.com/people/Tyrel-Kelsey/1166354283">Tyrel Kelsey</a> the results, then bragged, &#8220;I can even make both the shadows and the shelf size scale with the text.&#8221; Then <a href="/resources/stein/web/shelf/shelf2.html">whipped up that solution</a> as well.</p>
<p>In short, <a href="/resources/stein/web/shelf/shelf1.html">my first solution</a> used two images: a x-repeating <a href="/resources/stein/web/shelf/images/shelf1.png">1&#215;20 &#8220;shelf&#8221;</a> hooked to the UL, and <a href="/resources/stein/web/shelf/images/shadow1.png">a 10&#215;20 &#8220;shadow&#8221;</a> hooked to each LI in place of Tim&#8217;s border corner.</p>
<p><a href="/resources/stein/web/shelf/shelf2.html">My second solution</a> used <a href="/resources/stein/web/shelf/images/shelf2.png">a 1px square for the top &#8220;shelf&#8221;</a>, and a 1px border&#8211;both hooked to the UL. The top shelf was set 1em from the top to allow for scaling.</p>
<p><a href="/resources/stein/web/shelf/images/shadow2.png">The &#8220;shadow&#8221; was a much larger image, 100&#215;200</a>, and set .1em to the left and 1em from the top of each LI, thus masking it&#8217;s gargantuaness (similar to <a href="http://www.alistapart.com/articles/slidingdoors/">sliding doors</a>).</p>
<p>It was a slick application for the same effect, but then Tyrel popped my balooon.</p>
<p>&#8220;Are you on FireFox 3?&#8221; Tyrel asked. &#8220;Because mine already scales on FF3, and it doesn&#8217;t look all jagged like yours.&#8221;</p>
<p><strong>Page zoom.</strong> I still am on FF2, and I remembered earlier in the week how I embarrassed myself in the web design course I teach when the page zoom disturbed an effect I was demonstrating. In fact, a lot of the <a href="http://www.w3.org/WAI/GL/css2em.htm">em-based</a> scaling approaches so popular just a year ago are sliding towards obsolescence thanks to <a href="http://blogs.msdn.com/ie/archive/2006/02/07/526805.aspx">page zoom on IE 7+</a> and <a href="http://arstechnica.com/journals/linux.ars/2007/07/27/firefox-3-gets-full-page-zoom">now on FF3 as well.</a>.</p>
<p>Not only are they made obsolete, current CSS-based designs that are <a href="http://www.456bereastreet.com/archive/200504/fixed_or_fluid_width_elastic/">enhanced by the elasticity (e.g. layouts with reading-width columns</a> or <a href="http://www.alistapart.com/articles/slidingdoors/">other applications of em-based scaling (e.g. sliding doors)</a> may look worse with page zoom.  My second example sure did when scaled in IE7. And if you open my design 2 on FF3 and compare the page zoomed rendering to the rendering with Zoom Text Only turned on, you&#8217;ll agree that the clarity is compromised in the former.</p>
<p>So while I&#8217;m proud of <a href="/resources/stein/web/shelf/shelf2.html">my two CSS variations</a> on <a href="http://www.sitepoint.com/article/css-angles-the-edge-you-need/">Tim Wright&#8217;s shelf-and-shadow concept</a>, and they are great solutions for older browsers (I can&#8217;t believe I&#8217;m referring to FF2 as &#8220;older&#8221;!), it&#8217;s also clear to me that em-based scaling and elasticity is on it&#8217;s way out, and browser-based page zoom will solve a lot of designer&#8217;s accessibility-influenced design challenges&#8211;but not, perhaps, without affecting our &#8220;tricks&#8221; of the past.</p>
]]></content:encoded>
			<wfw:commentRss>http://jaredstein.org/2008/12/03/re-css-angles-and-the-future-of-em-based-scaling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
