본문 바로가기
Mark Up/HTML

[HTML] Chapter 08. head 태그를 구성하는 요소들

by song.ift 2023. 1. 4.
<!DOCTYPE html>
<html lang="en">

<head>
</head>

<body>
</body>

</html>

 

1. css 파일들 <link>

<link rel="stylesheet" type="text/css" href="/examples/media/expand_style.css">

2. style

<style>
  body { background-color: lightpink }
  h1 { color: red; }
  p { text-decoration: underline; }
</style>

3. title

<title>타이틀</title>

4. meta

<meta charset="UTF-8">
<meta name="description" content="Fremm Web tutorials">
<meta name="keywords" content="HTML, CSS, JavaScript">
<meta name="author" content="John Doe">
<meta name="viewport" content="width-device-width, initial-scale=1.0">
  • <meta charset="UTF-8">  
    • 어떤 방식으로 렌더링되는지 설정
  • <meta name="description" content="Fremm Web tutorials"> 
    • 웹 사이트에 대한 일방적인 설명
  • <meta name="keywords" content="HTML, CSS, JavaScript">
    • 웹 사이트에서 담고있는 내용이 어떤 keyword에 대한 설명
  • <meta name="author" content="John Doe">
    • 누가 만들었는지
  • <meta name="viewport" content="width-device-width, initial-scale=1.0">
    • 기기 별로 비율이 다른데, 비율을 맞추는 용도

사용자 눈에 보이지는 않지만, html 파일에 대한 부가적인 설명을 담고있다.

배포된 html 파일 url을 다른 곳에 첨부했을 때, 나오는 내용들을 정의해줄 수 있고, 검색 솔루션(구글, 네이버 등)에서 어떤 웹사이트인가 판단할 수 있게 도와주는 SEO(검색 최적화)에 도움을 주는 태그이다.

5. favicon ico

<link rel="icon" type="image/x-icon" href="/images/favicon.ico">

 

댓글