Bug: IE7 absolutely positioned italics | Comments (16)
Posted in Browsers on 28th December 2006, 5:06 pm by Stuart
I recently discovered a rather bizarre bug that only seems to affect IE7. If you absolutely position italic text of any kind (text made italic through authors styling or something that is styled via the default browser stylesheet such as ems.) IE7 seems to screw up the rendering and ends up creating a horizontal scrollbar. This problem is best illustrated with an example page (View in IE7 to see the horizontal scrollbar). If you override the font-style then the scrollbar dissappears. Strange.
IE6 doesn’t have any problem with the same code which is interesting and suggests that this bug has been introduced into IE7.
I also noted that the same problem doesn’t exist when the page is rendered in quirksmode.
Figure 1: IE7 See the horizontal scrollbar.

Figure 2: IE6 No problem


That’s pretty interesting. I was marking up some quotes with italic cites and such just a couple weeks ago, and I was getting scroll bars. Can’t remember what I did now to get rid of them, so I’m not sure if it was the same bug, but I do remember scratching my head over it for a while. I’ll maybe play with what I had originally again and see if it is this!
I fully expect this to be fixed by IE8.
I remember seeing this when I was messing around with IE7 a few months ago. I’ve yet to figure out why all of a sudden version 7 does this, while version 6 does not? It’s obvious a tweak they made, maybe to fix something triggered this display bug.
It’s odd.
As a workaround you can add
This will most likely fix the problem
Thanks zproxy, that looks to be a suitable fix. I’ve added a test page with that here: http://muffinresearch.co.uk/code/xhtmlandcss/ie7italics/index3.html
Interestingly I found that
zoom:1also worked in this example but in my original page where the italic text was nested within a the divzoom:1didn’t work. Thus I recommend usingoverflow:autoas zproxy suggested.Actually, a similar problem exists in IE6:
http://www.thescripts.com/forum/thread96080.html
I came across this a few months ago. It didn’t have anything to do with absolute positioning, at least not in my instance. I had a div that was float:right, and the text was italicized, giving a horizontal scrollbar. Very bizarre!
Interesting to see that the problem still exists in IE7…. not surprising though
[...] Bug: IE7 absolutely positioned italics [...]
[...] Font: Bug: IE7 absolutely positioned italics [...]
[...] Ya hemos empezado con los bug de explorer 7, en este caso lo ha descubierto muffinresearch y are lo ha solucionado (en catalán, eso sí ): [...]
Was wondering what the hell the problem was for about 2 hours before I decided to search google and came up with your site..
I would have never have thought this would be a glitch in IE7..
THANK YOU!
damn IE7!
all the afternoon trying to fix by myself this annoying thing until i thought, let’s search forums ;P
i used overflow: auto where is the font-style: italic and it got fixed! thanks guys!
jordi.
I just ran into a somewhat similar problem in that when I had a div of menu items floated left all the CSS and links disappeared when there were italics to the right of it. It didn’t matter if the italics came from CSS or a <i> tag. Adding the overflow: auto; fix to the class I was using for the italics text “fixed” it.
Strictly speaking, this has nothing to do with absolute positioning. It is a general big with italic text. Just try
Text
and you’ll get the same problem.
overflow: auto’ does indeed help as a workaround.
Oh MAN!!! I spent an entire DAY today trying to figure this one out! This is THE most bizarre thing I’ve ever seen.
My page had a bunch of text (from an xml document) in the middle column and two navigational columns, left and right (PHP includes). Any link lower on the page than the first italics in the center column would not work! Only in IE7, of course. The left and right columns were included BEFORE the middle column, so it really made no sense.
Inexplicably, the overflow:auto on the center column worked. Crazy.
I just discovered this bug, very interesting. It also applies to the <em> tag.
Stupid bug. It cost me an hour to find out what was the cause. Why doesn’t Microsoft repair it in one of the updates …?