By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,487 Members | 1,074 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,487 IT Pros & Developers. It's quick & easy.

IE6 only display text when you mouse over it (!)

P: n/a
IE6 only displays certain text on my site if you mouse over it (!).
I reduced the HTML down to this code below which still shows this
effect/bug.
My temporary solution was to take out all the comments from my HTML.
I reproduced this effect on two computers which use IE6.

Why will IE6 not show the first line of text below when the page
loads?

To see this effect for yourself, view this page online at:
http://www.tanguay.info/web/ieRenderingBug.htm

---

<html>
<body>

<div style="background-color: #fff">

IE6 will not display this line when the page loads. Why is this?

<div>
<!-- NUMBER TABLE -->
<table>
<tr>
<td>All browsers display this. But IE6 will NOT display the above
line when the page loads (only when you select the text with your
mouse or if you remove the comment or this table will IE6 display the
above comment). Why is this?</td>
</tr>
</table>
</div>

</div>

</body>
</html>

Mar 16 '07 #1
Share this Question
Share on Google+
9 Replies


P: n/a
Edward wrote:
IE6 only displays certain text on my site if you mouse over it (!).
I reduced the HTML down to this code below which still shows this
effect/bug.
My temporary solution was to take out all the comments from my HTML.
I reproduced this effect on two computers which use IE6.

Why will IE6 not show the first line of text below when the page
loads?

To see this effect for yourself, view this page online at:
http://www.tanguay.info/web/ieRenderingBug.htm

---

<html>
<body>

<div style="background-color: #fff">

IE6 will not display this line when the page loads. Why is this?

<div>
<!-- NUMBER TABLE -->
<table>
<tr>
<td>All browsers display this. But IE6 will NOT display the above
line when the page loads (only when you select the text with your
mouse or if you remove the comment or this table will IE6 display the
above comment). Why is this?</td>
</tr>
</table>
</div>

</div>

</body>
</html>
Have you tried using display :inline. It should work.

<div style="background : #fff; display: inline;">IE6 will not display
this line when the page loads. Why is this?

You can also put it in your style sheet.

..comment {
display :inline;
}

<div class="comment">IE6 will not display this line when the page loads.
Why is this?
Mar 18 '07 #2

P: n/a
On 16 Mar, 23:02, "Edward" <edw...@tanguay.infowrote:
<html>
<body>
Where's your <headetc.? This is invalid HTML, so browsers are free
to do whatever they like with it. Don't even think about chasing
peculiar rendering issues until you've fixed gross issues like this.

Mar 19 '07 #3

P: n/a
Andy Dingley wrote:
On 16 Mar, 23:02, "Edward" <edw...@tanguay.infowrote:
><html>
<body>

Where's your <headetc.? This is invalid HTML, so browsers are free
to do whatever they like with it. Don't even think about chasing
peculiar rendering issues until you've fixed gross issues like this.
Er, Andy, <headis an optional element.

So FWIW so is <html>

<bodytoo.

And their ending tags.

This is valid:

<title>valid page</title><p>page text.</p>

(once you add a DOCTYPE of course and perhaps some encoding stuff).

To the OP;

FWIW IE 5.5 *does* display the line. So does IE7.

This is just one of the things you have to do to test web pages. Run it in
IE (all flavours) and "fix" it. In this case you have found one fix, remove
the comment.

Or, better yet, make it into a better formed document, with all the
"optional" elements and tags present. IE sometimes chokes on these if they
are missing, even though the spec says they are optional, but whenever has
IE adhered to the specs? :-)

Wise, no, mandatory, is to stick a DOCTYPE up there at the top. Without one
you are running the browser in quirks mode where it carefully reproduces the
bugs from older versions.

--
Richard.
Mar 19 '07 #4

P: n/a
On Mar 19, 7:05 am, "Richard Formby" <r...@invalid.comwrote:
...
Wise, no, mandatory, is to stick a DOCTYPE up there at the top.Without one
you are running the browser in quirks mode
where it carefully reproduces the bugs from older versions.

lol

Mar 19 '07 #5

P: n/a
Scripsit Richard Formby:
Er, Andy, <headis an optional element.
It is not. This looks as if you had not learned the difference between
"element" and "tag" before giving public lectures on markup...
This is valid:

<title>valid page</title><p>page text.</p>

(once you add a DOCTYPE of course and perhaps some encoding stuff).
Encoding stuff is not a validity issue. And when you added the title
_element_, you added the required _content_ of the head _element_.

