Nov 25, 2007

Decoy Fix for IE Duplicate Characters Bug

Filed under: CSS, Code, Web — Adrian @ 2:05 am

Among the countless IE annoyances, the duplicate character bug is one I’ve ran into more than once. Position Is Everything has a thorough write-up on the puzzling behavior, which seems to be triggered by HTML comments between floats and sometimes hidden elements. There are a couple different workarounds such as a -3px margin on the last float or using conditional comments in place of regular HTML comments. A colleague and I have found another way to fix this issue which has worked on every case so far and is a slightly easier/cleaner option.

If you place an empty element (it can be a p, span, div, anything) directly after the element which is duplicating characters and set the display to none in the CSS, the problem will disappear. What happens is because the last element within the floats is being hidden, there are no characters for IE to duplicate. For future maintenance, I’ve added a comment within the HTML (as shown in example) so that I’ll know why that extra element is there. I would never recommend placing unused elements within your HTML as it isn’t semantically correct but if you’re looking for a quick fix, this will do the trick.

HTML:

   ...
   <div id="footer">
      <p>This element was duplicating characters.</p>
      <span class="ie_fix"><!-- do not delete this,
      it fixes the IE duplicate characters --></span>
   </div><!-- end footer -->
</div><!-- end wrapper -->
</body>
</html>

CSS:

.ie_fix {
   display: none;
}
Nov 2, 2007

Running in Place for Hours

Filed under: Life — Adrian @ 10:08 pm

Inspiration comes from weird places. We keep receiving mail addressed to the apartment’s previous tenant, Valerie. It’s been a soap opera watching the letters pour in over the last six months, disgruntled debt collectors increasing the bombard of threats each week. We even found a letter personally wedged into our door, which is discomforting considering no one is supposed to be allowed into the buildings without a key. However, as odd as it sounds, the stream of bad news has actually spurred me to strive even harder and devote more time to entrepreneurial ideas. It’s sort of like watching Jerry Springer and being thankful your life isn’t that messed up.

Unfortunately, our own frustrating message came in the form of e-mail today via our landlord. Apparently the downstairs neighbors have complained that we were being loud yesterday from 9-11:30pm. Aside from being instantly annoyed, I found it hilarious that for once in my life, someone has accused me of being loud. The elderly couple with three cats claimed that they either heard “someone working out, or running in place.” I wish I could solve this mystery of the apartment jogger but I’ve been way too busy working on my computer, exactly what I was doing between 9-11:30pm last night. Kathy went to bed early so unless our cat was sending morse code through the floorboards, I think it’s time to keep house shopping. As nice as our current apartment and location is, shared living will always suck.

In tech related news, I’m currently reinstalling Windows on my PC in order to clean everything out and start fresh. Sadly, I’ve been more nervous about fiddling with XP than I was upgrading Tiger to Leopard. I appreciate both platforms for different reasons and will probably never switch back to using just one primarily, but I applaud Apple for making things so damn easy. Pop in the disc, hit Go, and the rest is taken care of. I’m also loving the new addition of Spaces, Time Machine, and other improvements. Features I could care less about are the universal folder view (Coverflow is cool, but I don’t want all my folders to view this way!), Stacks were a good idea poorly implemented and hardly useable, and I actually don’t mind the new shiny dock but jeeze, my 20/20 vision can hardly spot the tiny blue application indicators. TUAW has the solution for bringing back the triangles, along with tweaking the dock’s color.

Link Love

View the Latest

Recommended Reading