본문으로 건너뛰기

The <head> Tag

The head Tag

A web page is essentially divided into two main parts: the visible content on the screen and the information that communicates with the browser.

The part that communicates information to the browser is contained within the <head> tag.

The <head> tag holds the meta information of a web document.

Meta information includes the web page's title, character encoding, stylesheets, scripts, and more.


Key Elements

1. The title Tag

Defines the title of the web page. This title is displayed in the browser's tab.

<head>
<title>My First Webpage</title>
</head>

2. The meta Tag

Defines metadata about the webpage, which can be information for search engines.

For instance, you can set the webpage's character encoding (which converts characters into a format that a computer can use), viewport settings (the visible area of the screen), and description of the page using meta tags.

<head>
<meta charset="UTF-8" />
<!-- Character encoding -->
<meta name="description" content="Welcome to my first webpage!" />
<!-- Page description -->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Viewport settings -->
</head>

Used to link external resources. It is often used to import fonts or connect stylesheets (CSS files that define the style of webpages).

<link
href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR"
rel="stylesheet"
/>

4. The script Tag

Loads JavaScript files or code, which act as the brain of the website.

JavaScript is used to control the behavior of the page, such as actions when a button is clicked.

<head>
<script src="script.js"></script>
</head>

다음 내용이 궁금하다면?

월 12,500원 PLUS 멤버십 가입 or 강의를 등록해 주세요!