MDN’s new design is in Beta! A sneak peek: https://blog.mozilla.org/opendesign/mdns-new-design-beta/

현재 번역은 완벽하지 않습니다. 한국어로 문서 번역에 동참해주세요.

글로벌 속성(Global attributes) 모든  HTML의 공통 속성입니다; 몇몇 엘리먼트에선 효과가 적용되지 않을 수 있지만, 글로벌 속성은 모든 엘리먼트에 사용될 수 있습니다.

글로벌 속성(Global attributes)은 표준으로 지정 되지 않은 HTML 요소을 포함해 모든 요소에 대해서도 사용 될 수 있습니다. 이는 더이상  HTML5에서 사용되지 않는 비표준 요소들에서 조차도 글로벌 속성이 적용된다는 걸 의미합니다. 예를 들어, HTML5를 준수하는 브라우저에서는 <foo>가 HTML요소로 표준은 아니지만, <foo hidden>...<foo>와 같이 사용하면 화면에 출력되지 않습니다.

추가적인 기본 HTML 글로벌 속성에는 아래와 같은 속성들이 있습니다:

  • Both xml:lang and xml:base, deprecated, inherited from the XHTML specifications and kept for compatibility purpose.
  • 접근성 향상을 위해 사용하는 여러가지 aria-* 속성.
  • 이벤트 핸들러 속성 : 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
현재 요소에 접근하는 키보드 단축키를 생성하는 가이드를 제공합니다. 이 속성은 공백으로 구분되는 문자열로 구성됩니다. 브라우저에서 키보드 자판에 있는 키를 조합하여 사용됩니다.
class
요소 클래스의 공백으로 구분 된 목록입니다. 클래스를 사용하면 CSS 및 자바스크립트가 Document.getElementsByClassName() 메서드와 같은 클래스 선택자 또는 함수를 통해 특정 요소를 선택하고 접근할 수 있습니다.
contenteditable
요소를 사용자가 편집 할 수 있는지 에 대한 여부를 나타내는 열거 형 속성 입니다. 브라우저는 편집을 허용 하도록 위젯을 수정해줍니다, 속성은 다음 값 중 하나를 사용해야 합니다 :
  • true 혹은 공백문자 , 요소가 편집 가능해야 함을 나타냅니다.
  • false, 이 요소는 편집 할 수 없어야 함을 나타냅니다.
contextmenu
<menu>id 는 이 요소에 대한 문맥 메뉴 입니다.
data-*
속성 클레스 형식, 사용자 지정 테이터 속성,  스크립트에 의해 사용될 수있는 HTML 표현과 DOM 표현 사이에 독점 정보가 교환 될 수 있도록 허용. 모든 독점 정보는 속성이 설정된 요소의 HTMLElement 인터페이스를 통해 사용 할 수 있습니다. HTMLElement.dataset 속성은 그것들에 대한 액세스를 제공합니다.
dir
요소의 텍스트 방향성을 나타내는 열거 형 속성입니다. 다음 값을 가질 수 있습니다:
  • ltr, 왼쪽에서 오른쪽 을 의미하며 왼쪽에서 오른쪽으로 쓰여진 언어에 사용됩니다. (영어 같은것);
  • rtl, 오른쪽에서 왼쪽을 의미하며 오른쪽에서 왼쪽으로 쓰여진 언어에 사용됩니다. (아랍어 같은것);
  • auto, user agent 가 결정합니다. It uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then apply that directionality to the whole element.
draggable
Is an enumerated attribute indicating whether the element can be dragged, using the Drag and Drop API. It can have the following values:
  • true, which indicates that the element may be dragged
  • false, which indicates that the element may not be dragged.
dropzone
Is an enumerated attribute indicating what types of content can be dropped on an element, using the Drag and Drop API. It can have the following values:
  • copy, which indicates that dropping will create a copy of the element that was dragged
  • move, which indicates that the element that was dragged will be moved to this new location.
  • link, will create a link to the dragged data.
