HTML_04_title, meta, charset, uft-8, !doctype html

charl hi·2021년 1월 9일
0

HTML

목록 보기
4/7

title

  • 웹페이지의 이름
  • defines the title of the document.
  • 웹브라우저의 탭의 이름으로 보인다.
  • it is shown in the browser's title bar or in the page's tab.
  • <head> ~ </head> 안에! 본문(<body> ~ </body>) 안이 아니다!

예)

<head>
    <title>WEB1 - html</title>
</head>

meta & charset & utf-8

meta

  • meta = meradata (데이터에 대한 데이터)
  • defines metadata about an HTML document.
  • typically used to specify character set, page description, keywords, author of the document, and viewport settings.
  • <head> ~ </head> 안에!

charset

  • meta 의 속성 중 하나
  • charset = character set (문자 집합)
  • Specifies the character encoding for the HTML document
  • <meta charset="~">
    = ~에 나오는 방식으로 인코딩한다.
    = ~에 나오는 방식으로 해석해서 열어라.

uft-8

  • 전세계 문자와 기호를 원할하게 인코딩하는 방식
  • 인코딩 방식 중 하나
  • utf-8로 인코딩하지 않으면 html문서를 브라우저에서 구현할때 글자가 깨져보이는 현상이 발생할 수 있다.

예)

<head>
    <title>WEB1 - html</title>
    <meta charset="utf-8">
</head>

** 본문이 아니므로 출력되지 않음


head & body & html

  • 본문을 설명
  • a container for metadata
  • <html><body> 사이에 위치

body

  • 출력되는 본문 자체

html

  • <head><body>를 감싼다.

!doctype html

  • 웹페이지가 html로 만들어졌다는 것을 표현
  • 문서의 시작에 위치

예)

<!doctype html>
<html>
   <head>
      <title>cafe PURPLE</title>
      <meta charset="utf-8">
   </head>
   <body>
      <h1>MENU</h1>
      <ol>
         <li>coffee
            <ul>
               <li>americano</li/>
               <li>latte</li/>
            </ul>
         </li>
         <li>tea</li>
         <li>dessert
            <ol>
               <li>bread
                  <ul>
                     <li>donut</li>
                     <li>pretzel</li>
                  </ul>
               </li/>
               <li>cake
                  <ul>
                     <li>chocolate</li>
                     <li>cheese</li>
                  </ul>
               </li/>
            </ol>
         </li>
      </ol>
   </body>
</html>
cafe PURPLE

MENU

  1. coffee
    • americano
    • latte
  2. tea
  3. dessert
    1. bread
      • donut
      • pretzel
    2. cake
      • chocolate
      • cheese

Ref

0개의 댓글