<?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>Booleangate &#187; CSS</title>
	<atom:link href="http://blog.booleangate.org/category/development/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.booleangate.org</link>
	<description>Blog of Wonders</description>
	<lastBuildDate>Thu, 29 Apr 2010 21:02:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>XBC: Cross-Browser Consistency</title>
		<link>http://blog.booleangate.org/development/xbc-cross-browser-consistency/</link>
		<comments>http://blog.booleangate.org/development/xbc-cross-browser-consistency/#comments</comments>
		<pubDate>Sat, 05 Jul 2008 18:00:03 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Cross-Browser Consistency]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[consistency]]></category>
		<category><![CDATA[cross-browser]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[functionality]]></category>
		<category><![CDATA[internet explorer (ie)]]></category>
		<category><![CDATA[libraries]]></category>
		<category><![CDATA[markup]]></category>
		<category><![CDATA[noscript]]></category>
		<category><![CDATA[operating systems]]></category>
		<category><![CDATA[resolution]]></category>
		<category><![CDATA[scalability]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[support]]></category>
		<category><![CDATA[xbc]]></category>
		<category><![CDATA[xslt]]></category>

		<guid isPermaLink="false">http://blog.booleangate.org/?p=7</guid>
		<description><![CDATA[Author&#8217;s note: This article was originally posted at Frye / Wiles, and has been re-posted here for consolidation.
When we talk about topics such about CSS, JavaScript, and sometimes even certain image formats (png24, I&#8217;m looking at you), and how they render in a client&#8217;s browser, we always, or should always also consider cross-browser behavior.  [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><em class="notice" title="2008-07-05">Author&#8217;s note: This article was originally posted at <a title="Original posting" rel="nofollow" href="http://blog.fryewiles.com/design/03-10-2008/xbc-cross-browser-consistency" target="_blank">Frye / Wiles</a>, and has been re-posted here for consolidation.</em></p></blockquote>
<p>When we talk about topics such about CSS, JavaScript, and sometimes even certain image formats (png24, I&#8217;m looking at you), and how they render in a client&#8217;s browser, we always, or <em>should always</em> also consider cross-browser behavior.  This behavior entails many things: CSS rendering, the availability of CSS specific attributes, whether or not the DOM interface will be the same, general JavaScript behavior — the list goes on and on.   And, since most discussions about CSS and JavaScript (at least the ones that I am having) also concern this variable nature, I&#8217;m coining (maybe I&#8217;m the first) a new term to put all of this into a handy little phrase, &#8220;<strong>Cross-Browser Consistency</strong>,&#8221; or, in typical programmer fashion, simply, &#8220;<strong>XBC</strong>.&#8221;</p>
<p>Let&#8217;s take a brief moment  to establish a more exact meaning for this phrase.   As you may well be aware, the industry commonly talks about <em>cross-browser support</em>, so we&#8217;ll differentiate between <em>support and consistency</em>, as well as defining what <em>cross-browser</em> really means, and some other tidbits as to boot.</p>
<p><span id="more-7"></span></p>
<p>As we all know, the plethora of browsers out there leave some websites in a world of hurt as soon as you access them via an unintended environment.  Between Firefox, Safari, Opera, and all the recent incarnations of Internet Explorer, there are a myriad of issues between the different browsers and their rendering results.  Usually the discussion is focused on aesthetics and, more specifically, how the CSS may render; however, we should broaden the scope of aesthetics to look at the resolution and operating system too as they all have a hand in the end result.  And don&#8217;t forget JavaScript!  That&#8217;s always pushed off to its own thread of discussion, but I think its important that we consider it here.  So, when talk about <strong>Cross-Browser Consistency</strong>, or <strong>XBC</strong>, we&#8217;ll need to be cognizant of two main areas: <em>aesthetics</em> and <em>functionality</em>.</p>
<h2>Aesthetics</h2>
<p>Browser aesthetics is not simply limited to how HTML and CSS are rendered, the concerns of which have already been discussed at length in various articles and wont be rehashed here.  The important issue to realize is that the screen resolution and operating system that a given browser may be running in should also <em>and always </em>be considered as part of aesthetics.</p>
<h3>Resolution and scalability</h3>
<p>What happens when your site, designed for 1024&#215;786 resolution is squeezed down into 800&#215;600?  Or, what about when someone has an even larger resolution, which is more and more common nowadays, like my dual 1680&#215;1050 resolution?   I&#8217;ll tell you that I&#8217;ve seen some funny, very unintended things.  And, while these small and large resolutions may be at the extremes of the spectrum, they still entail a portion of your user base.  These issues can be handled by designing &#8220;out of the box,&#8221; which is also known as using a &#8220;fluid layout.&#8221;  We&#8217;ll discuss those some other time.</p>
<p>Have you ever considered what would happen if someone had a specific font size enforced via their browser?  In some cases, the world would very well explode; however, if we implement our designs in a way that promotes flexible dimensions rather than fixed widths, heights, alignments and so on, we can account for a reasonable amount of font size variance in either direction.  Our office standard is such that we allow for at least two font size increases (in Firefox, the hotkey is ctrl/command and +).  For example, <a title="Yahoooooooooooooooooo!" href="http://www.yahoo.com/" target="_blank">Yahoo&#8217;s home page</a> scales incredibly well.</p>
<h3><span style="color: #888888;">Operating system</span></h3>
<p>In my experience, browser image scaling and font rendering (particularly for larger text) are the two main operating system-dependent issues that I&#8217;ve run into.</p>
<p>When I view a website, and they&#8217;ve used CSS or (gasp!) HTML attributes to resize an image, I am almost 110% sure that everything will look good enough for jazz in Mac OS X.  However, load that same site in Windows XP or prior, and you&#8217;re bound to encounter the unexpected (unless you expected rough edges and other nasties).  The difference comes from the two companies&#8217; conflicting philosophies. They both think they&#8217;re right, but from a design perspective, I tend to lean toward the more visually appealing of the two, which happens in this case to be OS X.</p>
<p>When it comes to fonts, long story short: it&#8217;s better explained by someone else.  <a title="Font smoothing, anti-aliasing, and sub-pixel rendering" href="http://www.joelonsoftware.com/items/2007/06/12.html" target="_blank">Joel Spolsky</a> provides an excellent read on the differences between Windows and OS X.  One more thing to consider is that in XP (and possibly earlier versions), right out of the box clear type is <em>disabled, </em>and call it a hunch but most users would never know where, how or why to turn it on.  Yet, at the risk of being kicked out of the Apple club, I have to say that <a title="What's Wrong With Apple's Font Rendering?" href="http://www.codinghorror.com/blog/archives/000884.html" target="_blank">Vista&#8217;s font rendering with ClearType</a> is more readable than OS X.  Please don&#8217;t shoot me.</p>
<h2>Functionality</h2>
<h3>Libraries</h3>
<p><strong> </strong></p>
<p>If you&#8217;ve done much JavaScript at all, you&#8217;ve probably run into a handful of issues with some method existing in one browser and not in another.  The first thing to realize is that unless you control the end-user&#8217;s client, browser-specific, proprietary methods should never be used.  I always opt for the usage of distributed libraries, such as <a title="Prototype JavaScript framework: Easy Ajax and DOM manipulation for dynamic web applications" href="http://www.prototypejs.org/">Prototype</a>, <a title="jQuery: The Write Less, Do More, JavaScript Library" href="http://jquery.com/">jQuery</a>, et cetera to prevent these issues as much as I can.  However, it is also the case that the same method will be implemented in two different browsers yet behave differently (e.g.: innerHTML doesn&#8217;t on table and related elements in IE, et al), so it is always important to do some testing and research when necessary.</p>
<h3>OMG noscript</h3>
<p>Essentially, are you prepared to provide the same or similar functionality from the server-side as you have already provided via JavaScript?  It is important, at least in non-elitist work, to exclude as little of a potential audience as possible.  This means that we, as developers, must make certain allotments for users that don&#8217;t have or have disabled JavaScript.  Typically, it is my stance that these users either aren&#8217;t accustomed to or expecting the bells and whistles of your fantastic JavaScript du jour, so providing similar, perhaps more basic functionality via the server-side language of your choice is acceptable and suggested.</p>
<h3>XSLT</h3>
<p>Yet another issue to consider is client-side XML/XSL transformations, or more to the point: does the browser support it and will it behave as expected.  Normally, I would opt for the XSL transformations to be <a title="XSLT - On the Server" href="http://www.w3schools.com/xsl/xsl_server.asp" target="_blank">done on the server</a> as this ensures that the markup you expected to be there . . . is there.  Depending upon your server-side language, this has the added benefit of being able to import a namespace of functions from that language to be used in the XSLT as well.  A bonus in my book for sure.</p>
<h3>Tying it all together</h3>
<p>So it didn&#8217;t turn out as brief as I intended, but we&#8217;ve covered a good bit of information.  <em>Cross-Browser Consistency </em>ensures that a site&#8217;s presentation and behavior are the same.  I&#8217;m going to actually be brief now and sumeverything up.  Lists are always fun, so lets use one of those.</p>
<p><strong>Cross-Browser Consistency</strong> refers to the following:</p>
<ul>
<li><em>Aesthetics</em>
<ul>
<li>CSS support, rendering, and available attributes.</li>
<li>Resolution, fluid layout, and scalability.</li>
<li>Operating system rendering of fonts and browser-resized images.</li>
</ul>
</li>
<li><em>Functionality</em>
<ul>
<li>Distributed, common libraries are preferred over browser-specific or proprietary libraries and methods.</li>
<li>Always provide an alternative server-side means of functionality for behaviors implemented in JavaScript.</li>
<li>XSLT is typically wiser to implement on the server to ensure broader support.</li>
</ul>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.booleangate.org/development/xbc-cross-browser-consistency/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Now is the palette of my discontent</title>
		<link>http://blog.booleangate.org/development/html/now-is-the-palette-of-my-discontent/</link>
		<comments>http://blog.booleangate.org/development/html/now-is-the-palette-of-my-discontent/#comments</comments>
		<pubDate>Sat, 05 Jul 2008 06:39:16 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Cross-Browser Consistency]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[palette]]></category>
		<category><![CDATA[rendering]]></category>

		<guid isPermaLink="false">http://blog.booleangate.org/?p=8</guid>
		<description><![CDATA[Author&#8217;s note: This article was originally posted at Frye / Wiles, and has been re-posted here for consolidation.
Today, we&#8217;re talking about color, its use on the web and how it is (in)effectively rendered cross-browser and cross-platform.When using a flat color as a background, such as is the case with the screen shot of salsa2night below, [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><em><span class="edit footnote" title="2008-07-04">Author&#8217;s note: This article was originally posted at <a title="Original posting" rel="nofollow" href="http://blog.fryewiles.com/design/10-03-2007/now-is-the-palette-of-my-discontent" target="_blank">Frye / Wiles</a>, and has been re-posted here for consolidation.</span></em></p></blockquote>
<p>Today, we&#8217;re talking about color, its use on the web and how it is (in)effectively rendered cross-browser and cross-platform.<span id="more-8"></span>When using a flat color as a background, such as is the case with the screen shot of salsa2night below, it is important to realize that if it is blending with an image, that some consideration of cross-browser rendering must be taken into account.  Windows displays color differently than Mac, IE displays color differently than Firefox, which displays color differently than Safari&#8211;even when rendered on the same machine in the same OS.</p>
<p style="text-align: center"><img src="http://blog.fryewiles.com/wp-content/uploads/2007/10/websafe-color.jpg" alt="Salsa2Night landing page" /></p>
<p>Suppose that we have the following CSS declaration for an element on our page that contains an image that should blend in with a background color</p>
<p><code>#page {<br />
background: #30899E url(image.ext) no-repeat;<br />
}</code></p>
<p>The problem is not the hex value for the color, the discrepancy is in the value of the background color in the image itself.  Here, on XP, Firefox is not agreeing with IE 6 about the image color; however, the CSS color of #30899E is being displayed consistently.</p>
<p>One way around this problem is by using IE conditional comments (which are a saving grace all to themselves, but that&#8217;s another topic) to include a style declaration or linked file to fix the background color for IE.  These are also extremely useful for fixing other CSS, and sometimes Javascript, issues in IE that are inconsistent with other browsers.</p>
<p><code>&lt;!--[if IE]&gt;<br />
&lt;link rel="stylesheet" type="text/css" media="screen" title="FW" href="/css/ie/layout.css"&gt;&lt;/link&gt;<br />
&lt;![endif]--&gt;<br />
</code></p>
<p>or</p>
<p><code>&lt;!--[if IE]&gt;<br />
&lt;style&gt;<br />
#page {<br />
background-color: #258095 !important;<br />
}<br />
&lt;/style&gt;<br />
&lt;![endif]--&gt;<br />
</code></p>
<p>This, however, doesn&#8217;t necessarily create a new problem, but <em>does not</em> remedy the entire situation in that it does no good for Safari and other browsers.  Another, separate issue is that now you have two places to make modifications to every time you update the image instead of just one, but that&#8217;s really a different topic.  If you&#8217;re market only includes IE or Firefox, then, I suppose, you can wrap it up here.  However, when that day comes that you need to support more browsers, what then?   In general, web sites aim to reach as big of an audience as available, and should, as part of that goal, strive to provide as consistent an aesthetic experience as possible.  Getting down to the point: since there are no Safari, nor for that matter, Opera conditional comments, what are we to do?  We&#8217;ve fixed things for two out of the four big players in the browser market, but now we need a more general solution that doesn&#8217;t involve copious amounts CSS hacks and gimmicks.</p>
<p>That general way of handling this color dilemma is by using <em>web safe colors </em>for the flat colors in images that will be also be painted by a CSS background color such as in the following declaration.</p>
<p><code>#page {<br />
background: #003366 url(/images/my-image.ext) no-repeat;<br />
}<br />
</code></p>
<p>Design suites worth their salt already have web safe color palettes as part of their color picking tools, so differentiating between safe and potential mis-representable colors should be a snap.  The crux of the situation here is that these palettes were chosen and generated mathematically by design-challenged programmers (hey, I can admit it), and <em>not </em>by designers.  Complaints of an over abundance of highly saturated colors and not enough of a selection of muted colors are common.</p>
<p>Adapting oneself to design within these color constraints is somewhat note-worthy, but not necessary.  Enter method three: break it <em>twice</em>.</p>
<p>The general idea here is to have two images: the image that we&#8217;ve been dealing with all along, and another, 1&#215;1 px, that is filled with the background color that we want to fill the area with that we had been originally using a CSS hex value for.  The basic idea here is to have to div elements, on within the other.  The outer div, <em>page-background</em>, will contain the 1&#215;1 px image have it tile (repeat) in the X and Y directions.  The inner div, <em>page</em>, will contain the main image as it always has, except that it will have no background color defined with it.</p>
<p><code>&lt;style&gt;<br />
#page-background {<br />
background: url(/images/my-image-background.ext);<br />
}<br />
#page {<br />
background: url(/images/my-image.ext) no-repeat;<br />
}<br />
&lt;/style&gt;<br />
&lt;div id="page-background"&gt;<br />
&lt;div id="page"&gt;&lt;/div&gt;<br />
&lt;/div&gt;<br />
</code></p>
<p>Of course, height and width must be set on the <em>page </em>element to fit my-image and whatever content is to be included, but this is the general idea.  This works because of one reason: we&#8217;re exploiting the inconsistency in the rendering of each image.  If each of these images contain the same palette, then they will be rendered the same.  Again, instead of using a CSS color value, we&#8217;re tiling a very small image that contains that color under the main image so that <em>everything is displayed the same in all browsers</em>.</p>
<p>Each of these methods for addressing the image color issue has their own draw backs: the conditional comments only work in IE and force a division of code that has to be updated in two places; the web safe color palette is limiting factor on design; and the final, <em>break it twice</em> solution has the overhead of an additional image, albeit small, as well as the extra mark-up needed to stylize and include the extra div element, which is, again, small but there nonetheless.</p>
<p>Of all of these, I prefer the use of web safe colors as it is definitely superior as far as implementation is concerned; however, when push comes to shove, using the <em>twice broken</em> or <em>break it twice</em> method will get the job done and can be, theoretically, guaranteed to work in all browsers, forever and ever, amen.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.booleangate.org/development/html/now-is-the-palette-of-my-discontent/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
