<?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>Pelago :: web design &#38; development blog &#187; CSS</title>
	<atom:link href="http://www.pelagodesign.com/blog/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pelagodesign.com/blog</link>
	<description>Santa Barbara Web Design and Web Development Blog on the web world and other randoms</description>
	<lastBuildDate>Wed, 09 Mar 2011 16:31:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>The Elusive Chrome 9 Blank Page Problem</title>
		<link>http://www.pelagodesign.com/blog/2011/03/03/the-elusive-chrome-9-blank-page-problem/</link>
		<comments>http://www.pelagodesign.com/blog/2011/03/03/the-elusive-chrome-9-blank-page-problem/#comments</comments>
		<pubDate>Fri, 04 Mar 2011 00:46:36 +0000</pubDate>
		<dc:creator>Cameron</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Intervals]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[chrome 9]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://www.pelagodesign.com/blog/?p=530</guid>
		<description><![CDATA[Prior to our most recent update of Intervals we started to get bug reports from customers telling us that when they tried to view certain tasks, certain parts of the page would be blank. The reports ranged from the task summary being blank, up to nearly the entire page being blank. The only common thread to all these reports was that the users were using Chrome 9, which had just been released. It wasn't appearing on any other pages, just the task view page. Here is how the page is supposed to look, as viewed in Firefox (you are looking at a development version of Intervals, so I apologize for all the weirdness):]]></description>
			<content:encoded><![CDATA[<p>AKA the <em>images with negative margins</em> problem.</p>
<p>Prior to our most recent update of Intervals we started to get bug reports from customers telling us that when they tried to view certain tasks, certain parts of the page would be blank. The reports ranged from the task summary being blank, up to nearly the entire page being blank. The only common thread to all these reports was that the users were using Chrome 9, which had just been released. It wasn&#8217;t appearing on any other pages, just the task view page. Here is how the page is supposed to look, as viewed in Firefox (you are looking at a development version of Intervals, so I apologize for all the weirdness):</p>
<p><a href="http://www.pelagodesign.com/blog/wp-content/uploads/2011/03/firefox11.png"><img src="http://www.pelagodesign.com/blog/wp-content/uploads/2011/03/firefox11-300x250.png" alt="" title="firefox1" width="300" height="250" class="alignnone size-medium wp-image-547" /></a></p>
<p>And for contrast, here&#8217;s what the page looked like in Chrome:</p>
<p><a href="http://www.pelagodesign.com/blog/wp-content/uploads/2011/03/chrome11.png"><img src="http://www.pelagodesign.com/blog/wp-content/uploads/2011/03/chrome11-300x250.png" alt="" title="chrome1" width="300" height="250" class="alignnone size-medium wp-image-543" /></a></p>
<p>As you can see, with the exception of the footer, the page was essentially blank. Using Chrome&#8217;s developer tools I dove into the DOM tree and tried to figure out what I could. For the most part, Chrome was calculating element positions correctly. </p>
<p><a href="http://www.pelagodesign.com/blog/wp-content/uploads/2011/03/chrome21.png"><img src="http://www.pelagodesign.com/blog/wp-content/uploads/2011/03/chrome21-300x250.png" alt="" title="chrome2" width="300" height="250" class="alignnone size-medium wp-image-544" /></a></p>
<p>Something had to be throwing them off wildly, and that was indeed the case. A particular element was being calculated with a height of -214748328 pixels. As some of you may already know, that particular number is telling because it&#8217;s the minimum number that can be expressed in the signed 32 bit integer range. Chrome was, for all intents and purposes, calculating this element&#8217;s height as negative infinity.</p>
<p><a href="http://www.pelagodesign.com/blog/wp-content/uploads/2011/03/chrome31.png"><img src="http://www.pelagodesign.com/blog/wp-content/uploads/2011/03/chrome31-300x250.png" alt="" title="chrome3" width="300" height="250" class="alignnone size-medium wp-image-545" /></a></p>
<p>A bit of further digging revealed the cause. The element in question contained an image with a height of 1 pixel and a margin (imposed by the stylesheet) of <tt>-1px -3px -2px -3px</tt>. </p>
<p><a href="http://www.pelagodesign.com/blog/wp-content/uploads/2011/03/chrome41.png"><img src="http://www.pelagodesign.com/blog/wp-content/uploads/2011/03/chrome41-300x250.png" alt="" title="chrome4" width="300" height="250" class="alignnone size-medium wp-image-546" /></a></p>
<p>Essentially, the negative margin on the images threw off computation of the element&#8217;s dimensions to an unacceptable level and affecting all the surrounding elements. Removing the image solved the problem. Unfortunately, this particular block of HTML came from the customer. In fact, it came from an Outlook email client, was pulled in from their email account, and was created as a task. In this case, this particular image was used for email tracking (most of the time you don&#8217;t even notice these in the emails you read, but they&#8217;re quite common).</p>
<p>The solution in our case was to remove the negative margins being applied to these images from the stylesheet. It fixed the problem in this case. Incidentally, we ran into similar issues with images lacking a src attribute. We fixed that by adding the following line to our CSS file:</p>
<p><tt>img:not([src]) { display: none; }</tt></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pelagodesign.com/blog/2011/03/03/the-elusive-chrome-9-blank-page-problem/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Firefox CSS Background Rendering Bug</title>
		<link>http://www.pelagodesign.com/blog/2007/09/10/firefox-css-background-rendering-bug/</link>
		<comments>http://www.pelagodesign.com/blog/2007/09/10/firefox-css-background-rendering-bug/#comments</comments>
		<pubDate>Mon, 10 Sep 2007 20:39:17 +0000</pubDate>
		<dc:creator>Jaime</dc:creator>
				<category><![CDATA[Creative Engineering]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://www.pelagodesign.com/blog/2007/09/10/firefox-css-background-rendering-bug/</guid>
		<description><![CDATA[Just stumbled upon this CSS bugfix and thought I&#8217;d post my findings. I was trying to figure out why Firefox wouldn&#8217;t completely render page background-color on pages without scrollbars. For example: Switching between different tabs would restore the background to its intended CSS value (#887D75), but nothing else seemed to work ( even tried &#60;div [...]]]></description>
			<content:encoded><![CDATA[<p>Just stumbled upon this CSS bugfix and thought I&#8217;d post my findings. I was trying to figure out why Firefox wouldn&#8217;t completely render page <code>background-color</code> on pages without scrollbars. For example:</p>
<p><img src='http://www.pelagodesign.com/blog/wp-content/uploads/2007/09/ff1.jpg' alt='ff1.jpg' style="border: 1px solid #000" /></p>
<p>Switching between different tabs would restore the background to its intended CSS value (#887D75), but nothing else seemed to work ( even tried <code>&lt;div class="clear"&gt;&lt;/div&gt;</code> at the bottom of the page ) until I tried this CSS:</p>
<p><code>body { position:absolute; top:0px; bottom:0px; left:0px; right:0px; } </code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pelagodesign.com/blog/2007/09/10/firefox-css-background-rendering-bug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Become a CSS god</title>
		<link>http://www.pelagodesign.com/blog/2007/05/11/become-a-css-god/</link>
		<comments>http://www.pelagodesign.com/blog/2007/05/11/become-a-css-god/#comments</comments>
		<pubDate>Fri, 11 May 2007 16:16:08 +0000</pubDate>
		<dc:creator>Cameron</dc:creator>
				<category><![CDATA[Creative Engineering]]></category>
		<category><![CDATA[Web Standards]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[design]]></category>

		<guid isPermaLink="false">http://www.pelagodesign.com/blog/2007/05/11/become-a-css-god/</guid>
		<description><![CDATA[Smashing Magazine, which I had heretofore never heard of, has an excellent article called 70 Expert Ideas For Better CSS Coding. The post is full of a wide range of wonderful suggestions on how to get the most out of your CSS-based designs, compiled from blog postings from other designers around the web. Every designer [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.smashingmagazine.com/" target="_blank">Smashing Magazine</a>, which I had heretofore never heard of, has an <em>excellent</em> article called <a href="http://www.smashingmagazine.com/2007/05/10/70-expert-ideas-for-better-css-coding/">70 Expert Ideas For Better CSS Coding</a>. The post is full of a wide range of wonderful suggestions on how to get the most out of your CSS-based designs, compiled from blog postings from other designers around the web. Every designer tends to have his or her own set of rules to go by when building a site or &#8220;chopping&#8221; a designers renderings into into XHTML/CSS. I have my own, and you can see it by just viewing the source code on this site and checking out the CSS <a href="/css/pelago.css">here</a>. However, it&#8217;s always great to see what other designers have come up with.</p>
<p>Some of the suggestions seem so obvious you wouldn&#8217;t think they would deserve a mention:</p>
<p><cite><strong>1 ID per page, many classes per page.</strong> &#8220;Check your IDs: Only one element in a document can have a certain value for the id attribute, while any number of elements can share the same class name. [..] Class and id names can only consist of the characters [A-Za-z0-9] and hyphen (-), and they cannot start with a hyphen or a digit (see CSS2 syntax and basic data types).&#8221; [<a href="http://www.456bereastreet.com/lab/developing_with_web_standards/css/">Roger Johansson</a>]</cite></p>
<p>But some suggestions seem so obvious you wonder, &#8220;Why didn&#8217;t I think of that before?!?!?!&#8221;:</p>
<p><cite><strong>Organize your CSS-styles, using master style sheets.</strong> &#8220;Organizing your CSS helps with future maintainability of the site. Start with a master style sheet. Within this style sheet import your <code>reset.css</code>, <code>global.css</code>, <code>flash.css</code> (if needed) and <code>structure.css</code> and on occasion a typography style sheet.&#8221;</cite></p>
<p>This is such a novel idea, but such a good one.</p>
<p>Many suggestions rely on versions of CSS that aren&#8217;t supported in &#8220;major&#8221; browsers, and some suggestions rely on CSS hacks to get around browser inconsistencies. That being said, every CSS coder, from beginner to expert, will find something valuable here. As for me, I am making it a point from now on to improve the organization of my CSS code. Thanks Smashing Magazine!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pelagodesign.com/blog/2007/05/11/become-a-css-god/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

