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.big()

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.

String 값의 big() 메서드는 해당 문자열을 큰 글꼴로 표시되게 만드는 <big> 요소(<big>str</big>)에 해당 문자열을 집어넣은 문자열을 생성합니다.

참고 : 모든 HTML 래퍼 메서드는 더 이상 사용되지 않으며 호환성 목적으로만 표준화되었습니다. big()의 경우에선 <big> 요소 자체는 HTML 명세서에서 제거되었기 때문에 더 이상 사용해서는 안됩니다. 웹 개발자는 반드시 대신 CSS 속성을 사용하시기 바랍니다.

구문

js
big()

매개변수

없음.

반환 값

<big> 시작 태그, 그 다음 str 내용, </big> 종료 태그로 이어지는 문자열.

예제

big() 사용하기

아래 코드는 HTML 문자열을 생성한 다음 document의 body를 해당 문자열로 대체합니다.

js
const contentString = "Hello, world";

document.body.innerHTML = contentString.big();

이는 다음과 같은 HTML을 생성합니다.

html
<big>Hello, world</big>

경고 : big은 더 이상 유효한 요소가 아니기 때문에 이 마크업은 유효하지 않습니다.

big()를 사용하여 HTML 텍스트를 직접 작성하는 대신 반드시 CSS를 사용해서 폰트를 조작해야 합니다. 예를 들어 element.style 속성의 font-size를 사용하여 조작할 수 있습니다.

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

명세서

Specification
ECMAScript® 2027 Language Specification
# sec-string.prototype.big

브라우저 호환성

같이 보기