<?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"
	>

<channel>
	<title>unitstep.net &#187; CSS</title>
	<atom:link href="http://unitstep.net/blog/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://unitstep.net</link>
	<description>the home of peter chng</description>
	<pubDate>Tue, 18 Nov 2008 02:09:57 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<item>
		<title>IE7 still not up to task on CSS</title>
		<link>http://unitstep.net/blog/2006/08/10/ie7-still-not-up-to-task-on-css/</link>
		<comments>http://unitstep.net/blog/2006/08/10/ie7-still-not-up-to-task-on-css/#comments</comments>
		<pubDate>Thu, 10 Aug 2006 23:53:29 +0000</pubDate>
		<dc:creator>Peter Chng</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[browsers]]></category>

		<category><![CDATA[internet explorer]]></category>

		<category><![CDATA[microsoft]]></category>

		<category><![CDATA[standards]]></category>

		<guid isPermaLink="false">http://unitstep.net/blog/2006/08/10/ie7-still-not-up-to-task-on-css/</guid>
		<description><![CDATA[With all the attention IE7 has been getting and the long development time, (Internet Explorer 6, the last major version, was released almost five years ago), you&#8217;d think Microsoft would have devoted a lot more time to following web standards this time around.  Unfortunately, things are not looking so good in this respect.  [...]]]></description>
			<content:encoded><![CDATA[<p>With all the attention IE7 has been getting and the long development time, (Internet Explorer 6, the last major version, was released almost <em>five years ago</em>), you&#8217;d think Microsoft would have devoted a lot more time to following web standards this time around.  Unfortunately, <a href="http://www.webdevout.net/browser_support_summary.php?uas=IE6-IE7-FX1_5-OP8-OP9">things are not looking so good</a> in this respect.  </p>
<p>While everyone (myself included) has applauded Microsoft for making <a href="http://blogs.msdn.com/ie/archive/2006/01/23/516393.aspx">moves towards supporting standards</a>, a mere slight improvement over IE6 is not enough this time.  I mean, come on - they&#8217;re Microsoft, one of the largest software companies out there.  Why can&#8217;t they seem to get things right?</p>
<h3>The bane of web developers and designers</h3>
<p>It&#8217;s a well-known secret among those involved in making websites that IE6 is <em>horrible</em> when it comes to supporting <acronym class="uttInitialism" title="Cascading Style Sheets">CSS</acronym> (Cascading Style Sheets), a format for defining how webpages should be presented.  Provided you&#8217;re not <a href="http://unitstep.net/blog/2006/08/06/why-flash-based-websites-are-bad/">doing everything in Flash</a>, and care about <a href="http://unitstep.net/blog/2006/08/06/why-poorly-designed-websites-persist/">web standards</a>, you&#8217;ll quickly find that you have to learn <acronym class="uttInitialism" title="Cascading Style Sheets">CSS</acronym> in addition to (X)<acronym class="uttInitialism" title="HyperText Markup Language">HTML</acronym> if you want to properly design a website, possibly in addition to server-side technologies.  </p>
<p>Designing your first website using <acronym class="uttInitialism" title="Cascading Style Sheets">CSS</acronym> for the presentation, you&#8217;ll quickly find that IE6 is the odd one out, and hardest one to &#8220;make things look right&#8221; in.  Out of all the <a href="http://www.w3.org/TR/CSS21/">selectors in <acronym class="uttInitialism" title="Cascading Style Sheets">CSS</acronym> 2.1</a>, IE6 only supports a <a href="http://www.quirksmode.org/css/contents.html">few of them</a>.  Additionally, many of the pseudo-selectors, such as <code>:hover</code>, only work on certain elements.  Boo-urns!</p>
<p>As most web developers/designers have switched over to a different browser, either by choice (Firefox/Opera) or because of necessity (Safari), they&#8217;ll quickly find themselves always having to refer back to IE6 to &#8220;fix&#8221; the site once things are already looking great in the other browsers.  Thus, IE6 has been the target of many a web designer&#8217;s curses throughout the course of history. (Perhaps similar to how Netscape 4 caused many headaches years ago - but maybe not as bad as that!)</p>
<h3>Corporate lethargy</h3>
<p>Some would suggest this is merely the result of Microsoft growing too large and becoming a dinosaur of sorts, not able to respond to changes in the marketplace.  A good example of this is their <a href="http://live.com">Live-series</a> of web-based services and applications, most of which seem to be inferior to competing products offered by other companies.  In this respect, it seems that Microsoft caught on a little too late to this trend.</p>
<p>However, I don&#8217;t think this is the case with IE7.  Microsoft, by all accounts, has talented people working for them - there&#8217;s just no way they could have become so successful without talent.  Microsoft research in particular has some <em>really</em> smart people working for it - an MS researcher recently visited our lab last month, and I was impressed not only by his depth of knowledge in his field, but also his breadth of knowledge.  He seemed to know, in quite some detail, about each of the areas the people in my lab were engaged in.</p>
<h3>Shunning standards?</h3>
<p>Therefore, it seems that solving a problem like making IE7 standards-compliant can&#8217;t be <em>that big</em> of a problem.  I mean, they have had five years - and other companies like Mozilla and Opera have made browsers that fairly standards compliant, with Opera being a bit better than Firefox at <a href="http://www.webstandards.org/action/acid2/">standards support</a>. One argument could be that they don&#8217;t want to release a browser that&#8217;s so different from IE6 that sites will &#8220;break&#8221; on the new IE7.  This isn&#8217;t accurate though, as they&#8217;ve already made enough changes to virtually guarantee that sites &#8220;made for IE6&#8243; will break on IE7.  </p>
<p>As much as I hate to say it, some believe that IE7&#8217;s lack of support for standards is something that&#8217;s been deliberately &#8220;implemented&#8221;.  HÃ¥kon Wium Lie, of Opera software, best <a href="http://interviews.slashdot.org/article.pl?sid=06/06/23/1443203">sums it up</a> in an interview on Slashdot:</p>
<blockquote><p>
It&#8217;s quite clear that Microsoft has the resources and talent to support CSS2 fully in IE and that plenty of people have reminded them why this is important. So, why don&#8217;t they do it? The fundamental reason, I believe, is that standards don&#8217;t benefit monopolists. Accepted, well-functioning, standards lower the barrier of entry to a market, and is therefore a threat to a monopolist.</p>
<p>From that perspective, it makes sense to leave CSS2 half-implemented. You can claim support (and many journalists will believe you), and you also ensure that no-one can use the unimplemented (or worse: buggily implemented) features of the standard. The only way to change the equation is to remind Microsoft how embarrassing it is to offer a sub-standard browser. And to use better browsers.
</p></blockquote>
<p>What he&#8217;s saying is certainly plausible - Microsoft has been known to engage in anti-competitive practices, and after all, anti-competitives practices are really sound (but perhaps not ethical) business strategies that only become available when you&#8217;re the clear market leader.  And, when you have shareholders always squeezing you to make more money, sometimes business strategy can take a more sinister direction.</p>
<p>I want to stop short of actually declaring MS to be engaging in anti-competitive strategies here (though a compelling argument could be made for this), but I will say that the effects of their actions, for whatever motivations, are horrible for web development.  Internet Explorer 6 was a big enough problem, as since it&#8217;s the majority market holder, professionals in website development <em>had</em> to account for it - there&#8217;s just no saying &#8220;Screw non-standard browsers&#8221;, when your expected client base is 80% (or higher) IE6.  And, with the release of IE7 (to be pushed to users <a href="http://news.com.com/Microsoft+tags+IE+7+high+priority+update/2100-7350_3-6098500.html?tag=nefd.lede">automatically</a>), more problems will be created: sites made to work with IE6 will probably not work too well in IE7, and vice-versa.  Clever tricks, whether through <acronym class="uttInitialism" title="Cascading Style Sheets">CSS</acronym> or JavaScript will eventually provide work-arounds, but all of this adds substantially to the development time for a site.  </p>
<p>So much for the chant, <a href="http://www.ntk.net/ballmer/mirrors.html">&#8220;Developers, developers, developers!&#8221;</a>  Microsoft, please fix IE7 before it&#8217;s widely released, and you&#8217;ll be sure to receive heartfelt thanks from many formerly-frustrated developers out there.</p>
<hr/>Copyright &copy; 2008 <strong><a href="http://unitstep.net">unitstep.net</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact <strong><a href="mailto:webmaster@unitstep.net">webmaster@unitstep.net</a></strong> for more information.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>]]></content:encoded>
			<wfw:commentRss>http://unitstep.net/blog/2006/08/10/ie7-still-not-up-to-task-on-css/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Switchin&#8217; styles</title>
		<link>http://unitstep.net/blog/2006/07/16/switchin-styles/</link>
		<comments>http://unitstep.net/blog/2006/07/16/switchin-styles/#comments</comments>
		<pubDate>Mon, 17 Jul 2006 02:35:03 +0000</pubDate>
		<dc:creator>Peter Chng</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Colophon]]></category>

		<category><![CDATA[Design]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://unitstep.net/blog/2006/07/16/switchin-styles/</guid>
		<description><![CDATA[I finally added in a style switcher, to allow users to select between viewing the site in either a fluid or fixed (default) width layout.  Up until now, the layout has been a fixed one, restricted to a width of 780 pixels, so that it remains usable in even 800&#215;600 resolution screens.  Before [...]]]></description>
			<content:encoded><![CDATA[<p>I finally added in a <a href="http://www.alistapart.com/stories/alternate/">style switcher</a>, to allow users to select between viewing the site in either a fluid or fixed (default) width layout.  Up until now, the layout has been a fixed one, restricted to a width of 780 pixels, so that it remains usable in even 800&#215;600 resolution screens.  Before you so smugly point out that hardly anyone you know runs at 800&#215;600 anymore, <a href="http://www.w3schools.com/browsers/browsers_stats.asp">recent facts</a> seem to indicate that up to 1 in 5 screens are still at this resolution - so you must be able to design for this, as having to scroll horizontally <strong>greatly</strong> reduces usability. </p>
<p>However, this design constraint also imposes some problems on people with higher resolution screens who want the website to use more of the available space.  (I personally run at 1280&#215;1024, but prefer the smaller, fixed width as easier to read due to the smaller line lengths.) Well, taking a cue from <a href="http://simplebits.com/">some websites</a> out there, I decided to implement a style sheet switcher that would allow users to pick which format they wanted.  It&#8217;s now available - see that icon in the upper right corner that looks like this?</p>
<p class="image"><img src="/images/icons/silk/layout_content.png" alt="Style sheet switcher" /></p>
<p>Simply click on it to toggle between a fixed a fluid-width layout, and view this site how you like it.  At this time, I have no plans to add other different styles, as in my mind a simple switcher like this is all that&#8217;s needed.  And, I don&#8217;t really feel like a re-design at this time; I think this current design is good at least for a few more months.  (On a somewhat unrelated note, I&#8217;m currently working on a WordPress theme for public release though, stay tuned for more details.)</p>
<h3>How&#8217;s it work?</h3>
<p>The script I used was an older one, written by <a href="http://www.alistapart.com/stories/alternate/">Paul Sowden</a> for A List Apart.  It&#8217;s almost five years old, but still works great with a few slight changes.  What&#8217;s cool about it is that it saves your selected style in a cookie, so upon return, the website will know which format you prefer.  So, while Firefox users have always had the ability to switch style sheets, this script adds to that by saving the user&#8217;s selection for future reference.  The script also works fairly well across browsers; I&#8217;ve tested it in the latest versions of Firefox, IE and Opera.</p>
<p>I&#8217;ve also made it so that the script downgrades well - if for some reason, JavaScript is not enabled on a user&#8217;s browser, the style switcher icon will not be present.  They will still be able to switch styles if their browser provides this functionality, though.</p>
<p>One hitch I ran into was with the use of this script with the <a href="http://dean.edwards.name/IE7/">IE7 fixes library</a> by Dean Edwards.  Using IE6, the style switcher doesn&#8217;t quite work; when clicked, the styles do not toggle, but the settings are saved via cookies.  Thus, a reload of the page is needed to see the effect - not exactly ideal, and it makes it look completely broken.  So, for the time being, I&#8217;ve disabled the IE7 fixes, and so far, nothing seems to be whacky with the layout of the site when viewed in IE6. (Dropping the IE7 scripts also will save about 24 KB in bandwidth per page viewed in IE as well.) There are other javascript style sheet switchers out there, so I may give them a try to see if they&#8217;re compatible, or if I have even more time, try to write my own.  But the &#8220;problem&#8221; might be with the IE7 fixes.</p>
<p>Not that I mean to putdown the IE7 fixes - they&#8217;ve been a great asset at times when I&#8217;ve been too frustrated to figure out why IE was borking on some piece of <acronym class="uttInitialism" title="Cascading Style Sheets">CSS</acronym>.  I highly <a href="http://dean.edwards.name/IE7/">recommend IE7</a> if you&#8217;ve been pulling your hair out over some layout problem.  I haven&#8217;t yet had a &#8220;real&#8221; problem with it, but as always, I try to use this sorts of fixes as a last resort - let&#8217;s see how long I can hold out for, and <a href="/contact">let me know</a> if you notice any layout problems.</p>
<hr/>Copyright &copy; 2008 <strong><a href="http://unitstep.net">unitstep.net</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact <strong><a href="mailto:webmaster@unitstep.net">webmaster@unitstep.net</a></strong> for more information.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>]]></content:encoded>
			<wfw:commentRss>http://unitstep.net/blog/2006/07/16/switchin-styles/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CBC.ca redesign</title>
		<link>http://unitstep.net/blog/2006/06/03/cbcca-redesign/</link>
		<comments>http://unitstep.net/blog/2006/06/03/cbcca-redesign/#comments</comments>
		<pubDate>Sat, 03 Jun 2006 19:40:19 +0000</pubDate>
		<dc:creator>Peter Chng</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Design]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[standards]]></category>

		<guid isPermaLink="false">http://www.unitstep.net/blog/2006/06/03/cbcca-redesign/</guid>
		<description><![CDATA[If you visit CBC.ca for everyday for news, like I do, you&#8217;ll have noticed their newly-designed website that went live today.  My initial impressions were very positive - right away I noticed the new site had paid good attention to detail, in regards to web-standards, semantics, good design and the like.
For most people, this [...]]]></description>
			<content:encoded><![CDATA[<p>If you visit <a href="http://www.cbc.ca"><abbr title="Canadian Broadcasting Corporation">CBC</abbr>.ca</a> for everyday for news, like I do, you&#8217;ll have noticed their newly-designed website that went live today.  My initial impressions were very positive - right away I noticed the new site had paid good attention to detail, in regards to web-standards, semantics, good design and the like.</p>
<p>For most people, this change will amount to the new layout and styles applied to the website.  This amounts to a greater focus on today&#8217;s &#8220;Top Story&#8221;, as well as special features such as their kids section and online radio.  Online feature stories were also given greater precendence over mere headlines, which were moved below into neatly organized panels - an overall greater focus on in-depth online articles, rather than just everyday news headlines.  The new design definitely looks &#8220;more busy&#8221;, but not cluttered, in my opinion.</p>
<p class="image">
<a rel="lightbox[cbc]" title="The new CBC.ca" href="/wordpress/wp-content/uploads/2006/06/cbc-new.jpg"><img alt="New CBC website" id="image32" src="/wordpress/wp-content/uploads/2006/06/cbc-new-small.jpg" /></a> <a rel="lightbox[cbc]" title="The old CBC.ca" href="/wordpress/wp-content/uploads/2006/06/cbc-old.jpg"><img alt="Old CBC website" id="image33" src="/wordpress/wp-content/uploads/2006/06/cbc-old-small.jpg" /></a>
</p>
<p>It&#8217;s also interesting to note that the design folks at <abbr title="Canadian Broadcasting Corporation">CBC</abbr> took a lot of user input into account when doing the <a href="http://www.cbc.ca/launch/">redesign</a>.</p>
<blockquote><p>We embarked on the redesign process about 15 months ago, starting with a massive study conducted for us by Decima Research. The survey asked your opinions about dozens of elements of CBC.caâ€™s design, information architecture and content â€“ and, over just a few days, more than 5,000 of you filled it out for us.</p>
<p>The results of that survey, combined with the feedback we get daily through e-mails, phone calls and our online forms, formed the basis of this redesign. Our goal was to improve the site for you, by making it easier to use and giving you more of the features youâ€™d like to see.</p></blockquote>
<p>Overall, the site looks a lot more user-friendly, and definitely in step with &#8220;modern-looking&#8221; sites.  <abbr title="Really Simple Syndication"><acronym class="uttInitialism" title="Really Simple Syndication">RSS</acronym></abbr> feeds have also been added, something that was in dire need, especially on a news-oriented website.  The site may end up looking a lot like other news sites (<a href="http://www.cnn.com"><abbr title="Cable News Network">CNN.com</abbr></a> comes to mind), and while this may be criticized as a lack of creativity, sometimes congruence is helpful when browsing, to better give the sense that this is a news site, and not something else.</p>
<p>But of most interest to me was the transit to a standards-based, semantic website that properly separated content from style.  Upon a quick first inspection, the site appears to make good use of proper <a href="http://www.w3.org/MarkUp/" class="ubernym uttInitialism"><acronym class="uttInitialism" title="eXtensible HyperText Markup Language - HTML reformulated as XML">XHTML</acronym></a> elements, with not too many generic div elements used.  This should make the site more friendly and accessible to a variety of browsers, especially those for the visually-impaired.  The move also signals <abbr title="Canadian Broadcasting Corporation">CBC</abbr>&#8217;s commitment to web standards, something that, while having its share of growing pains, should help improve the state of the Web now and in the future.</p>
<p>The site also does a fairly good job on separating style graphics from content images - though the link images at the top should probably be put in place via <abbr title="Cascading Style Sheets"><acronym class="uttInitialism" title="Cascading Style Sheets">CSS</acronym></abbr>, and not be part of the markup.  Another more serious problem would be the use of inline Javascript; in particular, the use of Javascript to submit the search form should have been avoided, as seen in this attribute:</p>
<p><code>onclick="javascript:forms.gs.searchWeb.value='cbc';<br />
forms.gs.submit();" </code></p>
<p>I&#8217;m not sure what they&#8217;re using Javascript here for (as I haven&#8217;t bothered to look at everything), but chances are, whatever effect they are doing could be accomplished by using an external script file and then using event registration - all of the major browsers support this, and it results a better site because you don&#8217;t have messy inline Javascript calls in your markup.  They are also using several <code>onmouseover</code> attributes to dynamically change images, which again, can be accomplished in a cleaner way using event registration.</p>
<p>Which brings me to my next point, that while <abbr title="Canadian Broadcasting Corporation">CBC</abbr>.ca did a good job of separating content and style, they were a bit sloppy when it came to <a href="http://adactio.com/atmedia2005/">content and behaviour</a>.  While the styles and visual layout information were separated out in a style sheet file, the Javascript governing behaviour was not.  The mass of <code>onclick</code> and <code>onmouseover</code>/<code>onmouseout</code> attributes attests to this.</p>
<p>But don&#8217;t get me wrong.  I have a very favourable attitude towards the new <abbr title="Canadian Broadcasting Corporation">CBC</abbr>.ca, and I while I may seem nitpicky here, I applaud their efforts as a move in the right direction.</p>
<hr/>Copyright &copy; 2008 <strong><a href="http://unitstep.net">unitstep.net</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact <strong><a href="mailto:webmaster@unitstep.net">webmaster@unitstep.net</a></strong> for more information.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>]]></content:encoded>
			<wfw:commentRss>http://unitstep.net/blog/2006/06/03/cbcca-redesign/feed/</wfw:commentRss>
		</item>
		<item>
		<title>About separation of behaviour and presentation</title>
		<link>http://unitstep.net/blog/2004/09/19/about-separation-of-behaviour-and-presentation/</link>
		<comments>http://unitstep.net/blog/2004/09/19/about-separation-of-behaviour-and-presentation/#comments</comments>
		<pubDate>Sun, 19 Sep 2004 16:05:46 +0000</pubDate>
		<dc:creator>Peter Chng</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.unitstep.net/blog/archives/2004/09/19/about-separation-of-behaviour-and-presentation/</guid>
		<description><![CDATA[If any of you have visited SimpleBits (the personal site of Dan Cederholm), you&#8217;ll probably be aware of their great SimpleQuiz series of discussion-provoking questions that are mostly about semantics.  While I&#8217;m not a huge semantic nut (though I think semantics are useful, but at times impractical), one quiz caught my attention over the [...]]]></description>
			<content:encoded><![CDATA[<p>If any of you have visited <a href="http://www.simplebits.com">SimpleBits</a> (the personal site of Dan Cederholm), you&#8217;ll probably be aware of their great <a href="http://www.simplebits.com/notebook/simplequiz/index.html">SimpleQuiz</a> series of discussion-provoking questions that are mostly about semantics.  While I&#8217;m not a huge semantic nut (though I think semantics are useful, but at times impractical), one quiz caught my attention over the summer, and I&#8217;ve still been thinking about its topics for a while.</p>
<p>That quiz would be <a href="http://www.simplebits.com/notebook/2004/05/06/sq.html">SimpleQuiz XVI: Launching Windows</a>.  It proposes the question of what is the correct way to launch a new window for a hyperlink when it is clicked on.  Since <a href="http://www.w3.org/MarkUp/" class="ubernym uttInitialism"><acronym class="uttInitialism" title="eXtensible HyperText Markup Language - HTML reformulated as XML">XHTML</acronym></a> 1.0 Strict and <a href="http://www.w3.org/MarkUp/" class="ubernym uttInitialism"><acronym class="uttInitialism" title="eXtensible HyperText Markup Language - HTML reformulated as XML">XHTML</acronym></a> 1.1 (without the proper module) do not allow the <code>target</code> attribute, this is a problem when it comes to validation.  (<acronym class="uttInitialism" title="HyperText Markup Language">HTML</acronym> 4 Strict does also not allow the <code>target</code> attribute.)   A limited set of solutions is intially proposed, but the comments quickly provoke more questions, such as:  Should a website even be able to specify a new window for a link, to the chagrin of some users?</p>
<p>Many users felt that the answer to this such question should be a resounding &#8220;No&#8221;, as many people seem to be annoyed when the default behaviour of a clicked link is something else than they expect.  This is understandable, as most of the people who are responding are undoubtedly &#8220;power users&#8221; who have plenty of Internet browsing experience and well-defined habits.  However, many people are not like that and that nonwithstanding, I still think there are legitimate uses for launching a new window, for example, from a page that has been POST&#8217;d to, and as such, the web developer might not want the user to leave the page, which could perhaps expire the data.</p>
<p>Also, using the <code>target</code> attribute despite the fact that the attribute is not specified in those aforementioned DOCTYPEs is not an acceptable solution for those who take their validation seriously.  That leaves the option open to using <a href="http://www.w3.org/MarkUp/" class="ubernym uttInitialism"><acronym class="uttInitialism" title="eXtensible HyperText Markup Language - HTML reformulated as XML">XHTML</acronym></a> 1.0 Transitional, which I don&#8217;t believe is a problem, but many people will gawk at this suggestion as well.</p>
<p>Therefore, the solution of using JavaScript to perform the new window opening was suggested as the ideal solution, since, JavaScript should primarily be responsible for behaviour, and the opening of a new window is most definitely a behavioural aspect.  However, as many pointed out, the implementation of this solution matters heavily.  Simply putting an inline call to JavaScript in the <a href="http://www.w3.org/MarkUp/" class="ubernym uttInitialism"><acronym class="uttInitialism" title="eXtensible HyperText Markup Language - HTML reformulated as XML">XHTML</acronym></a> code is no better than non-separation of content and presentation, since inline JavaScript combines behaviour with content.</p>
<p>In the end, the solution I liked best was to assign a class to any link that you wanted to open in a new window, then use JavaScript to navigate the DOM and change the target property of such elements to <code>_blank</code>.  Though, some people will again go back to the first question, and say that you shouldn&#8217;t have any links open in a new window by default, and then back up this claim by saying that <a href="http://ln.hixie.ch/?start=1037202166&#038;count=1">the &#8220;semanticness&#8221;</a> is suspect.</p>
<p>A nicer solution would be to identify external links using different styling, and also have a JavaScript-enabled control on the page that could toggle the opening of such &#8220;external&#8221; links in new windows on or off.  I&#8217;ve seen this before, and so a moderate knowledge of JavaScript and <acronym class="uttInitialism" title="Cascading Style Sheets">CSS</acronym> would be all that was needed to make such a useful script.</p>
<p>But a bigger question that was raised in my mind was regarding the initial topic of separation of behaviour and style.  In the current version of <acronym class="uttInitialism" title="Cascading Style Sheets">CSS</acronym>, this may not be fully encouraged, in my opinion.  The small example I have is of the <code>:hover</code> pseudo-class used as a selector.  As many of you know, it allows the style of elements that recieve an &#8220;onmouseover&#8221; event to be specified.  But, should any style changes be implemented this way, since it explicitly uses <acronym class="uttInitialism" title="Cascading Style Sheets">CSS</acronym> to define a behavioural aspect, that is, what happens when the mouse pointer hovers over an element?  Don&#8217;t get me wrong - I&#8217;m not trying to preach to everyone, as I&#8217;ve always uses the <code>:hover</code> as a selector; it&#8217;s just much easier than using a JavaScript solution, which is entirely possible.</p>
<p>But, then again, using the <code>target</code> attribute is also easier.  Right now, I&#8217;m sort of confused - both appear to violate the separation of either behaviour and content or behaviour and presentation yet one is apparently condoned on the whole.</p>
<hr/>Copyright &copy; 2008 <strong><a href="http://unitstep.net">unitstep.net</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact <strong><a href="mailto:webmaster@unitstep.net">webmaster@unitstep.net</a></strong> for more information.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>]]></content:encoded>
			<wfw:commentRss>http://unitstep.net/blog/2004/09/19/about-separation-of-behaviour-and-presentation/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
