210330-2
TAG
html은 글로벌 어트리뷰트를 지원한다. 특히 lang 어트리뷰트를 사용하는 경우가 많다. 다음은 한국어를 주언어로 사용하는 경우
<html lang="ko">
title tag
title 요소 - 문서의 제목을 정의
style tag
style 요소 - HTML 문서를 위한 style 정보를 정의
<html>
<head>
<meta charset="utf-8">
<title>문서 제목</title>
<style>
body {
background-color: yellow;
color: blue;
}
</style>
</head>
<body>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</body>
</html>
link tag
link 요소 - 외부 리소스와의 연계 정보 정의 (주로 HTML과 외부 CSS파일을 연계에 사용)
<link rel="stylesheet" href="style.css">
script tag
script 요소 - client-side JavaScript를 정의
<script>
document.addEventListener('click', function () {
alert('Clicked!');
});
</script>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<p>안녕하세요</p>
<p>Hello</p>
<p>こんにちは</p>
<p>你好</p>
<p>שלום</p>
<p>สวัสดี</p>
</body>
</html>
SEO(검색엔진 최적화)를 위해 검색엔진이 사용할 keywords을 정의한다.
<meta name="keywords" content="HTML, CSS, XML, XHTML, JavaScript">
웹페이지의 설명을 정의한다.
<meta name="description" content="Web tutorials on HTML and CSS">
웹페이지의 저자을 명기한다.
<meta name="author" content="John Doe">
웹페이지를 30초 마다 Refresh한다.
<meta http-equiv="refresh" content="30">