hidden
Is a Boolean attribute indicates that the element is not yet, or is no longer, relevant. For example, it can be used to hide elements of the page that can't be used until the login process has been completed. The browser won't render such elements. This attribute must not be used to hide content that could legitimately be shown.
id
전체 문서에서 고유해야하는 고유 식별자 (ID)를 정의합니다. 그 목적은 링크 (using a fragment identifier), 스크립팅 또는 스타일 지정 (CSS)시 요소를 식별하는 것입니다.
itemid
itemprop
itemref
itemscope
itemtype
These attributes are related to the WHATWG HTML Microdata feature.
lang
Participates in defining the language of the element, the language that non-editable elements are written in or the language that editable elements should be written in. The tag contains one single entry value in the format defines in the Tags for Identifying Languages (BCP47) IETF document. xml:lang has priority over it.
spellcheck
Is 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
Is an integer attribute indicates 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 which means should be focusable and reachable via sequential keyboard navigation; its relative order is defined by the value of the attribute: the sequential follow the increasing number of the tabindex. If several elements share the same tabindex, their relative order follows their relative position 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
Is 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
WHATWG HTML Living Standard
The definition of 'Global attributes' in that specification.
Living Standard From latest snapshot, HTML5.1, itemid, itemprop, itemref, itemscope, and itemtype have been added.
HTML5.1
The definition of 'Global attributes' in that specification.
Recommendation Snapshot of WHATWG HTML Living Standard. From HTML5, spellcheck, draggable, and dropzone have been added.
HTML5
The definition of 'Global attributes' in that specification.
Recommendation Snapshot of WHATWG 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

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
accesskey (Yes) (Yes) (Yes) (Yes) (Yes)
class (Yes) (Yes) (Yes) (Yes) (Yes)
contenteditable (Yes) 3.0 (1.9) (Yes) (Yes) (Yes)
contextmenu No support 9 (9) No support No support No support
data-* (Yes) 6 (6) (Yes) (Yes) (Yes)
dir (Yes) (Yes) (Yes) (Yes) (Yes)
draggable (Yes) 2.0 (1.8.1) (Yes) (Yes) (Yes)
dropzone ? No support ? ? ?
hidden (Yes) 4.0 (2) (Yes) (Yes) (Yes)
id (Yes) (Yes) (Yes) (Yes) (Yes)
itemid, itemprop, itemref, itemscope, itemtype ? (Yes) ? ? ?
lang (Yes) (Yes) (Yes) (Yes) (Yes)
spellcheck (Yes) 2.0 (1.8.1) (Yes) (Yes) (Yes)
style (Yes) (Yes) (Yes) (Yes) (Yes)
tabindex (Yes) (Yes) (Yes) (Yes) (Yes)
title (Yes) (Yes) (Yes) (Yes) (Yes)
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
accesskey (Yes) (Yes) (Yes) (Yes) (Yes) (Yes)
class (Yes) (Yes) (Yes) (Yes) (Yes) (Yes)
contenteditable (Yes) (Yes) 1.0 (1.9) (Yes) (Yes) ?
contextmenu No support No support No support No support No support No support
data-* (Yes) (Yes) 6.0 (6) (Yes) (Yes) ?
dir (Yes) (Yes) (Yes) (Yes) (Yes) ?
draggable (Yes) (Yes) 1.0 (1.8.1) (Yes) (Yes) ?
dropzone ? ? No support ? ? ?
hidden (Yes) (Yes) 4.0 (2) (Yes) (Yes) (Yes)
id (Yes) (Yes) (Yes) (Yes) (Yes) (Yes)
itemid, itemprop, itemref, itemscope, itemtype ? ? (Yes) ? ? ?
lang (Yes) (Yes) (Yes) (Yes) (Yes) (Yes)
spellcheck (Yes) (Yes) 1.0 (1.8.1) (Yes) (Yes) ?
style (Yes) (Yes) (Yes) (Yes) (Yes) (Yes)
tabindex (Yes) (Yes) (Yes) (Yes) (Yes) (Yes)
title (Yes) (Yes) (Yes) (Yes) (Yes) (Yes)

See also

문서 태그 및 공헌자

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