<?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>Autarchy of the Private Cave &#187; bug</title> <atom:link href="https://bogdan.org.ua/tags/bug/feed" rel="self" type="application/rss+xml" /><link>https://bogdan.org.ua</link> <description>Tiny bits of bioinformatics, [web-]programming etc</description> <lastBuildDate>Wed, 28 Dec 2022 16:09:04 +0000</lastBuildDate> <language>en-US</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>https://wordpress.org/?v=3.8.27</generator> <item><title>Debugging PHP: Eclipse PDT + XDebug + XDebug helper</title><link>https://bogdan.org.ua/2009/06/08/debugging-php-like-a-pro-eclipse-pdt-xdebug-helper.html</link> <comments>https://bogdan.org.ua/2009/06/08/debugging-php-like-a-pro-eclipse-pdt-xdebug-helper.html#comments</comments> <pubDate>Sun, 07 Jun 2009 22:59:43 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[Links]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[bug]]></category> <category><![CDATA[debugging]]></category> <category><![CDATA[development]]></category> <category><![CDATA[Eclipse]]></category> <category><![CDATA[FireFox]]></category> <category><![CDATA[PDT]]></category> <category><![CDATA[xdebug]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=735</guid> <description><![CDATA[Stimulated by a bug in a complex and unfamiliar web PHP application with heaps of custom tweaks by other programmers, I decided to try a more professional approach to PHP programming and debugging than the standard var_dump() and family. As a result, I&#8217;m now using Eclipse PDT with Xdebug and Xdebug Helper (Firefox extension). Now [&#8230;]]]></description> <content:encoded><![CDATA[<p>Stimulated by a bug in a complex and unfamiliar web PHP application with heaps of custom tweaks by other programmers, I decided to try a more professional approach to PHP programming and debugging than the standard var_dump() and family.</p><p>As a result, I&#8217;m now using Eclipse <abbr
title="PHP Development Tools">PDT</abbr> with <a
href="http://xdebug.org/">Xdebug</a> and <a
href="https://addons.mozilla.org/uk/firefox/addon/3960" class="broken_link" rel="nofollow">Xdebug Helper</a> (Firefox extension). Now I don&#8217;t understand how I used to debug my PHP programs before!</p><p>After proper configuration (I&#8217;m using local Apache, but it is also possible to debug remotely), my work flow is rather simple:</p><ul><li>use my web-app as usual, e.g. tweaking and testing here and there</li><li>if something server-side goes wrong: click the <a
href="https://addons.mozilla.org/uk/firefox/addon/3960" class="broken_link" rel="nofollow">XDebug helper</a> icon in Firefox, and perform some server-request action (e.g. load a page)</li><li>debugging is started in Eclipse PDT, where I can step through the code, set breakpoints, and examine all variables</li><li>as soon as the problem is fixed &#8211; click the XDebug helper icon again to continue using the site normally (w/o invoking the debugger)</li></ul><p>It takes some time to get used to, but then it&#8217;s a breeze.</p><p>Some advice:</p><ul><li>don&#8217;t use apt-get/aptitude to install Eclipse; it will be much easier both in the short and long run to use some all-in-one package from the <a
href="http://www.eclipse.org/pdt/downloads/">Eclipse PDT site</a>; all you need to do &#8211; download, extract, run!</li><li>before actually starting to do anything, tweak the eclipse.ini file by increasing heap size from 40 MiB (default) to some larger value (I used 128MiB). If you don&#8217;t do this, then at some point your debugging will become painfully sloooow, and then you&#8217;ll start getting tons of &#8220;out of heap memory&#8221; errors, each one suggesting that you quit Eclipse immediately</li><li>install <a
href="http://xdebug.org/">XDebug</a> with apt-get/aptitude &#8211; worked perfectly, and there&#8217;s /etc/php5/conf.d/xdebug.ini not to mess with php.ini</li><li>do <strong>read</strong> <a
href="http://www.eclipse.org/pdt/documents/XDebugGuideForPDT2.0.pdf">XDebug guide for PDT 2.x</a> (I&#8217;m assuming you got the 2.x version); it should be the only document you will really need to configure everything</li></ul><p>I only wish Eclipse was faster &#8211; that is, written not in Java but e.g. C or C++.</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F06%2F08%2Fdebugging-php-like-a-pro-eclipse-pdt-xdebug-helper.html&amp;linkname=Debugging%20PHP%3A%20Eclipse%20PDT%20%2B%20XDebug%20%2B%20XDebug%20helper" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F06%2F08%2Fdebugging-php-like-a-pro-eclipse-pdt-xdebug-helper.html&amp;linkname=Debugging%20PHP%3A%20Eclipse%20PDT%20%2B%20XDebug%20%2B%20XDebug%20helper" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F06%2F08%2Fdebugging-php-like-a-pro-eclipse-pdt-xdebug-helper.html&amp;linkname=Debugging%20PHP%3A%20Eclipse%20PDT%20%2B%20XDebug%20%2B%20XDebug%20helper" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F06%2F08%2Fdebugging-php-like-a-pro-eclipse-pdt-xdebug-helper.html&amp;linkname=Debugging%20PHP%3A%20Eclipse%20PDT%20%2B%20XDebug%20%2B%20XDebug%20helper" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F06%2F08%2Fdebugging-php-like-a-pro-eclipse-pdt-xdebug-helper.html&amp;linkname=Debugging%20PHP%3A%20Eclipse%20PDT%20%2B%20XDebug%20%2B%20XDebug%20helper" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2009%2F06%2F08%2Fdebugging-php-like-a-pro-eclipse-pdt-xdebug-helper.html&#038;title=Debugging%20PHP%3A%20Eclipse%20PDT%20%2B%20XDebug%20%2B%20XDebug%20helper" data-a2a-url="https://bogdan.org.ua/2009/06/08/debugging-php-like-a-pro-eclipse-pdt-xdebug-helper.html" data-a2a-title="Debugging PHP: Eclipse PDT + XDebug + XDebug helper"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2009/06/08/debugging-php-like-a-pro-eclipse-pdt-xdebug-helper.html/feed</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Gallery2 with URL Rewrite and DHTML Album Select and Statistics module produces two forward slashes instead of the album select</title><link>https://bogdan.org.ua/2008/02/25/gallery2-with-url-rewrite-and-dhtml-album-select-produces-two-forward-slashes-instead-of-the-album-select.html</link> <comments>https://bogdan.org.ua/2008/02/25/gallery2-with-url-rewrite-and-dhtml-album-select-produces-two-forward-slashes-instead-of-the-album-select.html#comments</comments> <pubDate>Mon, 25 Feb 2008 13:47:22 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[Software]]></category> <category><![CDATA[Web]]></category> <category><![CDATA[album select]]></category> <category><![CDATA[bug]]></category> <category><![CDATA[dhtml]]></category> <category><![CDATA[forward slash]]></category> <category><![CDATA[gallery2]]></category> <category><![CDATA[url rewrite]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/2008/02/25/gallery2-with-url-rewrite-and-dhtml-album-select-produces-two-forward-slashes-instead-of-the-album-select.html</guid> <description><![CDATA[Problem report at menalto forum. Another one, also with no solution. I can confirm &#8211; URL rewrite + DHTML Album Select produces two forward slashes in the Matrix theme, in my gallery 2.2.4 setup, after a single use of the Recalculate button in Disk statistics tab in Statistics plugin from Community repository. In my exact [&#8230;]]]></description> <content:encoded><![CDATA[<p><a
href="http://gallery.menalto.com/node/68957" class="broken_link" rel="nofollow">Problem report</a> at menalto forum. <a
href="http://gallery.menalto.com/node/69163" class="broken_link" rel="nofollow">Another one</a>, also with no solution.</p><p>I can confirm &#8211; URL rewrite + DHTML Album Select produces two forward slashes in the Matrix theme, in my gallery 2.2.4 setup, after a single use of the Recalculate button in Disk statistics tab in Statistics plugin from Community repository.<br
/> <span
id="more-264"></span><br
/> In my exact case, generating single gallery page with two forward slashes instead of Album Select produced this error:</p><blockquote><p>[25-Feb-2008 04:57:50] PHP Fatal error:  Call to a member function onLoad() on a non-object in /modules/core/classes/helpers/GalleryEntityHelper_simple.class on line 91</p></blockquote><p>I did run the <strong>integrity check</strong>&#8230; it had shown 7 missing files in the Notification module (all from the phpunit test framework), and 7 modified files (in publishxp, webcam, and flashvideo renderer; of those, I remember modifying only the last one).</p><p>PublishXP and webcam are not even installed &#8211; so I just manually deleted their folders. Then I reinstalled Notification module.<br
/> As expected, this didn&#8217;t help with the Album Select problem &#8211; though &#8220;modified files&#8221; verification problems are now gone (except for flashvideo, which I did modify). Notification must have some kind of internal trouble, as it still shows the phpunit files as missing.</p><p>Next, I tried <strong>disabling URL Rewrite</strong>, and having a look if that error is still generated: <strong>NO!!!</strong> This means, that the error is clearly associated with URL Rewrite being enabled. It&#8217;s only totally unclear, what kind of association it is.</p><p>It&#8217;s possible, that only some rules in URL Rewrite are causing problems. So I&#8217;ll disable all the rules first: <strong>now album select works</strong>.</p><p>Next, enabling rules one-by-one:</p><ul><li>add comment: still fine</li><li>view comments: still fine</li><li>updates album: still fine</li><li>popular album: still fine</li><li>random album: still fine</li><li>keyword album: still fine</li><li>permalinks: still fine</li><li>rating album: still fine (at this point I started thinking that it&#8217;ll just work after I enable all the rules; this way I&#8217;ll fix Album Select problem for some time, but won&#8217;t find the cause)</li><li><strong>show item: oops!</strong> Doesn&#8217;t work! Disabling: now works again! moving on to next rules for now.</li><li>download item: OK</li><li>site admin: OK</li><li>404: OK</li><li>Simple RSS feed and RSS feed: both OK</li><li>sitemap: OK</li><li>view slideshow: OK</li><li>tag cloud and tag virtual album: both OK</li><li>watermark hotlinked items: OK</li></ul><p><strong>Intermediate summary</strong>: problem is only with the <strong>show item</strong> rule. As suggested at the menalto forums, this might be due to the individual items names/filenames.</p><p>So, for now: if you want URL Rewrite in Gallery2 with Album Select, and you only get two forward slashes &#8211; disable the <strong>show item</strong> rule. It gives you functional Album Select at the cost of disabled rewrites for single items.</p><p>Next, I had a peek at the code around line 91:</p><div
id="ig-sh-1" class="syntax_hilite"><div
class="code"><ol
class="php" style="font-family:monospace;"><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">/* Let each entity do its post-load procedure */</div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">foreach ($onLoad as $id) {</div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; $ret = $cached[$id]-&gt;onLoad();</div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; if ($ret) {</div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; return array($ret, null);</div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; }</div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; GalleryDataCache::put(&quot;GalleryEntityHelper::loadEntitiesById($id)&quot;, $cached[$id]);</div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">}</div></li></ol></div></div><p>From what I understood, this line</p><div
id="ig-sh-2" class="syntax_hilite"><div
class="code"><ol
class="php" style="font-family:monospace;"><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">$ret = $cached[$id]-&gt;onLoad();</div></li></ol></div></div><p>in the code context calls the onLoad() function on each of the needed items, which are retrieved from the cache. So, as only one error is generated, it looks as if single item is either not in the &#8216;cached&#8217; array when it should be, or is not of the expected type. So far, I do not understand how this might be associated with item names/filenames.</p><p><ins
datetime="2008-02-26T14:03:34+00:00">Update:</ins> there was a plugin/module, which wasn&#8217;t present in the fresh and full G2 install: Statistics. After I installed Statistics onto a fresh Gallery2, and recalculated &#8216;disk usage&#8217;, I&#8217;m now seeing two slashes in that &#8220;freshly installed&#8221; G2!<br
/> Other symptoms are exactly the same: URL Rewrite&#8217;s &#8220;show item&#8221; rule switches two-slashes on and off. Thus, Statistics module might be the cause.<br
/> Strangely, but deactivating/uninstalling/deleting Statistics doesn&#8217;t fix the problem&#8230;</p><p><ins
datetime="2008-02-27T07:00:17+00:00">Update:</ins> here is the sequence of actions to reproduce the problem:</p><ul><li>install full gallery</li><li>during install, activate these plugins: album select, add items, integrity check, permalinks, url rewrite, gd</li><li>configure/activate URL rewrite module (apache mod_rewrite)</li><li>activate all url rewrite rules</li><li>edit root album->theme: add dhtml album select to &#8216;album pages&#8217;</li><li>tree doesn&#8217;t show: add album &#8216;test&#8217;. Now the album tree will be shown</li><li>install Statistics plugin (from Community repository)</li><li>go to Statistics menu in Site Admin, choose Disk statistics tab, press Recalculate</li><li>when recalculation is complete &#8211; two slashes will be seen</li></ul><p>I&#8217;ll keep looking for the solution. Comments from Gallery2 developers are highly appreciated.</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2008%2F02%2F25%2Fgallery2-with-url-rewrite-and-dhtml-album-select-produces-two-forward-slashes-instead-of-the-album-select.html&amp;linkname=Gallery2%20with%20URL%20Rewrite%20and%20DHTML%20Album%20Select%20and%20Statistics%20module%20produces%20two%20forward%20slashes%20instead%20of%20the%20album%20select" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2008%2F02%2F25%2Fgallery2-with-url-rewrite-and-dhtml-album-select-produces-two-forward-slashes-instead-of-the-album-select.html&amp;linkname=Gallery2%20with%20URL%20Rewrite%20and%20DHTML%20Album%20Select%20and%20Statistics%20module%20produces%20two%20forward%20slashes%20instead%20of%20the%20album%20select" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2008%2F02%2F25%2Fgallery2-with-url-rewrite-and-dhtml-album-select-produces-two-forward-slashes-instead-of-the-album-select.html&amp;linkname=Gallery2%20with%20URL%20Rewrite%20and%20DHTML%20Album%20Select%20and%20Statistics%20module%20produces%20two%20forward%20slashes%20instead%20of%20the%20album%20select" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2008%2F02%2F25%2Fgallery2-with-url-rewrite-and-dhtml-album-select-produces-two-forward-slashes-instead-of-the-album-select.html&amp;linkname=Gallery2%20with%20URL%20Rewrite%20and%20DHTML%20Album%20Select%20and%20Statistics%20module%20produces%20two%20forward%20slashes%20instead%20of%20the%20album%20select" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2008%2F02%2F25%2Fgallery2-with-url-rewrite-and-dhtml-album-select-produces-two-forward-slashes-instead-of-the-album-select.html&amp;linkname=Gallery2%20with%20URL%20Rewrite%20and%20DHTML%20Album%20Select%20and%20Statistics%20module%20produces%20two%20forward%20slashes%20instead%20of%20the%20album%20select" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2008%2F02%2F25%2Fgallery2-with-url-rewrite-and-dhtml-album-select-produces-two-forward-slashes-instead-of-the-album-select.html&#038;title=Gallery2%20with%20URL%20Rewrite%20and%20DHTML%20Album%20Select%20and%20Statistics%20module%20produces%20two%20forward%20slashes%20instead%20of%20the%20album%20select" data-a2a-url="https://bogdan.org.ua/2008/02/25/gallery2-with-url-rewrite-and-dhtml-album-select-produces-two-forward-slashes-instead-of-the-album-select.html" data-a2a-title="Gallery2 with URL Rewrite and DHTML Album Select and Statistics module produces two forward slashes instead of the album select"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2008/02/25/gallery2-with-url-rewrite-and-dhtml-album-select-produces-two-forward-slashes-instead-of-the-album-select.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>IE (Internet Explorer) margin doubling bug fixes</title><link>https://bogdan.org.ua/2006/09/27/ie-internet-explorer-margin-doubling-bug-fixes.html</link> <comments>https://bogdan.org.ua/2006/09/27/ie-internet-explorer-margin-doubling-bug-fixes.html#comments</comments> <pubDate>Wed, 27 Sep 2006 13:05:23 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[Notepad]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Web]]></category> <category><![CDATA[XHTML/CSS]]></category> <category><![CDATA[bug]]></category> <category><![CDATA[double]]></category> <category><![CDATA[fix]]></category> <category><![CDATA[how-to]]></category> <category><![CDATA[IE]]></category> <category><![CDATA[margin]]></category> <guid
isPermaLink="false">http://www.bogdan.org.ua/2006/09/27/ie-internet-explorer-margin-doubling-bug-fixes.html</guid> <description><![CDATA[In Internet Explorer for Windows (tested with version 6 SP2), if you write CSS code similar to this: #floatbox &#123; &#160; float: left; &#160; width: 150px; &#160; height: 150px; &#160; margin-left: 100px; &#125; and put your &#8220;floatbox&#8221; inside a container (such as DIV), you will actually see 200px of the left margin instead of the [&#8230;]]]></description> <content:encoded><![CDATA[<p>In Internet Explorer for Windows (tested with version 6 SP2), if you write CSS code similar to this:</p><div
id="ig-sh-3" class="syntax_hilite"><div
class="code"><ol
class="css" style="font-family:monospace;"><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span
style="color: #cc00cc;">#floatbox</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span
style="color: #00AA00;">&#123;</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; <span
style="color: #000000; font-weight: bold;">float</span><span
style="color: #00AA00;">:</span> <span
style="color: #000000; font-weight: bold;">left</span><span
style="color: #00AA00;">;</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; <span
style="color: #000000; font-weight: bold;">width</span><span
style="color: #00AA00;">:</span> <span
style="color: #933;">150px</span><span
style="color: #00AA00;">;</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; <span
style="color: #000000; font-weight: bold;">height</span><span
style="color: #00AA00;">:</span> <span
style="color: #933;">150px</span><span
style="color: #00AA00;">;</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; <span
style="color: #000000; font-weight: bold;">margin-left</span><span
style="color: #00AA00;">:</span> <span
style="color: #933;">100px</span><span
style="color: #00AA00;">;</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span
style="color: #00AA00;">&#125;</span></div></li></ol></div></div><p>and put your &#8220;floatbox&#8221; inside a container (such as DIV), you will actually see 200px of the left margin instead of the expected 100px. This problem is known as &#8220;IE margin-doubling bug&#8221;.</p><p>In this post I collected solutions you can use to avoid this problem. The solution I&#8217;d recommend is at the end.<br
/> <span
id="more-40"></span><br
/> The first solution is to apply some minimal height to the container:</p><div
id="ig-sh-4" class="syntax_hilite"><div
class="code"><ol
class="css" style="font-family:monospace;"><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span
style="color: #00AA00;">*</span> html <span
style="color: #6666ff;">.visualIEFloatFix</span> <span
style="color: #00AA00;">&#123;</span> <span
style="color: #000000; font-weight: bold;">height</span><span
style="color: #00AA00;">:</span> <span
style="color: #933;">0.01%</span><span
style="color: #00AA00;">;</span> <span
style="color: #00AA00;">&#125;</span></div></li></ol></div></div><p>This method is described in more details <a
href="http://plone.org/documentation/kb/internet-explorer-invisible-text">here</a> , and even better <a
href="http://plone.org/documentation/kb/ie-double-margin-bug">here</a>.</p><p>Another one is to apply position:relative, this is quite an old solution, described <a
href="http://www.communitymx.com/content/article.cfm?cid=C37E0">here</a> (there are also other fixes for the problem there, too; link returned error at the time of writing, might be a temporal problem &#8211; if not, please remind me to remove it).</p><p>Another solution is to wrap the element in another one, and apply float to that another. Removing float from the element helps avoid the trouble. This fix found <a
href="http://www.positioniseverything.net/explorer/floatIndent.html">here</a>. There are lots of examples there, too.</p><p>You can also set display:inline, as described in <a
href="http://www.positioniseverything.net/explorer/doubled-margin.html">this solution</a>. I would recommend using this one as the most clean and compatible. To apply it to our example at the beginning, we should write the following CSS code:</p><div
id="ig-sh-5" class="syntax_hilite"><div
class="code"><ol
class="css" style="font-family:monospace;"><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span
style="color: #6666ff;">.floatbox</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span
style="color: #00AA00;">&#123;</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; <span
style="color: #000000; font-weight: bold;">float</span><span
style="color: #00AA00;">:</span> <span
style="color: #000000; font-weight: bold;">left</span><span
style="color: #00AA00;">;</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; <span
style="color: #000000; font-weight: bold;">width</span><span
style="color: #00AA00;">:</span> <span
style="color: #933;">150px</span><span
style="color: #00AA00;">;</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; <span
style="color: #000000; font-weight: bold;">height</span><span
style="color: #00AA00;">:</span> <span
style="color: #933;">150px</span><span
style="color: #00AA00;">;</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; <span
style="color: #000000; font-weight: bold;">margin-left</span><span
style="color: #00AA00;">:</span> <span
style="color: #933;">100px</span><span
style="color: #00AA00;">;</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; <span
style="color: #000000; font-weight: bold;">display</span><span
style="color: #00AA00;">:</span> <span
style="color: #993333;">inline</span><span
style="color: #00AA00;">;</span></div></li><li
style="font-weight: normal; vertical-align:top;"><div
style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span
style="color: #00AA00;">&#125;</span></div></li></ol></div></div><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2006%2F09%2F27%2Fie-internet-explorer-margin-doubling-bug-fixes.html&amp;linkname=IE%20%28Internet%20Explorer%29%20margin%20doubling%20bug%20fixes" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2006%2F09%2F27%2Fie-internet-explorer-margin-doubling-bug-fixes.html&amp;linkname=IE%20%28Internet%20Explorer%29%20margin%20doubling%20bug%20fixes" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2006%2F09%2F27%2Fie-internet-explorer-margin-doubling-bug-fixes.html&amp;linkname=IE%20%28Internet%20Explorer%29%20margin%20doubling%20bug%20fixes" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2006%2F09%2F27%2Fie-internet-explorer-margin-doubling-bug-fixes.html&amp;linkname=IE%20%28Internet%20Explorer%29%20margin%20doubling%20bug%20fixes" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2006%2F09%2F27%2Fie-internet-explorer-margin-doubling-bug-fixes.html&amp;linkname=IE%20%28Internet%20Explorer%29%20margin%20doubling%20bug%20fixes" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2006%2F09%2F27%2Fie-internet-explorer-margin-doubling-bug-fixes.html&#038;title=IE%20%28Internet%20Explorer%29%20margin%20doubling%20bug%20fixes" data-a2a-url="https://bogdan.org.ua/2006/09/27/ie-internet-explorer-margin-doubling-bug-fixes.html" data-a2a-title="IE (Internet Explorer) margin doubling bug fixes"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2006/09/27/ie-internet-explorer-margin-doubling-bug-fixes.html/feed</wfw:commentRss> <slash:comments>2</slash:comments> </item> </channel> </rss>