diff options
Diffstat (limited to 'files/pt-br/web/javascript/reference/global_objects/string/small')
-rw-r--r-- | files/pt-br/web/javascript/reference/global_objects/string/small/index.html | 72 |
1 files changed, 72 insertions, 0 deletions
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 +--- +<div>{{JSRef}} {{deprecated_header}}</div> + +<p>O método <code>small()</code> cria um elemento HTML <code><a href="https://wiki.developer.mozilla.org/en-US/docs/Web/HTML/Element/small" title="https://wiki.developer.mozilla.org/en-US/docs/Web/HTML/Element/small"><small></a></code> que faz com que uma string seja exibida em uma fonte pequena.</p> + +<h2 id="Sintaxe">Sintaxe</h2> + +<pre class="syntaxbox notranslate"><code><var>str</var>.small()</code></pre> + +<h3 id="Valor_retornado">Valor retornado</h3> + +<p>Uma string contendo um elemento HTML <code><a href="https://wiki.developer.mozilla.org/en-US/docs/Web/HTML/Element/small" title="https://wiki.developer.mozilla.org/en-US/docs/Web/HTML/Element/small"><small></a></code>.</p> + +<h2 id="Descrição">Descrição</h2> + +<p>O método <code>small()</code> cria uma string dentro de uma tag <code><small></code>: <code>"<small>str</small>"</code>.</p> + +<h2 id="Exemplos">Exemplos</h2> + +<h3 id="Usando_small">Usando <code>small()</code></h3> + +<p>O exemplo a seguir usa métodos do objeto global String para alterar o tamanho da string:</p> + +<pre class="brush: js notranslate">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> +</pre> + +<p>Com o objeto <a href="https://wiki.developer.mozilla.org/en-US/docs/Web/API/ElementCSSInlineStyle/style" title="https://wiki.developer.mozilla.org/en-US/docs/Web/API/ElementCSSInlineStyle/style">element.style</a> você pode pegar o atributo de estilo do elemento e manipulá-lo de forma mais genérica, por exemplo:</p> + +<pre class="brush: js notranslate">document.getElementById('#oIdDoElemento').style.fontSize = '0.7em'; +</pre> + +<h2 id="Especificações">Especificações</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + </tr> + <tr> + <td>{{SpecName('ESDraft', '#sec-string.prototype.small', 'String.prototype.small')}}</td> + </tr> + </tbody> +</table> + +<h2 id="Navegadores_compatíveis">Navegadores compatíveis</h2> + +<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p> + +<p>{{Compat("javascript.builtins.String.small")}}</p> + +<h2 id="Veja_também">Veja também</h2> + +<ul> + <li>{{jsxref("String.prototype.fontsize()")}}</li> + <li>{{jsxref("String.prototype.big()")}}</li> +</ul> |