이 번역은 완료되지 않았습니다. 이 문서를 번역해 주세요.

전역 속성(Global attributes)은 모든 HTML의 공통 속성입니다; 일부 요소에는 효과가 없을 수 있지만, 전역 속성은 모든 요소에 사용될 수 있습니다.

전역 속성(Global attributes)은 모든 HTML 요소에 지정할 수 있으며, 심지어 표준에 명시되지 않은 요소에 대해서도 지정할 수 있습니다. 이는 어떠한 비표준 요소도 이 속성들을 허용해야 함을 의미합니다(이런 비표준 요소를 사용한다는 것은 해당 문서는 더 이상 HTML5를 준수하지 않는 것을 의미하지만). 예를 들어, <foo>라는 유효하지 않은 HTML 요소로 <foo hidden>...<foo>와 같이 사용하면 HTML5를 준수하는 브라우저는 해당 요소의 컨텐츠를 감춥니다(화면에 표시하지 않습니다).

기본 HTML 전역 속성 외에 아래와 같은 전역 속성들이 있습니다:

  • xml:langxml:base — 이 속성들은 XHTML 규약에서 상속되었으나 앞으로는 사라질(deprecated) 것이며, 호환성을 목적으로 유지되었습니다.
  • 다중 aria-* 속성은 접근성 향상을 위해 사용됩니다.
  • 이벤트 처리기(event handler) 속성: onabort, onautocomplete, onautocompleteerror, onblur, oncancel, oncanplay, oncanplaythrough, onchange, onclick, onclose, oncontextmenu, oncuechange, ondblclick, ondrag, ondragend, ondragenter, ondragexit, ondragleave, ondragover, ondragstart, ondrop, ondurationchange, onemptied, onended, onerror, onfocus, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpause, onplay, onplaying, onprogress, onratechange, onreset, onresize, onscroll, onseeked, onseeking, onselect, onshow, onsort, onstalled, onsubmit, onsuspend, ontimeupdate, ontoggle, onvolumechange, onwaiting.

전역 속성 목록

accesskey
현재 요소에 대한 키보드 단축키 생성을 위한 힌트를 제공합니다. 이 속성은 공백으로 구분된 문자 목록으로 구성됩니다. 브라우저는 컴퓨터 키보드 레이아웃의 첫 번째 것을 사용해야 합니다.
autocapitalize
사용자가 입력 또는 수정하는 텍스트를 자동으로 대문자로 변환할지 여부와 변환하는 방법을 제어합니다. 다음과 같은 값을 가질 수 있습니다:
  • off 또는 none, 자동 대문자화 방식을 적용하지 않음(모든 문자는 기본적으로 소문자임).
  • on 또는 sentences, 각 문장의 첫 번째 문자를 기본적으로 대문자로 변경; 나머지 모든 문자는 소문자를 기본으로 함.
  • words, 각 단어의 첫 번째 문자를 기본적으로 대문자로 변경; 나머지 모든 문자는 소문자를 기본으로 함.
  • characters, 모든 문자는 기본적으로 대문자로 변경됨.
class
해당 요소의 공백으로 구분된 클래스의 목록을 의미합니다. 클래스를 이용하면 CSS나 JavaScript에서 클래스 선택기(class selectors)Document.getElementsByClassName()과 같은 메서드를 이용해 특정 요소를 선택하거나 접근할 수 있습니다.
contenteditable
이 열거형 속성은 해당 요소를 사용자가 편집할 수 있는지를 나타냅니다. 그 경우에 브라우저는 편집을 허용하도록 위젯을 수정합니다. 이 속성의 값은 다음 값 중의 하나이어야 합니다:
  • true 또는 빈 문자열, 해당 요소가 편집이 가능해야 함을 나타냅니다;
  • false, 해당 요소가 편집이 불가능해야 함을 나타냅니다.
contextmenu
이 요소의 상황별 메뉴(contextual menu)로 사용할 <menu>id입니다.
data-*
전용 데이터 속성(custom data attributes)이라는 속성 클래스를 형성하여, 스크립트에서 이용할 수 있는 HTMLDOM 표시(DOM representation) 간 전용(proprietary) 정보를 주고 받을 수 있도록 합니다. 해당 요소에 이 속성이 설정된 경우, HTMLElement 인터페이스를 이용해 이러한 모든 전용 데이터를 사용할 수 있습니다. HTMLElement.dataset 속성을 사용하면 전용 데이터에 접근할 수 있습니다.
dir
이 열거형 속성은 해당 요소의 텍스트 방향성을 나타냅니다. 이 속성은 다음과 같은 값을 가질 수 있습니다:
  • ltr, 왼쪽에서 오른쪽을 의미하며 영어와 같이 왼쪽에서 오른쪽 방향으로 기록되는 언어에 사용됩니다;
  • rtl, 오른쪽에서 왼쪽을 의미하며 아랍어와 같이 오른쪽에서 왼쪽 방향으로 기록되는 언어에 사용됩니다;
  • auto, 사용자 에이전트가 결정하도록 합니다. 사용자 에이전트는 방향성이 강한 문자를 찾을 때까지 요소 내의 문자들을 파싱하고, 그 방향성을 요소 전체에 적용하는 기본 알고리즘을 사용합니다.
