diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/fr/web/api/document/width/index.html | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/fr/web/api/document/width/index.html')
-rw-r--r-- | files/fr/web/api/document/width/index.html | 45 |
1 files changed, 45 insertions, 0 deletions
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 +--- +<div>{{APIRef("DOM")}} {{Obsolete_header}}</div> + +<div class="note"> +<p><strong>Remarque:</strong> À partir de {{Gecko("6.0")}},<code> document.width </code>n'est plus pris en charge. Au lieu de cela, utilisez document.body.clientWidth. Voir {{domxref("element.clientWidth")}}.</p> +</div> + +<p>Renvoie la largeur de l'élément {{HTMLElement("body")}} du document courrent en pixels.</p> + +<p>Non pris en charge par Internet Explorer.</p> + +<h2 id="Syntax" name="Syntax">Syntaxe</h2> + +<pre class="syntaxbox"><em>pixels</em> = document.width; +</pre> + +<h2 id="Example" name="Example">Exemple</h2> + +<pre class="brush:js">function init() { + alert("La largeur du document est " + document.width + " pixels."); +} +</pre> + +<h2 id="Alternatives" name="Alternatives">Alternatives</h2> + +<pre class="syntaxbox">document.body.clientWidth /* largeur de <body> */ +document.documentElement.clientWidth /* largeur de <html> */ +window.innerWidth /* largeur de la fenêtre */ +</pre> + +<h2 id="Specification" name="Specification">Spécification</h2> + +<p>HTML5</p> + +<h2 id="See_also" name="See_also">Voir également</h2> + +<ul> + <li>{{domxref("document.height")}}</li> + <li>{{domxref("Element.clientWidth")}}</li> + <li>{{domxref("Element.scrollWidth")}}</li> +</ul> |