From 39f2114f9797eb51994966c6bb8ff1814c9a4da8 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 12:36:08 +0100 Subject: unslug fr: move --- .../global_objects/string/small/index.html | 80 ++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 files/fr/web/javascript/reference/global_objects/string/small/index.html (limited to 'files/fr/web/javascript/reference/global_objects/string/small') diff --git a/files/fr/web/javascript/reference/global_objects/string/small/index.html b/files/fr/web/javascript/reference/global_objects/string/small/index.html new file mode 100644 index 0000000000..080d6f7993 --- /dev/null +++ b/files/fr/web/javascript/reference/global_objects/string/small/index.html @@ -0,0 +1,80 @@ +--- +title: String.prototype.small() +slug: Web/JavaScript/Reference/Objets_globaux/String/small +tags: + - Deprecated + - HTML wrapper methods + - JavaScript + - Méthode + - Prototype + - Reference + - String +translation_of: Web/JavaScript/Reference/Global_Objects/String/small +--- +
{{JSRef}}{{deprecated_header}}
+ +

La méthode small() permet de créer un élément HTML {{HTMLElement("small")}}, ce qui permet d'afficher la chaîne de caractères dans une fonte de petite taille.

+ +

Syntaxe

+ +
str.small()
+ +

Valeur de retour

+ +

Une chaîne de caractères représentant un élément HTML {{HTMLElement("small")}}.

+ +

Description

+ +

La méthode small() encadre la chaîne courante dans une balise <small> :
+ "<small>str</small>"

+ +

Exemple

+ +

Utiliser la méthode small()

+ +

L'exemple suivant illustre les différentes méthodes de String permettant de changer la taille d'une chaîne de caractères :

+ +
var worldString = "Coucou monde";
+
+console.log(worldString.small());     // <small>Coucou monde</small>
+console.log(worldString.big());       // <big>Coucou monde</big>
+console.log(worldString.fontsize(7)); // <font size="7">Coucou monde</fontsize>
+ +

L'objet {{domxref("HTMLElement.style", "element.style")}} permet d'utiliser l'attribut style de l'élément et de le manipuler de façon générique. Par exemple :

+ +
document.getElementById('IDélément').style.fontSize = '0.7em'
+ +

Spécifications

+ + + + + + + + + + + + + + + + + + + +
SpécificationÉtatCommentaires
{{SpecName('ES6', '#sec-string.prototype.small', 'String.prototype.small')}}{{Spec2('ES6')}}Définition initiale. Implémentée dans JavaScript 1.0. Définie dans l'annexe B (normative) pour les fonctionnalités ECMAScript additionnelles pour les navigateurs web.
{{SpecName('ESDraft', '#sec-string.prototype.small', 'String.prototype.small')}}{{Spec2('ESDraft')}}Définie dans l'annexe B (normative) pour les fonctionnalités ECMAScript additionnelles pour les navigateurs web.
+ +

Compatibilité des navigateurs

+ + + +

{{Compat("javascript.builtins.String.small")}}

+ +

Voir aussi

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