Sadly enough, the IE 6 bug does not appear when we turn the test document
into a valid document, no matter how besserwisserism we exercise. But never
besserwisser in a company where you might get bestwissered by someone!
This is just one of the things you have to do to test web pages. Run
it in IE (all flavours) and "fix" it.
That's unrealistic. Testing with IE 6 and IE 7 is enough testing on IE.
Nobody is really masochistic enough to support IE 3, for example. (There is
_very_ little in CSS you could do if you wanted to be IE 3 safe.)
In this case you have found
one fix, remove the comment.
Well, yes, and comments in HTML files are generally harmful (they usually
range from futile to plain wrong). But I wouldn't feel quite safe if I had
encountered such a bug and found a fix that _seems_ to help.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Mar 19 '07 #6

P: n/a
On 19 Mar, 13:05, "Richard Formby" <r...@invalid.comwrote:
Where's your <headetc.? This is invalid HTML, so browsers are free
to do whatever they like with it. Don't even think about chasing
peculiar rendering issues until you've fixed gross issues like this.

Er, Andy, <headis an optional element.
No, it's a mandatory element. It's an optional tag, but then why
confuse the poor OP even further? <titleis mandatory as both a tag
and an element and that's certainly missing.

I have no idea if the <headelement was present here, or where it
was. That's a question for the arcana of IE's recovery procedures
after invalid markup, which is something I intend to spend my whole
life studiously avoiding needing to know anything about. By observing
the emergent behaviour I suspect that it actually occurs somewhere
between the first and the second <divstart tags, but I wouldn't even
try to explain why!

There is no good reason to omit <head>, </heador the <headelement
in authoring HTML. If it's ever done, and ever done validly, then I
can only assume it's as some sort of Finnish party trick and not fit
for polite company (a bit like Humppa). The OP should add all the
relevant tags and then examine his results again. It's mandatory: it
might not be technically essential, but it's ordered by our sheer
arbitrary diktat. Chasing around in the grey areas that almost no-one
understands precisely is not a practical or efficient way to gets
pages authored.

(once you add a DOCTYPE of course and perhaps some encoding stuff).
AIUI, there's always a doctype. If you omit the doctype declaration,
the worst that happens in all current browsers of interest is that
they default to their own internal HTML 2-like tag soup slurper.
There's still an implied doctype though and the need (or lack of)
<heador <titleelements is just the same as if it had an explicit
doctype declaration.

Mar 19 '07 #7

P: n/a
In article
<11**********************@l75g2000hse.googlegroups .com>,
"Andy Dingley" <di*****@codesmiths.comwrote:
If you omit the doctype declaration,
the worst that happens in all current browsers of interest is that
they default to their own internal HTML 2-like tag soup slurper.
There's still an implied doctype though and the need (or lack of)
<heador <titleelements is just the same as if it had an explicit
doctype declaration.
In iCab at least, you can tell it what to assume as doctype for
the purpose of error report (if there is no doctype). Error
report is its own internal way of listing errors and warnings in
the html and css (should a user want to know).

--
dorayme
Mar 19 '07 #8

P: n/a
Jukka K. Korpela <jk******@cs.tut.fiwrote:
news: Ov******************@reader1.news.saunalahti.fi
[snip]
Sadly enough, the IE 6 bug does not appear when we turn the test
document into a valid document, no matter how besserwisserism we
exercise.
[snip]

Valid 4.01 strict document on my IE 6 retains the bug. Looks like a
peek-a-boo type of bug.

http://<br /> http://www.positionise...boo.html<br />

Adding :
<style type="text/css">
* {
line-height:1.3;
}
</style>
appears to tame it.

--
BootNic Monday, March 19, 2007 9:27 PM

They always say time changes things, but you actually have to change
them yourself.
*Andy Warhol*

Mar 20 '07 #9

P: n/a
Where's your <headetc.?

Sorry, here is the same example which validates as "Valid HTML 4.01
Strict" at http://validator.w3.org/check
And it still has the IE6 problem.
Sometimes (not always) IE6 will even show only the TOP half of
characters until you mouse over them, so this is definitely a CSS/IE
rendering issue and not a valid HTML issue. The display:inline
suggestion above fixes this example but on my site interfered with too
many other CSS settings so my current solution is to hide comments
from Internet Explorer:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<TITLE>Example of the IE6 bug (and sometimes IE7)</TITLE>
</head>
<body>

<div style="background-color: #fff">

IE6 will not display this line when the page loads. Why is this?

<div>
<!-- NUMBER TABLE -->
<table>
<tr>
<td>All browsers display this. But IE6 will NOT display the above
line when the page loads (only when you select the text with your
mouse or if you remove the comment or this table will IE6 display the
above comment). Why is this?</td>
</tr>
</table>
</div>

</div>

</body>
</html>
Mar 20 '07 #10

This discussion thread is closed

Replies have been disabled for this discussion.