오늘은 지금까지 배운 태그 및 내용들을 정리해보려고 한다.

 

HTML 문서의 기본 구조

HTML 문서는 최상위 태그인 <html> 태그 안에, 그 다음으로 상위 태그인 <head>와 <body> 태그가 있다.

<head> 태그는 본문에 나타나지는 않지만, 본문의 속성들을 설명해 주는 경우가 많다.

반면 <body> 태그 안에는 본문에 표시되는 내용이 들어간다.

 

예시로 section.blog.naver.com/BlogHome.nhn?directoryNo=0&currentPage=1&groupId=0

네이버 블로그 메인페이지의 html 소스를 살펴보면, 

<head> 태그 안에는 <meta>, <script>, <link>, <title>, <base> 등 특정 태그가 중점적으로 쓰이는 걸 볼 수 있다.

 

여기서 지금 알고 있는 건 <title> 태그와 <base> 태그이다.

<meta> 태그도 사용한 적은 있는데, 안에 속성들이 너무 다양해서 다방면으로 사용하는 방법은 모른다.

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title>web review</title>
  </head>
  <body>
    <p>
      Machine learning (ML) is the study of computer algorithms that improve automatically through experience and by the use of data.[1] It is seen as a part of artificial intelligence. Machine learning algorithms build a model based on sample data, known as "training data", in order to make predictions or decisions without being explicitly programmed to do so.[2] Machine learning algorithms are used in a wide variety of applications, such as email filtering and computer vision, where it is difficult or unfeasible to develop conventional algorithms to perform the needed tasks. <br><br> A subset of machine learning is closely related to computational statistics, which focuses on making predictions using computers; but not all machine learning is statistical learning. The study of mathematical optimization delivers methods, theory and application domains to the field of machine learning. Data mining is a related field of study, focusing on exploratory data analysis through unsupervised learning.[4][5] In its application across business problems, machine learning is also referred to as predictive analytics.
    </p>
  </body>
</html>

궁금증)

<html lang="ko"> 와 <meta charset="utf-8"> 의 차이점은 무엇일까?

1) meta charset="utf-8"

: meta 는 다른 데이터를 설명해 주는 데이터를 의미하고, 즉 이 태그는 다른 데이터를 설명할 때 쓰는 태그이다.

charset 는 character set 의 약자로, 문자가 어떤 방식으로 코딩/입력되는지를 의미한다.

charset 에도 여러 종류가 있다. ex) meta charset = "euc-kr" 로 설정하면 한국어, 영어, 일본어만 입력 가능하다.

그런데 utf-8은 유니코드를 위한 문자셋을 의미해서, 웬만한 다국어를 있는 그대로의 문자로 나타낼 수 있다.

2) html lang = "ko"

: html은 가장 최상위 태그이다. html 태그 안의 lang 속성은 해당 문서에서 어떤 언어를 사용할지를 지정한다.

homzzang.com/b/html-156 우리나라는 "ko", 영어는 "en" 등 나라마다 언어 코드가 있다. (왼쪽 링크에서 볼 수 있음)

+ dir = "ltr" 은 무슨 의미?

dir = direction 의 약자. 글자가 입력되는 방향을 의미.

ltr = left to right 를 의미. 즉 글자가 왼쪽에서 오른쪽으로 입력된다는 의미이다!

 

그럼 아까의 예시에서 dir = "rtl" (right to left) 로 설정하면 어떻게 될까?

<!DOCTYPE html>
<html lang="en" dir="rtl">
  <head>
    <meta charset="utf-8">
    <title>web review</title>
  </head>
  <body>
    <p>
      Machine learning (ML) is the study of computer algorithms that improve automatically through experience and by the use of data.[1] It is seen as a part of artificial intelligence. Machine learning algorithms build a model based on sample data, known as "training data", in order to make predictions or decisions without being explicitly programmed to do so.[2] Machine learning algorithms are used in a wide variety of applications, such as email filtering and computer vision, where it is difficult or unfeasible to develop conventional algorithms to perform the needed tasks. <br><br> A subset of machine learning is closely related to computational statistics, which focuses on making predictions using computers; but not all machine learning is statistical learning. The study of mathematical optimization delivers methods, theory and application domains to the field of machine learning. Data mining is a related field of study, focusing on exploratory data analysis through unsupervised learning.[4][5] In its application across business problems, machine learning is also referred to as predictive analytics.
    </p>
  </body>
</html>

이처럼 같은 텍스트를 '오른쪽 정렬' 한 방식으로 출력된다.

'front-side > HTML' 카테고리의 다른 글

새로운 태그 공부  (0) 2021.03.23
18. 웹호스팅 ~ 19. 웹서버 운영하기 + HTML 태그 공부  (0) 2021.03.22
웹 페이지 완성 ~ 원시 웹  (0) 2021.03.19

+ Recent posts