번역 작업 진행중입니다.

HTML <pre> 요소는 미리 서식이 지정된 텍스트를 나타냅니다(Mark-up). 이 요소 내의 텍스트는 대게 파일에 쓰여졌던 그대로 (요소 밖 텍스트와는) 비례하지 않는 글꼴로 표시됩니다. 이 요소 내 빈 칸(white-space) 또한 타이핑한대로 입력됩니다.

속성

이 요소는 전역 속성만을 포함합니다.

cols
Contains the preferred count of characters that a line should have. It was a non-standard synonym of width. To achieve such an effect, use CSS styling instead.
width
Contains the preferred count of characters that a line should have. Though technically still implemented, this attribute has no visual effect; to achieve such an effect, use CSS styling instead.
wrap
Is a hint indicating how the overflow must happen. In modern browser this hint is ignored and no visual effect results in its present; to achieve such an effect, use CSS styling instead.

예제

<!-- Some example CSS code -->
<pre>
body {
  color:red;
}
</pre> 

결과

body {
  color:red;
}

명세

명세 상태 주석
HTML Living Standard
The definition of '<pre>' in that specification.
Living Standard No significant change from HTML Living Standard
HTML5
The definition of '<pre>' in that specification.
Recommendation No significant change from HTML 4.01 Specification
HTML 4.01 Specification
The definition of '<dl>' in that specification.
Recommendation Deprecated the cols attribute

브라우저 호환성

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
preChrome Full support YesEdge Full support YesFirefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
cols
DeprecatedNon-standard
Chrome No support NoEdge No support NoFirefox No support 1 — 29IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile No support NoFirefox Android No support 4 — 29Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
width
DeprecatedNon-standard
Chrome Full support Yes
Notes
Full support Yes
Notes
Notes Specifying the width attribute has no layout effect.
Edge Full support Yes
Notes
Full support Yes
Notes
Notes Specifying the width attribute has no layout effect.
Firefox Full support 1
Notes
Full support 1
Notes
Notes Since Firefox 29, specifying the width attribute has no layout effect.
IE Full support Yes
Notes
Full support Yes
Notes
Notes Specifying the width attribute has no layout effect.
Opera Full support Yes
Notes
Full support Yes
Notes
Notes Specifying the width attribute has no layout effect.
Safari Full support Yes
Notes
Full support Yes
Notes
Notes Specifying the width attribute has no layout effect.
WebView Android Full support Yes
Notes
Full support Yes
Notes
Notes Specifying the width attribute has no layout effect.
Chrome Android Full support Yes
Notes
Full support Yes
Notes
Notes Specifying the width attribute has no layout effect.
Edge Mobile Full support Yes
Notes
Full support Yes
Notes
Notes Specifying the width attribute has no layout effect.
Firefox Android Full support 4
Notes
Full support 4
Notes
Notes Since Firefox 29, specifying the width attribute has no layout effect.
Opera Android Full support Yes
Notes
Full support Yes
Notes
Notes Specifying the width attribute has no layout effect.
Safari iOS Full support Yes
Notes
Full support Yes
Notes
Notes Specifying the width attribute has no layout effect.
Samsung Internet Android Full support Yes
wrap
DeprecatedNon-standard
Chrome ? Edge No support NoFirefox Full support 1IE ? Opera ? Safari ? WebView Android ? Chrome Android ? Edge Mobile No support NoFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Non-standard. Expect poor cross-browser support.
Non-standard. Expect poor cross-browser support.
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.
See implementation notes.
See implementation notes.

같이 보기

문서 태그 및 공헌자

이 페이지의 공헌자: alattalatta, mdnwebdocs-bot, ehfgk78, azunyan3
최종 변경자: alattalatta,