>  기사  >  웹 프론트엔드  >  HTML의 메타 태그

HTML의 메타 태그

WBOY
WBOY원래의
2024-09-04 16:20:50471검색

HTML의 메타 태그는 웹페이지나 HTML 문서에 대한 데이터를 정의하는 데 사용됩니다. 메타 태그를 사용하면 문서 설명, 문서가 마지막으로 업데이트된 작성자 정보를 정의할 수 있습니다. HTML 문서의 자세한 속성을 제공하는 데 사용됩니다. 메타 태그는 에 포함된 HTML 태그 부분. 웹 페이지의 실제 표시 부분을 보여주는 것은 웹 디자이너에게 가장 유용합니다. 전체 뷰포트 제어는 HTML 5의 메타 태그를 사용하여 수행됩니다. 메타 태그는 페이지 새로 고침, 웹 페이지 콘텐츠 표시 및 사용되는 웹 서비스와 같은 많은 유용한 기능을 위해 대부분의 브라우저에서 참조됩니다.

구문

head 섹션에 사용되는 메타태그는 다음과 같습니다.

<meta charset="utf-8">

위 구문에서는 charset=”utf-8”이 모든 종류의 언어 표시에 대한 최상의 지원을 제공한다고 명시되어 있습니다.
다음은 일부 값이 포함된 메타 태그의 또 다른 구문입니다.

<meta name="viewport" content="width=device-width, initial-scale=1.0">

모든 종류의 기기에 웹페이지가 완벽하게 맞도록 모든 페이지 크기 값과 페이지 스크롤로 뷰포트의 크기를 처리하는 데 사용됩니다.

HTML의 메타태그 목록

HTML에는 다양한 유형의 메타 태그가 사용됩니다. 하나씩 살펴보겠습니다:

1. <html> <head> <meta charset="UTF-8"> <meta name="description" content="Meta tag details information here"> <meta name="robots" content="Robotics"/> <meta name="hotmail:card" content="summary"/> </head> </html>

출력: 출력으로 빈 화면이 표시됩니다.

HTML의 메타 태그

Example #2

Here is this example we are going to use different kinds of Meta tags and show the output; the web page will be refresh at every specific time and store cookies for your page, also mentioning its expiry date.

HTML code:

<html>
<head>
<title>Meta Tags Example</title>
<meta name = "keywords" content = "HTML, Meta Tags, Metadata" />
<meta name = "description" content = "Learning about Meta Tags." />
<meta http-equiv = "cookie" content = "userid = xyz;
expires = Tuesday, 31-Dec-19 23:59:59 IST;" />
<meta name = "revised" content = "EDUCBA -Online courses, 3/7/2019" />
<meta http-equiv = "refresh" content = "5" />
</head>
<body>
<h1>EDUCBA</h1>
<h2>Become an Awesome Design Expert</h2>
<p>EDUCBA- All about online certification courses</p>
<h4>Learn Graphic designing, Animation, Game Development, Video Editing & more with our Online Certification Courses</h4>
<p>Choose your interest area and get certified with our online Courses in Finance, Data Science, Software Development, Excel, Design, Project Management, Personal Development, Marketing and Human Resources.</p>
</body>
</html>

Output: The webpage shown in output will refresh every 5 seconds.

HTML의 메타 태그

Example #3

Let’s see another example using meta tags, it will reflect the same as above, but after refreshing the webpage, it will redirect to another webpage which URL’s will be mentioned in the Meta tag as shown in the below HTML code:

HTML code:

<head>
<title>Meta Tags in HTML 5</title>
<meta name = "keywords" content = "HTML 5, Meta Tag" />
<meta name = "description" content = "Detail description of Meta Tags in
HTML 5."/>
<meta http-equiv = "refresh" content = "10; url = https://www.educba.com/" />
</head>
<body>
<p>EDUCBA- All about online certification courses</p>
</body>

Output:

HTML의 메타 태그

HTML의 메타 태그

Conclusion

So, a Meta tag in Html is used to define metadata about HTML documents. The code included in it is a machine-readable format that works well with a webpage but doesn’t show any content on the page to the visitors. Meta tag containing 3 different types of attributes like global, element-specific, and event handler attributes.

위 내용은 HTML의 메타 태그의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
이전 기사:HTML 테이블 태그다음 기사:HTML 테이블 태그