draggable
이 열거형 속성은 해당 요소가 Drag and Drop API를 사용한 드래그(drag)가 가능한지를 나타냅니다. 이 속성은 다음과 같은 값을 가질 수 있습니다:
  • true, 해당 요소를 드래그할 수 있음을 나타냅니다.
  • false, 해당 요소를 드래그할 수 없음을 나타냅니다.
dropzone
이 열거형 속성은 요소에 Drag and Drop API를 사용하여 어떤 유형의 컨텐츠를 드랍(drop)할 수 있는지를 나타냅니다. 이 속성은 다음과 같은 값을 가질 수 있습니다:
  • copy, 드랍될 때 드래그된 요소의 사본이 생성될 것임을 나타냅니다.
  • move, 새로운 위치로 드래그된 요소가 이동할 것임을 나타냅니다.
  • link, 드래그된 데이터에 대한 링크가 생성됩니다.
hidden
이 부울 속성은 해당 요소가 아직까지 또는 더 이상 관련이 없음을 나타냅니다. 예를 들어, 로그인 절차가 완료될 때까지 사용될 수 없는 페이지의 요소를 숨기는데 사용할 수 있습니다. 브라우저는 이런 요소를 렌더링하지 않습니다. 이 속성은 정당하게 보여줘야 할 컨텐츠를 숨기기위해 사용되어서는 안됩니다.
id
문서 전체에서 유일해야 하는 고유 식별자(idenifier;ID)를 정의합니다. 이 식별자의 용도는 (단편적인 식별자를 사용해)링크하거나 스크립팅 또는 CSS를 이용한 스타일링 시 해당 요소를 식별하는데 사용됩니다.
is
표준 HTML 요소가 등록된 사용자 정의 기본 요소(registered custom built-in element)처럼 동작하도록 지정합니다 (자세한 내용은 Using custom elements 참조).

참고: item* 속성은 WHATWG HTML Microdata feature의 일부입니다.

itemid
아이템의 고유하고 전역적인 식별자입니다.
itemprop
아이템에 속성(properties)을 추가할 때 사용합니다. 모든 HTML 요소에는 이름과 값의 쌍으로 구성된 itemprop 속성을 명시할 수 있습니다.
itemref
itemscope 속성을 가진 요소에 속하지 않는 속성들(properties)은 itemref를 사용하여 item에 연결할 수 있습니다. 여기에는 문서 내의 다른 위치에 있는 추가적인 특성을 갖는 요소 id(itemids 가 아닌)목록이 제공됩니다.
itemscope
itemscope은 (일반적으로) itemtype과 같이 사용하여 블록에 포함된 HTML이 특정 item에 대한 것임을 나타냅니다. itemscope은 item을 생성하고 그 item에 연결된 itemtype의 범위를 정의합니다. itemtype은 item과 속성 컨텍스트를 설명하는 (schema.org와 같은) 어휘(vocabulary)에 대한 유효한 URL입니다.
itemtype
데이터 구조에서 itemprops (item properties)을 정의하는 데 사용할 단어의 URL을 지정합니다. itemscope은 데이터 구조 내에서 itemtype에 의해 설정된 어휘가 활성화되는 범위를 설정하는 데 사용됩니다.
lang
요소의 언어를 정의하는데 도움을 줍니다: 편집할 수 없는 요소가 있는 언어 또는 사용자가 요소를 편집할 수 있는 언어를 정의하는 데 도움이 됩니다(the language that non-editable elements are in, or the language that editable elements should be written in by the user). 이 속성은 언어 식별 태그(Tags for Identifying Languages (BCP47))에 정의된 형식의 하나의 "언어 태그"(하이픈으로 구분된 "언어 하위 태그(language subtags)"로 구성된)를 포함합니다. xml:lang은 이보다 우선합니다.
slot
요소에 shadow DOM의 shadow tree에 있는 슬롯을 할당합니다: slot 속성을 가진 요소는 name 속성의 값이 해당 slot 속성의 값과 일치하는 {HTMLElement("slot")}} 요소가 생성한 슬롯에 할당됩니다.
spellcheck
An enumerated attribute defines whether the element may be checked for spelling errors. It may have the following values:
  • true, which indicates that the element should be, if possible, checked for spelling errors;
  • false, which indicates that the element should not be checked for spelling errors.
