--- title: String.prototype.small() slug: Web/JavaScript/Reference/Global_Objects/String/small tags: - JavaScript - String - метод - не рекомендований - рядок translation_of: Web/JavaScript/Reference/Global_Objects/String/small ---
Метод small() створює HTML-елемент <small>, який відображає рядок зменшеним шрифтом.
str.small()
Рядок, що містить HTML-елемент <small>.
Метод small() вбудовує рядок у тег <small>: "<small>str</small>".
small()Наступний приклад використовує рядкові методи, щоб змінювати розмір рядка:
var worldString = 'Привіт'; console.log(worldString.small()); // <small>Привіт</small> console.log(worldString.big()); // <big>Привіт</big> console.log(worldString.fontsize(7)); // <font size="7">Привіт</fontsize>
Використовуючи об'єкт element.style, ви можете отримати атрибут елемента style та маніпулювати ним у більш загальному стилі, наприклад:
document.getElementById('yourElemId').style.fontSize = '0.7em';
| Специфікація |
|---|
| {{SpecName('ESDraft', '#sec-string.prototype.small', 'String.prototype.small')}} |
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
{{Compat("javascript.builtins.String.small")}}