Forum Moderators: not2easy

Message Too Old, No Replies

Text selection error in IE6

How to hack it?

         

rubenski

7:57 pm on Nov 10, 2004 (gmt 0)

10+ Year Member



Yaaargh everyone,

After successfully solving DIV rendering differences [webmasterworld.com] between IE and Mozilla, I am now confronted with 'the' DIV text selection error in IE6.

It is impossible to accurately select text in any the three DIV boxes my site layout is made of. When selecting text in the large main text box for example, text in other DIVs is also selected. This problem does not occur in Firefox and Mozilla. I read here [webmasterworld.com] this issue is specific to IE6. I tried adding different z-indices to all the elements that are defined in the CSS code, but this doesn't help.

I read a few other solutions on a Dutch site:

1. Removing the Doctype declaration and have the browser run in quirks mode -> unacceptable
2. Use Javascript to serve a IE6 specific stylesheet -> I don't like this
3. Adding the following piece of code to the stylesheet

/* javascript hack for text-selection bug in IE */
height: expression((document.documentElement.scrollHeight - 10) + “px”);

Option 3 makes text selection totally impossible.

How can I allow proper text selection IE6, not using one of the three options above?

rubenski

9:24 pm on Nov 11, 2004 (gmt 0)

10+ Year Member



Anyone?

grrarrgh00

7:33 pm on Nov 12, 2004 (gmt 0)



Try the two solutions given at the bottom of this page, rubenski: [ddconsult.com...]

rubenski

10:33 pm on Nov 12, 2004 (gmt 0)

10+ Year Member



I shouldn't stay up so late. It severly damages my abillity to read carefully. Would you believe that I have actually read that page before and totally missed the solution? This error was driving me insane. Thanks a bunch for pointing it out!

For fellow innacurate readers: this bug occurs in IE6 on CSS sites that use absolute positioning. Adding a height property to the body ( body {height:1000px} ) solves it. At least, in my case it did. :)