[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/String/small [Back]  [Original]

String.prototype.small() - JavaScript | MDN

Esta pgina foi traduzida do ingls pela comunidade. Saiba mais e junte-se comunidade MDN Web Docs.

View in English Always switch to English

String.prototype.small()

Deprecated

Avoid using this feature in new projects. HTML wrapper methods exist only for backwards compatibility. Use DOM APIs to create elements instead. This feature may be a candidate for removal from web standards or browsers.

Consider using the following features instead: DOM.

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

In this article

Sintaxe

str.small()

Valor retornado

Uma string contendo um elemento HTML <small>.

Descrio

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

Exemplos

Usando small()

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

js
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 genrica, por exemplo:

js
document.getElementById("#oIdDoElemento").style.fontSize = "0.7em";

Especificaes

Specification
ECMAScript 2027 LanguageSpecification
# sec-string.prototype.small

Compatibilidade com navegadores

Veja tambm


Web Proxy Viewer  |  New URL  |  Original Page