Re: HTML ID case question

11.07.01 17:22:06, Terje Bless <> wrote:

>This strikes me as pure sillyness; a convoluted mess of interacting rules
>from different parts of the prose that result in a completely illogical set
>of legal combinations. Valid HTML that is labelled Invalid by the Validator
>is a Very Very Bad Thing.

I remember this from my time as an author when I considered this a 
lose/lose. I had to take care of case sensitivity for my links, but I 
couldn't make mnemonic two-way links, e.g.

   Main text, here comes a footnote [<a name="foot1" href="#FOOT1">1</a>].
   [<a name="FOOT1" href="#foot1">1</a>] Footnote 1: ...

If I recall correctly, the reason for the fudge was that IE was case 
insensitive and NN was case sensitive. That was several years ago, so I made 
an impromptu test for the current state of three browsers (below). Test 

Test 1 (duplicate ids): Opera chooses the last id of the bunch, Moz and IE 
the first. It is undefined, so both options are reasonable, as is not 
chosing any at all.

Test 2 (idref case error): Neither Opera nor Moz choose id="three" when 
href="#THREE", IE does and that is wrong (in HTML 4.01 too).

Test 3: All do the same (if for different reasons in the case of IE).

Test 4: Opera and Moz go to id="ONE" with href="#ONE", IE goes to id="one".

I haven't checked whether IE6 in "standards compliant mode" does any better.

Jonny Axelsson
Opera software


<title>The current id case case</title>
<style type="text/css">
div {
	height: 300px; 
	background: #efe; 
	padding: 1em;
	margin: 1em;
	border: 2px solid #060; 
	font: 12px/16px sans-serif;
	display: block;
	font: 20px/40px bold monospace;
td, th {
	background: #fff;

<h1>Case sensitivity and id, tests</h1>
<div>This tests current case-sensitivity on different browsers. This table 
  result for the link targets for three browsers (href &lt;target&gt;). 
    <th>Opera 5.12</th>
    <th>Mozilla 0.9.2</th>
    <th>IE 5.5</th>
    <th>Test 1</th>
    <td>Second "two"</td>
    <td>First "two"</td>
    <td>First "two"</td>
    <th>Test 2</th>
    <th>Test 3</th>
    <th>Test 4</th>
<div id="one"><p><code>TEST 1: id="one" (href <a href="#two">two</a>)</code> 
This id 
  differ from the next by case. Link to duplicate.</p></div>

<div id="ONE"><p><code>TEST 2: id="ONE" (href <a 
href="#THREE">THREE</a>)</code>This id differ from the previous by case. 
Broken link to id, but same case intransitively.</p></div>
<div id="two"><p><code>TEST 3: id="two" (href <a 
href="#one">one</a>)</code>This and the next id identical.</p></div>
<div id="two"><p><code>TEST 4: id="two" (href <a 
<div id="three"><p><code>id="three"</code></p></div>
<div id="four"><p><code>id="four"</code></p></div>

Received on Wednesday, 11 July 2001 12:35:44 UTC