From 074785cea106179cb3305637055ab0a009ca74f2 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:52 -0500 Subject: initial commit --- .../global_objects/string/small/index.html | 72 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 files/pt-br/web/javascript/reference/global_objects/string/small/index.html (limited to 'files/pt-br/web/javascript/reference/global_objects/string/small') diff --git a/files/pt-br/web/javascript/reference/global_objects/string/small/index.html b/files/pt-br/web/javascript/reference/global_objects/string/small/index.html new file mode 100644 index 0000000000..2983a5c9fc --- /dev/null +++ b/files/pt-br/web/javascript/reference/global_objects/string/small/index.html @@ -0,0 +1,72 @@ +--- +title: String.prototype.small() +slug: Web/JavaScript/Reference/Global_Objects/String/small +tags: + - Descontinuado + - JavaScript + - Prototipo + - Referencia + - String + - metodo + - small() +translation_of: Web/JavaScript/Reference/Global_Objects/String/small +--- +
{{JSRef}} {{deprecated_header}}
+ +

O método small() cria um elemento HTML <small> que faz com que uma string seja exibida em uma fonte pequena.

+ +

Sintaxe

+ +
str.small()
+ +

Valor retornado

+ +

Uma string contendo um elemento HTML <small>.

+ +

Descrição

+ +

O método small() cria uma string dentro de uma tag <small>: "<small>str</small>".

+ +

Exemplos

+ +

Usando small()

+ +

O exemplo a seguir usa métodos do objeto global String para alterar o tamanho da string:

+ +
var worldString = 'Olá, mundo';
+
+console.log(worldString.small());     // <small>Olá, mundo</small>
+console.log(worldString.big());       // <big>Olá, mundo</big>
+console.log(worldString.fontsize(7)); // <font size="7">Olá, mundo</fontsize>
+
+ +

Com o objeto element.style você pode pegar o atributo de estilo do elemento e manipulá-lo de forma mais genérica, por exemplo:

+ +
document.getElementById('#oIdDoElemento').style.fontSize = '0.7em';
+
+ +

Especificações

+ + + + + + + + + + +
Specification
{{SpecName('ESDraft', '#sec-string.prototype.small', 'String.prototype.small')}}
+ + + + + +

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

+ +

Veja também

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