[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/String/fontsize [Back]  [Original]

String.prototype.fontsize() - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

String.prototype.fontsize()

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.

In this article

fontsize() HTML- <font>, .

: <font> HTML5 . - CSS.

str.fontsize(size)

size

1 7, 1 7.

, str 7 . , , "-2", str , <basefont>.

: fontsize()

:

js
var worldString = ", ";

console.log(worldString.small()); // <small>, </small>
console.log(worldString.big()); // <big>, </big>
console.log(worldString.fontsize(7)); // <fontsize=7>, </fontsize>

element.style style , :

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

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


Web Proxy Viewer  |  New URL  |  Original Page