<?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>blog.thelemur.com &#187; CSS</title>
	<atom:link href="http://blog.thelemur.com/tag/css/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.thelemur.com</link>
	<description>Home of all things lemur</description>
	<lastBuildDate>Sun, 15 Jan 2012 19:59:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Using PHP to load browser-specific styles</title>
		<link>http://blog.thelemur.com/development-procedures/using-php-to-load-browser-specific-styles</link>
		<comments>http://blog.thelemur.com/development-procedures/using-php-to-load-browser-specific-styles#comments</comments>
		<pubDate>Fri, 27 Jun 2008 04:17:41 +0000</pubDate>
		<dc:creator>lemur</dc:creator>
				<category><![CDATA[Development Procedures]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.thelemur.com/?p=14</guid>
		<description><![CDATA[PHP allows programmers to detect the browser and operating system for every page visitor. This capability isn&#8217;t limited to PHP, but that&#8217;s what we&#8217;ll be working with today. This article is a proposed workflow for solving browser-specific CSS bugs. Potential Problems Browser detection is not bulletproof since users can change their browser name string, firewalls [...]]]></description>
			<content:encoded><![CDATA[<p>PHP allows programmers to detect the browser and operating system for every page visitor. This capability isn&#8217;t limited to PHP, but that&#8217;s what we&#8217;ll be working with today. This article is a proposed workflow for solving browser-specific CSS bugs.</p>
<p><span id="more-14"></span></p>
<h3>Potential Problems</h3>
<p>Browser detection is not bulletproof since users can change their browser name string, firewalls may prevent browser data from passing through, and software builders change their browser ID formats. Since these are the exceptions and not the rule-it&#8217;s worth attempting to customize the page presentation to your visitors&#8217; browser.</p>
<h3>Approach</h3>
<ol>
<li>Create individual stylesheets for different browsers and browser versions</li>
<li>Use PHP to detect the current browser and browser version</li>
<li>Load base stylesheets first</li>
<li>Load browser-specific styles after the base styles</li>
</ol>
<p>The order of steps 3 and 4 are critical. We&#8217;re trying to overwrite the base styles so they must be included first in the HTML header.</p>
<h3>Detecting the Browser Version</h3>
<p>At the very least you&#8217;ll need to retrieve the browser name. If compatibility requirements are strict you&#8217;ll want the version and revision numbers too. Once you&#8217;ve chosen a detection script you&#8217;re ready to move on.</p>
<p>Instead of retyping source, I will now point you to <a title="http://www.hudzilla.org/phpbook/read.php/16_5_0" href="http://www.hudzilla.org/phpbook/read.php/16_5_0" target="_blank">this site</a> which uses PHP&#8217;s <code>get_browser()</code> function. This page has a dedicated author and a history of updates dating back to 1998.</p>
<p>I recommend using get_browser() but if you don&#8217;t want to modify your PHP setup you are in luck. There are enough open-source detection scripts on the web to save you the trouble of writing your own. When you find a script be sure to check its release date.</p>
<p>An open-source script will have the same approach as the browser capability approach linked above.</p>
<h3>Suggestions</h3>
<ul>
<li>If you&#8217;re aiming for IE and Firefox it&#8217;s probably simpler to keep all your files in one ./css/ directory</li>
<li>Use a folder structure like the one below if you have many browser-specific CSS files.<br />
<img style="border: 1px solid black;" src="http://blog.thelemur.com/files/css/css_folders.png" alt="" width="119" height="88" /></li>
</ul>
<ul>
<li>If you&#8217;re switching approaches mid-project be sure to add relative paths to your CSS files!</li>
</ul>
<h3>References</h3>
<p><a href="http://www.hudzilla.org/phpbook/read.php/16_5_0" target="_blank">http://www.hudzilla.org/phpbook/read.php/16_5_0</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.thelemur.com/development-procedures/using-php-to-load-browser-specific-styles/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Browser Testing Suites</title>
		<link>http://blog.thelemur.com/development-procedures/using-browser-testing-suites</link>
		<comments>http://blog.thelemur.com/development-procedures/using-browser-testing-suites#comments</comments>
		<pubDate>Thu, 26 Jun 2008 22:15:00 +0000</pubDate>
		<dc:creator>lemur</dc:creator>
				<category><![CDATA[Development Procedures]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://blog.thelemur.com/?p=13</guid>
		<description><![CDATA[Testing CSS has been a hurdle for many web developers and their HTML-based projects. This article contains a proposed workflow for fixing CSS discrepancies found during CSS testing. What is a Browser Testing Suite? A browser testing suite captures screenshots of web pages as they appear in different browsers and different operating systems. Visit this [...]]]></description>
			<content:encoded><![CDATA[<p>Testing CSS has been a hurdle for many web developers and their HTML-based projects. This article contains a proposed workflow for fixing CSS discrepancies found during CSS testing.</p>
<p><span id="more-13"></span></p>
<h3>What is a Browser Testing Suite?</h3>
<p>A browser testing suite captures screenshots of web pages as they appear in different browsers and different operating systems. Visit <a title="http://www.smashingmagazine.com/2007/10/02/browser-tests-services-and-compatibility-test-suites/" href="http://www.smashingmagazine.com/2007/10/02/browser-tests-services-and-compatibility-test-suites/" target="_blank">this site</a> to see a list of available browser testing suites. I use <a title="Browser Shots" href="http://browsershots.org/" target="_blank">browsershots</a> because of its price point (free).<a href="http://www.smashingmagazine.com/2007/10/02/browser-tests-services-and-compatibility-test-suites/" target="_blank"></a></p>
<h3>Testing Procedures</h3>
<ol>
<li> Start with an HTML-based page</li>
<li>Create two standards compliant CSS files:
<ul>
<li><code>css/screen/layout.css</code></li>
<li><code>css/screen/site.css</code></li>
</ul>
</li>
<li>Include the default layout and site CSS files in the HTML header</li>
<li>Test your work with a browser testing suite</li>
<li>If there are display differences between browser versions following the steps outlined below</li>
</ol>
<h3>Fixing CSS for a Specific Browser</h3>
<p>IE6 is the culprit in the following example:</p>
<ol>
<li>Duplicate the compliant layout CSS file and rename <code>it layout_IE6.css</code></li>
<li>Modify the layout_IE6.css files for IE6 compatibility</li>
<li>Use a scripting language to inject the IE6 <code>link</code>s after the standards compliant <code>link</code>s. Refer to <a title="http://blog.thelemur.com/development-procedures/using-php-to-load-browser-specific-styles" href="http://blog.thelemur.com/development-procedures/using-php-to-load-browser-specific-styles" target="_self">this</a> post for details</li>
<li>Test your changes with a browser testing suite. You&#8217;ll only need to run tests for IE6</li>
<li>Don&#8217;t delete unchanged styles from the IE6 CSS file</li>
</ol>
<h3>References</h3>
<ul>
<li><a href="http://www.smashingmagazine.com/2007/10/02/browser-tests-services-and-compatibility-test-suites/" target="_blank">http://www.smashingmagazine.com/2007/10/02/<br />
browser-tests-services-and-compatibility-test-suites/</a></li>
<li><a title="http://www.melbournechapter.net/wordpress/web-accessibility/cman/2006/05/12/css-ie-hacks-recommendations/" href="http://www.melbournechapter.net/wordpress/web-accessibility/cman/2006/05/12/css-ie-hacks-recommendations/" target="_blank">http://www.melbournechapter.net/wordpress/web-accessibility/<br />
cman/2006/05/12/css-ie-hacks-recommendations/</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.thelemur.com/development-procedures/using-browser-testing-suites/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.391 seconds -->

