<?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>Mark as Unread &#187; web development</title>
	<atom:link href="http://markasunread.com/tag/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://markasunread.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Fri, 11 Nov 2011 21:37:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>Zoom bug in IE7/8 and Firefox caused by border</title>
		<link>http://markasunread.com/2009/06/zoom-bug-in-ie78-and-firefox-caused-by-border/</link>
		<comments>http://markasunread.com/2009/06/zoom-bug-in-ie78-and-firefox-caused-by-border/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 22:48:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[web design]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://markasunread.com/?p=61</guid>
		<description><![CDATA[UPDATE:  As of Jan 2009, this bug is still appearing in the latest release of Firefox 3.5.7  The bug was fixed at some point in Firefox 3, but it has reappeared After ranting on twitter for the last few hours, &#8230; <a href="http://markasunread.com/2009/06/zoom-bug-in-ie78-and-firefox-caused-by-border/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff0000;"><strong>UPDATE:  As of Jan 2009, this bug is still appearing in the latest release of Firefox 3.5.7  The bug was fixed at some point in Firefox 3, but it has reappeared <img src='http://markasunread.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /><br />
</strong></span></p>
<p>After ranting on twitter for the last few hours, I realized it might be more helpful for the web development community to write a more thorough explanation of the bug that I&#8217;ve recently discovered.</p>
<p><em>This bug relates to both Internet Explorer 7/8 and Firefox 3.</em></p>
<h3>The bug in action:</h3>
<p><a href="http://markasunread.com/examples/zoombug.html">http://markasunread.com/examples/zoombug.html</a></p>
<p>If you have a fixed width element containing floated elements that take up 100% of the that container&#8217;s width, and any of those elements have a border, zooming below 100% will cause the floats to break or wrap below the adjacent floated element. A small border will trigger the break quicker than a larger border.</p>
<h3>Why nitpick?</h3>
<p>This could actually cause a website to be unusable when zoomed down.  If you have a sidebar with navigation floated and that sidebar has a 1 pixel border&#8230; ouch.  Your navigation will probably wrap underneath your main area&#8230; probably below the wrap.  Site navigation gone.</p>
<h3>The HTML:</h3>
<p>This is the first set of divs.  Just a container &#8220;a&#8221; with floated &#8220;b&#8221; and &#8220;c&#8221; inside of it.</p>
<p><code>&lt;div class="a"&gt;<br />
&lt;div class="b"&gt;div b&lt;/div&gt;<br />
&lt;div class="c"&gt;div c&lt;/div&gt;<br />
&lt;/div&gt;</code><br />
In the second set of divs, I&#8217;ve added a wrapper of &#8220;border&#8221; so that I can add a border to it and reduce its width (for proper box-model width total) with the CSS.</p>
<p><code>&lt;!--add a "border" div to set .b border and reduce its width--&gt;<br />
&lt;div id="border"&gt;<br />
&lt;div class="a"&gt;<br />
&lt;div class="b"&gt;div b&lt;/div&gt;<br />
&lt;div class="c"&gt;div c&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;<br />
</code></p>
<h3>The CSS:</h3>
<p><code>.a {<br />
width:200px;<br />
}<br />
.b {<br />
float:left;<br />
width: 100px;<br />
background:#FCC;<br />
}<br />
.c {<br />
float:right;<br />
width:100px;<br />
background:#9FC;<br />
}<br />
#border .b{<br />
width:98px;<br />
border: 1px solid black;<br />
}<br />
</code><br />
Below is a screenshot of how the code renders at 100% zoom in IE7/8 as well as Firefox 3:</p>
<div id="attachment_62" class="wp-caption alignnone" style="width: 257px"><img class="size-full wp-image-62" title="screenshot" src="http://markasunread.com/wp-content/upLoads/screenshot.gif" alt="code rendered at 100% zoom in IE7/8 and Firefox (acutally... all modern browsers :P)" width="247" height="101" /><p class="wp-caption-text">Code rendered at 100% zoom in IE7/8 and Firefox (acutally... all modern browsers)</p></div>
<p>Now, here is what it looks like if you zoom down to anything below 100% (I&#8217;m using 99% here just so you can easily see the elements, but the results are similar for all zoom percentages below 100%)</p>
<div id="attachment_63" class="wp-caption alignnone" style="width: 257px"><img class="size-full wp-image-63" title="screenshot2" src="http://markasunread.com/wp-content/upLoads/screenshot2.gif" alt="code rendered at 99% zoom and below.  The floated div wraps.  This is the bug" width="247" height="101" /><p class="wp-caption-text">Code rendered at 99% zoom and below.  The floated div wraps.  This is the bug</p></div>
<p>This is the simplest example I could think of.  I spent hours working math on paddings/margins/borders trying to understand why my pages were breaking when zoomed down.  I finally narrowed it down to the border.  Can anyone confirm if this is a noted bug?</p>
<h3>The Results</h3>
<p>Here is the link again for you to test the bug.<br />
<a href="http://markasunread.com/examples/zoombug.html">http://markasunread.com/examples/zoombug.html</a></p>
<p>It&#8217;s worth noting that the bug is not present in Opera, Chrome, or Safari.  Also worth noting&#8230; zoom feature sucks anyway.  Why won&#8217;t they trash it?</p>
<h3>Is there a fix?</h3>
<p>Unfortunately, my only suggestion is to not set the inside elements to exactly the width of their container.  Give em some breathn&#8217; room.  If the page breaks at 25% zoom, I really don&#8217;t care.  But it should be able to at least zoom down 1 time <img src='http://markasunread.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://markasunread.com/2009/06/zoom-bug-in-ie78-and-firefox-caused-by-border/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

