PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > alt.www.webmaster > Numeric ID
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Numeric ID

Réponse
 
LinkBack Outils de la discussion
Vieux 25/02/2008, 22h17   #1
Tony
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Numeric ID

The w3C validator says that a numeric ID, such as:
<div id="1">
(or an ID beginning with a number) is invalid: "It is possible that you
violated the naming convention for this attribute. For example, id and
name attributes must begin with a letter, not a digit."


But I can't seem to find anything that says you can't use a numeric ID -
I'll grant that I'm not a master at reading the specs, but all I CAN
find is that an ID should be unique, and should not use character
encoding. Maybe I'm just not seeing it:
http://www.w3.org/TR/REC-html40/stru....html#h-12.2.1
http://www.w3.org/TR/REC-html40/stru....html#h-12.2.3
http://www.w3.org/TR/REC-html40/stru...l.html#h-7.5.2

So - what about numeric ID's like above? Is it valid? And assuming it's
not, what sort of problems, aside from validation errors, would it cause?
  Réponse avec citation
Vieux 25/02/2008, 22h22   #2
George Sexton
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Numeric ID

Tony wrote:
> The w3C validator says that a numeric ID, such as:
> <div id="1">
> (or an ID beginning with a number) is invalid: "It is possible that you
> violated the naming convention for this attribute. For example, id and
> name attributes must begin with a letter, not a digit."
>
>
> But I can't seem to find anything that says you can't use a numeric ID -
> I'll grant that I'm not a master at reading the specs, but all I CAN
> find is that an ID should be unique, and should not use character
> encoding. Maybe I'm just not seeing it:
> http://www.w3.org/TR/REC-html40/stru....html#h-12.2.1
> http://www.w3.org/TR/REC-html40/stru....html#h-12.2.3
> http://www.w3.org/TR/REC-html40/stru...l.html#h-7.5.2
>
> So - what about numeric ID's like above? Is it valid? And assuming it's
> not, what sort of problems, aside from validation errors, would it cause?


They're not valid. Refer to:


http://www.w3.org/TR/REC-html40/types.html#type-name
  Réponse avec citation
Vieux 25/02/2008, 22h39   #3
Beauregard T. Shagnasty
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Numeric ID

Tony wrote:

> The w3C validator says that a numeric ID, such as: <div id="1"> (or an
> ID beginning with a number) is invalid: "It is possible that you
> violated the naming convention for this attribute. For example, id
> and name attributes must begin with a letter, not a digit."
>
> But I can't seem to find anything that says you can't use a numeric
> ID - I'll grant that I'm not a master at reading the specs, but all I
> CAN find is that an ID should be unique, and should not use character
> encoding. Maybe I'm just not seeing it:
> http://www.w3.org/TR/REC-html40/stru....html#h-12.2.1
> http://www.w3.org/TR/REC-html40/stru....html#h-12.2.3
> http://www.w3.org/TR/REC-html40/stru...l.html#h-7.5.2


http://www.w3.org/TR/1999/REC-html40...html#type-name

"ID and NAME tokens must begin with a letter ([A-Za-z]) and may be
followed by any number of letters, digits ([0-9]), hyphens ("-"),
underscores ("_"), colons (":"), and periods (".")."

You're reading the old HTML 4.0 specs, but it is there as well.

http://www.w3.org/TR/REC-html40/types.html#type-name

> So - what about numeric ID's like above? Is it valid?


No.

> And assuming it's not, what sort of problems, aside from validation
> errors, would it cause?


Can't answer that; I've never used a number because it's against the
spec. <g>

--
-bts
-Friends don't let friends drive Vista
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 09h25.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08611 seconds with 11 queries