HTML <html> 태그


예시

간단한 HTML 문서:

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Title of the document</title>
</head>
<body>

<h1>This is a heading</h1>
<p>This is a paragraph.</p>

</body>
</html>

정의 및 사용

<html>태그는 HTML 문서의 루트를 나타냅니다 .

<html>태그는 다른 모든 HTML 요소의 컨테이너입니다( < !DOCTYPE> 태그 제외).

참고: 웹 페이지의 언어를 선언하려면 항상 태그 내부에 lang 속성을 포함해야 합니다. <html>이것은 검색 엔진과 브라우저를 지원하기 위한 것입니다.


브라우저 지원

Element
<html> Yes Yes Yes Yes Yes


속성

Attribute Value Description
xmlns http://www.w3.org/1999/xhtml Specifies the XML namespace attribute (If you need your content to conform to XHTML)

전역 속성

<html>태그는 HTML의 전역 속성도 지원 합니다 .


관련 페이지

HTML 튜토리얼: HTML 소개

HTML DOM 참조: HTML 개체


기본 CSS 설정

대부분의 브라우저는 <html>다음 기본값으로 요소를 표시합니다.

html {
  display: block;
}

html:focus {
  outline: none;
}