From 4b1a9203c547c019fc5398082ae19a3f3d4c3efe Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:41:15 -0500 Subject: initial commit --- files/ca/web/html/global_attributes/id/index.html | 113 ++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 files/ca/web/html/global_attributes/id/index.html (limited to 'files/ca/web/html/global_attributes/id/index.html') diff --git a/files/ca/web/html/global_attributes/id/index.html b/files/ca/web/html/global_attributes/id/index.html new file mode 100644 index 0000000000..15d6226ba1 --- /dev/null +++ b/files/ca/web/html/global_attributes/id/index.html @@ -0,0 +1,113 @@ +--- +title: id +slug: Web/HTML/Global_attributes/id +tags: + - Global attributes + - HTML + - Reference +translation_of: Web/HTML/Global_attributes/id +--- +
{{HTMLSidebar("Global_attributes")}}
+ +

L'atribut global id defineix un identificador únic (ID) que ha de ser únic en tot el document. El seu propòsit és identificar l'element quan es vincula (usant un identificador de fragment), scripts, o estil (CSS).

+ +

El valor d'aquest atribut és una cadena opaca: això vol dir que l'autor web no ho ha de fer servir per transmetre qualsevol informació. Un significat particular, per exemple el significat semàntic, no ha de derivar de la cadena.

+ +

El valor d'aquest atribut no ha de contenir espais en blanc (espais, tabulacions, etc.). Els navegadors tracten IDs no conformes que contenen espais en blanc com si l'espai en blanc fora part de l'ID. En contrast amb l'atribut class, que permet valors separats per espais, els elements només poden tenir un únic ID.

+ +
+

Nota: L'ús de caràcters ASCII, excepte les lletres i dígits, '_', '-' i '.' pot causar problemes de compatibilitat, ja que no estaven permesos en HTML 4. Malgrat aquesta restricció ha estat aixecada en HTML 5, un ID ha de començar amb una lletra per compatibilitat.

+
+ +

Especificacions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
EspecificacióEstatComentari
{{SpecName('HTML WHATWG', "dom.html#the-id-attribute", "id")}}{{Spec2('HTML WHATWG')}}Sense canvis des de l'última instantània, {{SpecName('HTML5.1')}}
{{SpecName('HTML5.1', "dom.html#the-id-attribute", "id")}}{{Spec2('HTML5.1')}}Instantània de {{SpecName('HTML WHATWG')}}, sense canvis des de {{SpecName('HTML5 W3C')}}
{{SpecName('HTML5 W3C', "dom.html#the-id-attribute", "id")}}{{Spec2('HTML5 W3C')}}Instantània de {{SpecName('HTML WHATWG')}}, ara acceptar '_', '-' i '.' al començament del id. És també un verdader atribut global.
{{SpecName('HTML4.01', 'struct/global.html#adef-id', 'id')}}{{Spec2('HTML4.01')}}Suportat en tots els elements però {{HTMLElement("base")}}, {{HTMLElement("head")}}, {{HTMLElement("html")}}, {{HTMLElement("meta")}}, {{HTMLElement("script")}}, {{HTMLElement("style")}}, i {{HTMLElement("title")}}.
+ + + +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + +
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Suport bàsic{{CompatVersionUnknown}}{{CompatVersionUnknown}}[1]{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
CaracterísticaAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suport bàsic{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}[1]{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

[1] id és un veritable atribut global només a partir de Gecko 32.0 {{geckoRelease("32.0")}}.

+ +

Veure

+ + -- cgit v1.2.3-54-g00ecf