Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Text Highlighting in IE6

Status
Not open for further replies.

NeckBone

Programmer
Oct 15, 2003
47
US
Greetings again folks,

I have a layout which is using absolute positioning. It's working very well cross-browser but there seems to be a bug in IE6. I believe it's related to the absolute positioning and taking the content out of document flow.

When I open the page in IE6 and attempt to highlight text on the page, it's like I can't highlight specific lines. A whole block, text on another part of the page, or everything on the page highlights. I can't select specific text to highlight with the cursor.

I'm using this doctype:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
If I switch the doctype to this doctype:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
to put IE in Quirks mode, the text highlights correctly.

I need to use the first doctype for presentation.

Is there a way to fix this IE highlighting problem in the CSS, a hack maybe?

Thanks for your input.


Youth and beauty are no match for age and experience.
 
I've ran into this problem before as well - only using relative positioning. I only noticed it happening in IE. Other than avoiding absolute positioning, I don't believe there is a solution, sorry :(

Here's links to others that have had your problem and it doesn't seem that there is a solution:

-kaht

How much you wanna make a bet I can throw a football over them mountains?
sheepico.jpg
images
 
I've seen the same issue many times, too, and while I've never tried to find a solution, I'll take a stab-in-the-dark guess and say you might try playing around with z-indexes to see if it makes a difference.

Hope this helps,
Dan



[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
...to put IE in Quirks mode...
You can put IE into quirks mode by just placing something before the doctype. I prefer an HTML comment:
Code:
<!-- this will force IE into quirks mode -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<html>...
That way you still have a valid and complete doctype as well.

Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
Thanks for the info guys.

Billy Ray I'll play with the z-index. I haven't gotten back to this yet, been locked down on other stuff. I'll tear into it tomorrow/today.

Baby Jeffy,
Will putting comments in front of the doctype affect any other browsers besides IE. I never heard of using this before.


Youth and beauty are no match for age and experience.
 
Will putting comments in front of the doctype affect any other browsers besides IE. I never heard of using this before.
Nope. It doesn't affect any other browser (to my knowledge). You can see it being used on many of the major online insurance web sites in the UK at the moment.

Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
Baby Jeffy,

Using the comment tags, at first glance, I would assume that the doctype would be commented out like any other statement and wouldn't be considered by any browse.

If you use no doctype or this doctype:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

IE6 will go into Quirks mode.

That's cool that IE is the only browser that'll ignore it with the comments in place.


Youth and beauty are no match for age and experience.
 
IE6 will go into Quirks mode.
But that is because it isn't a full doctype [smile] You need to include the URL to the DTD for it to be complete (and push IE out of Quirks mode). Using the comment idea we talked about would prevent IE from ever leaving Quirks mode.

Have a good weekend!
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top