style
Contains CSS styling declarations to be applied to the element. Note that it is recommended for styles to be defined in a separate file or files. This attribute and the <style> element have mainly the purpose of allowing for quick styling, for example for testing purposes.
tabindex
An integer attribute indicating if the element can take input focus (is focusable), if it should participate to sequential keyboard navigation, and if so, at what position. It can takes several values:
  • a negative value means that the element should be focusable, but should not be reachable via sequential keyboard navigation;
  • 0 means that the element should be focusable and reachable via sequential keyboard navigation, but its relative order is defined by the platform convention;
  • a positive value means that the element should be focusable and reachable via sequential keyboard navigation; the order in which the elements are focused is the increasing value of the tabindex. If several elements share the same tabindex, their relative order follows their relative positions in the document.
title
Contains a text representing advisory information related to the element it belongs to. Such information can typically, but not necessarily, be presented to the user as a tooltip.
translate
An enumerated attribute that is used to specify whether an element's attribute values and the values of its Text node children are to be translated when the page is localized, or whether to leave them unchanged. It can have the following values:
  • empty string and "yes", which indicates that the element will be translated.
  • "no", which indicates that the element will not be translated.

Specifications

Specification Status Comment
HTML Living Standard
The definition of 'Global attributes' in that specification.
Living Standard From latest snapshot, HTML 5.1, itemid, itemprop, itemref, itemscope, and itemtype have been added.
HTML 5.1
The definition of 'Global attributes' in that specification.
Recommendation Snapshot of HTML Living Standard. From HTML5, spellcheck, draggable, and dropzone have been added.
HTML5
The definition of 'Global attributes' in that specification.
Recommendation Snapshot of HTML Living Standard. From HTML 4.01 Specification, the concept of global attributes is introduced and the dir, lang, style, id, class, tabindex, accesskey, and title are now true global attributes.
xml:lang which was initially part of XHTML, is now also part of HTML.
hidden, data-*, contextmenu, contenteditable, and translate have been added.
HTML 4.01 Specification Recommendation There are no global attributes defined. Several attributes that will become global attributes in subsequent specifications are defined on a subset of elements.
class and style are supported on all elements but <base>, <basefont>, <head>, <html>, <meta>, <param>, <script>, <style>, and <title>.
dir is supported on all elements but <applet>, <base>, <basefont>, <bdo>, <br>, <frame>, <frameset>, <iframe>, <param>, and <script>.
id is supported on all elements but <base>, <head>, <html>, <meta>, <script>, <style>, and <title>.
lang is supported on all elements but <applet>, <base>, <basefont>, <br>, <frame>, <frameset>, <iframe>, <param>, and <script>.
tabindex is only supported on <a>, <area>, <button>, <object>, <select>, and <textarea>.
accesskey is only supported on <a>, <area>, <button>, <input>, <label>, <legend> and <textarea>.
title is supported on all elements but <base>, <basefont>, <head>, <html>, <meta>, <param>, <script>, and <title>.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
accesskeyChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
autocapitalizeChrome ? Edge ? Firefox ? IE ? Opera ? Safari ? WebView Android ? Chrome Android ? Edge Mobile ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ?
classChrome Full support YesEdge Full support YesFirefox Full support 32IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 32Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
contenteditableChrome Full support YesEdge Full support YesFirefox Full support 3IE Full support 5.5Opera Full support 9Safari 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 ?
contextmenu
Deprecated
Chrome Full support 52
Notes Disabled
Full support 52
Notes Disabled
Notes This was removed from the Enable Experimental Web Platform Features due to a Web compatibility issue. In June 2017, it was removed entirely from the browsers. This is documented in Chromium bug 87553.
Disabled From version 52: this feature is behind the --enable-blink-features runtime flag (needs to be set to ContextMenu).
No support ? — 52
Disabled
Disabled Until version 52 (exclusive): this feature is behind the Enable experimental Web Platform features preference. To change preferences in Chrome, visit chrome://flags.
Edge No support NoFirefox Full support 9IE No support NoOpera Full support 39
Notes Disabled
Full support 39
Notes Disabled
Notes This was removed from the Enable Experimental Web Platform Features due to a Web compatibility issue. In June 2017, it was removed entirely from the browsers. This is documented in Chromium bug 87553.
Disabled From version 39: this feature is behind the --enable-blink-features runtime flag (needs to be set to ContextMenu).
No support ? — 39
Disabled
Disabled Until version 39 (exclusive): this feature is behind the Enable experimental Web Platform features preference.
Safari No support NoWebView Android No support ? — 52
Disabled
No support ? — 52
Disabled
Disabled Until version 52 (exclusive): this feature is behind the Enable experimental Web Platform features preference.
Chrome Android No support ? — 52
Disabled
No support ? — 52
Disabled
Disabled Until version 52 (exclusive): this feature is behind the Enable experimental Web Platform features preference. To change preferences in Chrome, visit chrome://flags.
Edge Mobile No support NoFirefox Android No support 32 — 56
Notes
No support 32 — 56
Notes
Notes Support for the contextmenu attribute has been removed from Firefox for Android (See bug 1424252).
Opera Android No support NoSafari iOS No support NoSamsung Internet Android Full support Yes
data-* attributesChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
dirChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
draggableChrome Full support YesEdge Full support YesFirefox Full support 2IE Full support YesOpera Full support 12Safari 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 ?
dropzone
Experimental
Chrome No support ? — 58
Prefixed
No support ? — 58
Prefixed
Prefixed Requires the vendor prefix: -webkit-
Edge No support NoFirefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android No support ? — 58
Prefixed
No support ? — 58
Prefixed
Prefixed Requires the vendor prefix: -webkit-
Chrome Android No support ? — 58
Prefixed
No support ? — 58
Prefixed
Prefixed Requires the vendor prefix: -webkit-
Edge Mobile No support NoFirefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android Full support Yes
hiddenChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support 11Opera Full support YesSafari Full support YesWebView Android Full support 4Chrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
idChrome Full support YesEdge Full support YesFirefox Full support 32
Full support 32
No support ? — 32
Notes
Notes id is a true global attribute only since Firefox 32.
IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 32
Full support 32
No support ? — 32
Notes
Notes id is a true global attribute only since Firefox 32.
Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
isChrome Full support 67Edge No support NoFirefox Full support 63
Full support 63
Full support 59
Disabled
Disabled From version 59: this feature is behind the dom.webcomponents.customelements.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
No support ? — 59
Disabled
Disabled Until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.customelements.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
IE No support NoOpera Full support 55Safari No support NoWebView Android Full support 67Chrome Android Full support 67Edge Mobile No support NoFirefox Android Full support 63
Full support 63
Full support 59
Disabled
Disabled From version 59: this feature is behind the dom.webcomponents.customelements.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
No support ? — 59
Disabled
Disabled Until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.customelements.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Opera Android Full support 55Safari iOS No support NoSamsung Internet Android No support No
itemidChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
itempropChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
itemrefChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
itemscopeChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
itemtypeChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
langChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
slot
Experimental
Chrome Full support 53Edge ? Firefox Full support 63
Full support 63
Full support 59
Disabled
Disabled From version 59: this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
No support ? — 59
Disabled
Disabled Until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.shadowdom.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
IE ? Opera Full support 40Safari Full support 10
Prefixed
Full support 10
Prefixed
Prefixed Requires the vendor prefix: -webkit-
WebView Android Full support 53Chrome Android Full support 53Edge Mobile ? Firefox Android Full support 63
Full support 63
Full support 59
Disabled
Disabled From version 59: this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
No support ? — 59
Disabled
Disabled Until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.shadowdom.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Opera Android Full support 40Safari iOS Full support 10.1Samsung Internet Android Full support 6.0
spellcheckChrome Full support 9Edge Full support YesFirefox Full support YesIE Full support 11Opera Full support YesSafari Full support YesWebView Android Full support 47Chrome Android Full support 47Edge Mobile Full support YesFirefox Android Full support 57Opera Android Full support 37Safari iOS Full support 9.3Samsung Internet Android Full support 5.0
styleChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
tabindexChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
titleChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
translate
Experimental
Chrome No support NoEdge No support NoFirefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile No support NoFirefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android No support No

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.
See implementation notes.
See implementation notes.
User must explicitly enable this feature.
User must explicitly enable this feature.
Requires a vendor prefix or different name for use.
Requires a vendor prefix or different name for use.

See also

문서 태그 및 공헌자

이 페이지의 공헌자: dolmoon, lovefield, super-atom, nonpuritan
최종 변경자: dolmoon,