HTML 中的元标记用于定义有关网页或 HTML 文档的数据。借助元标记,可以定义文档的描述、上次更新时的作者信息;它用于给出 HTML 文档的详细属性。元标记在 中定义。 HTML 标签,包含在
中部分。对于网页设计者来说,显示网页的实际显示部分是最有用的。整个视口控制将由他们使用 HTML 5 中的元标记来完成。大多数浏览器都会引用元标记来实现许多有用的功能,例如刷新页面、显示网页内容以及它们使用的 Web 服务。语法
head 部分使用的元标记如下:
<meta charset="utf-8">
在上面的语法中,它指出 charset=”utf-8” 为显示任何类型的语言提供了最佳支持。
这是具有某些值的元标记的另一种语法是:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
它用于处理视口的大小及其所有页面尺寸值和页面滚动,以完美地适应我们的网页在任何类型的设备上。
HTML 中的元标记列表
HTML 中使用了不同类型的 Meta 标签;我们来一一看看:
1。 这是一个非常基本的元标记,用于定义任何类型的语言。
2。 用于定义最多 150 个单词的内容描述。
3。 用于保留所定义公司的所有版权。
4。 用于定义特定网页的摘要。
5。 它用于定义 HTML 文档的作者。
6。 用于定义标签属性中定义的特定公司的URL地址。
7。 它用于处理我们文档中的评级。
8。 如果我们想为 HTML 文档定义副标题,那么可以使用此标签。
9。 它用于在指定的时间刷新我们的网页垃圾邮件。
10。 它用于按定义的实体值对我们的文档进行分类。
11。 这个标签用来指定Meta标签中的一些关键词,这样就可以在我们的文档中轻松搜索到这些内容。
12。 此标签用于定义我们文档的摘要。
HTML 中元标记的工作
HTML中的Meta标签主要用于在我们的网页文档中包含机器可读的信息,这些信息在网页上实际上是不可见的。这个标签在 HTML 中的另一个最重要的工作是,借助这个标签,人们可以使用这个元标签功能轻松重定向到另一个网页。
元标记可以正常工作的一些属性列表如下:
1。内容: 元标记中的内容就像其包含的元标记的值一样。
2。名称: 名称用作元标记的属性。它以详细信息、所有者、关键字等形式出现。
3。 http-equiv: 该属性用于定义文档中的标头详细信息。
4。 Charset: 它是 Meta 标签中的主要属性,用于定义字符编码以在其文档中进行声明。
5。方案: 该属性用于定义将使用实际元标记的方案。但 HTML5 不支持这种类型的属性。
HTML 中元标记的示例
让我们看一些例子
示例#1
我们将使用Meta标签,它会被计算机系统读取,但网页的访问者看不到任何内容。
HTML 代码:
<meta charset="UTF-8"> <meta name="description" content="Meta tag details information here"> <meta name="robots" content="Robotics"> <meta name="hotmail:card" content="summary">
输出:它将显示空白屏幕作为输出。
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:
<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"> <h1 id="EDUCBA">EDUCBA</h1> <h2 id="Become-an-Awesome-Design-Expert">Become an Awesome Design Expert</h2> <p>EDUCBA- All about online certification courses</p> <h4 id="Learn-Graphic-designing-Animation-Game-Development-Video-Editing-amp-more-with-our-Online-Certification-Courses">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>
Output: The webpage shown in output will refresh every 5 seconds.
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:
<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/"> <p>EDUCBA- All about online certification courses</p>
Output:
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中文网其他相关文章!

WebDevelovermentReliesonHtml,CSS和JavaScript:1)HTMLStructuresContent,2)CSSStyleSIT和3)JavaScriptAddSstractivity,形成thebasisofmodernWebemodernWebExexperiences。

HTML的作用是通过标签和属性定义网页的结构和内容。1.HTML通过到、等标签组织内容,使其易于阅读和理解。2.使用语义化标签如、等增强可访问性和SEO。3.优化HTML代码可以提高网页加载速度和用户体验。

htmlisaspecifictypefodyfocusedonstructuringwebcontent,而“代码” badlyLyCludEslanguagesLikeLikejavascriptandPytyPythonForFunctionality.1)htmldefineswebpagertuctureduseTags.2)“代码”代码“ code” code code code codeSpassSesseseseseseseseAwiderRangeLangeLangeforLageforLogageforLogicIctInterract

HTML、CSS和JavaScript是Web开发的三大支柱。1.HTML定义网页结构,使用标签如、等。2.CSS控制网页样式,使用选择器和属性如color、font-size等。3.JavaScript实现动态效果和交互,通过事件监听和DOM操作。

HTML定义网页结构,CSS负责样式和布局,JavaScript赋予动态交互。三者在网页开发中各司其职,共同构建丰富多彩的网站。

HTML适合初学者学习,因为它简单易学且能快速看到成果。1)HTML的学习曲线平缓,易于上手。2)只需掌握基本标签即可开始创建网页。3)灵活性高,可与CSS和JavaScript结合使用。4)丰富的学习资源和现代工具支持学习过程。

AnexampleOfAstartingTaginHtmlis,beginSaparagraph.startingTagSareEssentialInhtmlastheyInitiateEllements,defiteTheeTheErtypes,andarecrucialforsstructuringwebpages wepages webpages andConstructingthedom。

如何设计菜单中的虚线分割效果?在设计菜单时,菜名和价格的左右对齐通常不难实现,但中间的虚线或点如何...


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

MinGW - 适用于 Windows 的极简 GNU
这个项目正在迁移到osdn.net/projects/mingw的过程中,你可以继续在那里关注我们。MinGW:GNU编译器集合(GCC)的本地Windows移植版本,可自由分发的导入库和用于构建本地Windows应用程序的头文件;包括对MSVC运行时的扩展,以支持C99功能。MinGW的所有软件都可以在64位Windows平台上运行。

适用于 Eclipse 的 SAP NetWeaver 服务器适配器
将Eclipse与SAP NetWeaver应用服务器集成。

记事本++7.3.1
好用且免费的代码编辑器

Dreamweaver Mac版
视觉化网页开发工具

SublimeText3 Linux新版
SublimeText3 Linux最新版