diff options
| author | julieng <julien.gattelier@gmail.com> | 2021-10-02 17:20:24 +0200 |
|---|---|---|
| committer | SphinxKnight <SphinxKnight@users.noreply.github.com> | 2021-10-02 17:30:20 +0200 |
| commit | 1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde (patch) | |
| tree | 30a56efd3eff3a01bd1611e1840fdbbfacf544a4 /files/fr/web/api/document/width | |
| parent | c05efa8d7ae464235cf83d7c0956e42dc6974103 (diff) | |
| download | translated-content-1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde.tar.gz translated-content-1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde.tar.bz2 translated-content-1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde.zip | |
convert content to md
Diffstat (limited to 'files/fr/web/api/document/width')
| -rw-r--r-- | files/fr/web/api/document/width/index.md | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/files/fr/web/api/document/width/index.md b/files/fr/web/api/document/width/index.md index 8be64c2109..bd02da9607 100644 --- a/files/fr/web/api/document/width/index.md +++ b/files/fr/web/api/document/width/index.md @@ -3,43 +3,38 @@ title: Document.width slug: Web/API/Document/width translation_of: Web/API/Document/width --- -<div>{{APIRef("DOM")}} {{Obsolete_header}}</div> +{{APIRef("DOM")}} {{Obsolete_header}} -<div class="note"> -<p><strong>Note :</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> +> **Note :** À 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")}}. -<p>Renvoie la largeur de l'élément {{HTMLElement("body")}} du document courrent en pixels.</p> +Renvoie la largeur de l'élément {{HTMLElement("body")}} du document courrent en pixels. -<p>Non pris en charge par Internet Explorer.</p> +Non pris en charge par Internet Explorer. -<h2 id="Syntax">Syntaxe</h2> +## Syntaxe -<pre class="syntaxbox"><em>pixels</em> = document.width; -</pre> + pixels = document.width; -<h2 id="Example">Exemple</h2> +## Exemple -<pre class="brush:js">function init() { +```js +function init() { alert("La largeur du document est " + document.width + " pixels."); } -</pre> +``` -<h2 id="Alternatives">Alternatives</h2> +## Alternatives -<pre class="syntaxbox">document.body.clientWidth /* largeur de <body> */ -document.documentElement.clientWidth /* largeur de <html> */ -window.innerWidth /* largeur de la fenêtre */ -</pre> + document.body.clientWidth /* largeur de <body> */ + document.documentElement.clientWidth /* largeur de <html> */ + window.innerWidth /* largeur de la fenêtre */ -<h2 id="Specification">Spécification</h2> +## Spécification -<p>HTML5</p> +HTML5 -<h2 id="See_also">Voir également</h2> +## Voir également -<ul> - <li>{{domxref("document.height")}}</li> - <li>{{domxref("Element.clientWidth")}}</li> - <li>{{domxref("Element.scrollWidth")}}</li> -</ul> +- {{domxref("document.height")}} +- {{domxref("Element.clientWidth")}} +- {{domxref("Element.scrollWidth")}} |
