Forum Moderators: not2easy
To my surprise IE6 numbered ALL of the <li>s with "1".
Anybody know a solution that does not involve the <li>'s not gaining hasLayout ?
testcase:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>untitled</title>
<style type="text/css">
ol {
background-color: orange;
}
</style>
<!--[if lt IE 7]>
<style type="text/css">
.play li {
zoom:1; /*need hasLayout here*/
}
</style>
<![endif]-->
</head>
<body>
<ol class="play">
<li>one</li>
<li>two</li>
<li>three</li>
</ol>
</body>
</html>
I know IE6 can't do math, but this is way over the top, even for IE6.
IE6 insists on displaying the number on the last line instead of on the first line (when the <li> has gained "hasLayout")
testcase:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>untitled</title>
<style type="text/css">
ol {
background-color: orange;
}
</style>
<!--[if lt IE 7]>
<style type="text/css">
.play li {
zoom:1; /*need hasLayout here*/
display:list-item;
}
</style>
<![endif]-->
</head>
<body>
<ol class="play">
<li>one</li>
<li>2 should be here<br />2 should not be here</li>
<li>three</li>
</ol>
</body>
</html>
I have actually googled for it, found others reporting similar stuff but nothing in the form of a doable workaround.
If the purpose of the thread was to improve knowledge or find a solution, try posting example code that reproduces the actual issue. No benefit gained by posting code aware it doesn't expose the real issue - especially when already aware that what will solve the snippet posted will fail for the real issue in real-world code.
In terms of the supposed underlying issue, analysis of content typically reveals <li> issues - especially line-break issues - are produced by semantically incorrect mark-up. Resolve the html semantics rather than expending time looking for solutions to "style issues" created by mis-using style to corect mis-used html.
No benefit gained by posting code aware it doesn't expose the real issue
it exposes the issue for me..not in IE7 unless you trip quirks mode, but it's very blatant in IE6, and that is after all the title of the post..
.. or alternatively can you explain why changing that display property works (according to specs) - to me, according to specs IS elementary level i.e. it works as you would expect it to if you're learning ;)
[edited by: SuzyUK at 10:38 pm (utc) on Dec. 19, 2008]