★ wanayoo — archive 1999 https://developer.mozilla.org/ca/docs/Web/JavaScript/Referencia/Objectes_globals/String/smallNouvelle recherche | Portail wanayoo

Account creation on MDN is disabled while we upgrade our moderation mechanisms. If you see something that needs to be fixed, please file a bug: https://bugzilla.mozilla.org/form.doc and we'll handle it as soon as we can. Thanks for your patience!

String.prototype.small()

This article is in need of an editorial review.

Deprecated
This feature has been removed from the Web standards. Though some browsers may still support it, it is in the process of being dropped. Do not use it in old or new projects. Pages or Web apps using it may break at any time.

El mètode small() crea un element HTML <small> que causa que una cadena es mostri amb una font petita.

Sintaxi

str.small()

Descripció

El mètode small() incrusta una adena en una etiqueta <small>: "<small>str</small>".

Exemples

Utilitzar small()

L'exemple següent utilitza mètodes string per canviar la mida d'una cadena:

var worldString = 'Hola, món';

console.log(worldString.small());     // <small>Hola, món</small>
console.log(worldString.big());       // <big>Hola, món</big>
console.log(worldString.fontsize(7)); // <font size="7">Hola, món</fontsize>

Amb l'objecte element.style es pot obtenir l'atribut style  d'un element i manipular-lo més genèricament. Per exemple:

document.getElementById('yourElemId').style.fontSize = '0.7em';

Especificacions

Especificació Estat Comentaris
ECMAScript 2015 (6th Edition, ECMA-262)
The definition of 'String.prototype.small' in that specification.
Standard Definició inicial. Implementat en JavaScript 1.0. Definit en l'Annex B (normative) per Característiques Addiccionals d'ECMAScript per Navegadors Web.

Compatibilitat amb navegadors

Característica Chrome Firefox (Gecko) Internet Explorer Opera Safari
Suport bàsic (Yes) 1.0 (1.7 or earlier) (Yes) (Yes) (Yes)
Característica Android Chrome per Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Suport bàsic (Yes) (Yes) 1.0 (1.0) (Yes) (Yes) (Yes)

Vegeu també

Document Tags and Contributors

 Contributors to this page: llue
 Last updated by: llue,