From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/fr/web/api/document/width/index.html | 45 ++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 files/fr/web/api/document/width/index.html (limited to 'files/fr/web/api/document/width/index.html') diff --git a/files/fr/web/api/document/width/index.html b/files/fr/web/api/document/width/index.html new file mode 100644 index 0000000000..94c91d793d --- /dev/null +++ b/files/fr/web/api/document/width/index.html @@ -0,0 +1,45 @@ +--- +title: Document.width +slug: Web/API/Document/width +translation_of: Web/API/Document/width +--- +
{{APIRef("DOM")}} {{Obsolete_header}}
+ +
+

Remarque: À partir de {{Gecko("6.0")}}, document.width n'est plus pris en charge. Au lieu de cela, utilisez document.body.clientWidth. Voir {{domxref("element.clientWidth")}}.

+
+ +

Renvoie la largeur de l'élément {{HTMLElement("body")}} du document courrent en pixels.

+ +

Non pris en charge par Internet Explorer.

+ +

Syntaxe

+ +
pixels = document.width;
+
+ +

Exemple

+ +
function init() {
+    alert("La largeur du document est " + document.width + " pixels.");
+}
+
+ +

Alternatives

+ +
document.body.clientWidth              /* largeur de <body> */
+document.documentElement.clientWidth   /* largeur de <html> */
+window.innerWidth                      /* largeur de la fenêtre */
+
+ +

Spécification

+ +

HTML5

+ +

Voir également

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