filters are not your friends
in web design , Friday, December 17, 2010
I think this is worth mentioning: I spent the better part of today trying to fix a layout bug in Internet Explorer 7, where a negative margin was applied to a floated image container. The image was cut off at the edge of the containing element.
This is actually a well known-bug - in theory - and a reliable fix is to add a “position: relative” CSS rule to the floated container. But it didn’t work.
After a lot of research and tearing out of hair, followed by careful debugging (aka “wildly flailing about”), I discovered the reason. The containing element had a Internet Explorer proprietary filter applied to it, to give a semi-transparent fill:
/* For IE 8*/
-ms-filter: “progid:DXImageTransform.Microsoft.gradient(startColorstr=#59000000, endColorstr=#59000000)”;
On removing this, everything worked perfectly. So I just used a semi-transparent PNG as a fill image instead. Probably more efficient anyway.
in web design , Monday, May 22, 2006
I finally managed to track down a very elusive bug which was affecting the photo pages on this site. Basically, if a thumbnails page was called directly, from say a link in a gallery update blog post, or a link I sent to someone, the first time it loaded, the gallery was blank. The second time, it was fine. This seemed to be a PHP session issue: if I discarded all the session code, it worked fine - although obviously everything else that depended on sessions was broken. But when I tried to home in on a specific setting, I got nowhere.
I finally discovered that there was a small difference between the page code generated on first and subsequent entries - it is pretty hard to spot:
But the line above - where for some reason, no session ID was written, just a superfluous extra " inserted - was harder to fix. Finally, I had to break one string concatenation into several steps, and finally I got the code I was trying to get the page to write, instead of what the PHP interpreter thought I wanted.
That has got to be one of the most obscure bugs I've ever had to track down on a web site...