"; 2. ""; 3. "<base>"; 4. "<link>"; 5. "<style>"; 6. " <meta>"; 7. "<script>"; 8. "<noscript>"."/><meta property="og:local" content="faq"> <meta property="og:title" content="What are the head tags of html5-Front-end Q&A-php.cn"> <meta property="og:description" content="The head tags of html5 are: 1. "<head>"; 2. "<title>"; 3. "<base>"; 4. "<link>"; 5. "<style>"; 6. " <meta>"; 7. "<script>"; 8. "<noscript>"."> <meta property="og:url" content="//m.sbmmt.com/m/faq/486099.html"> <meta property="og:image" content="https://img.php.cn/upload/article/202112/17/2021121711215988732.jpg"> <meta property="og:site_name" content="php.cn"> <meta property="og:type" content="website"> <link rel="canonical" href="//m.sbmmt.com/m/faq/486099.html"/> <link rel="alternate" hrefLang="zh-cn" href="//m.sbmmt.com/m/zh/faq/486099.html" /> <link rel="alternate" hrefLang="en" href="//m.sbmmt.com/m/faq/486099.html" /> <link rel="alternate" hrefLang="zh-tw" href="//m.sbmmt.com/m/zh-tw/faq/486099.html" /> <link rel="alternate" hrefLang="ja" href="//m.sbmmt.com/m/ja/faq/486099.html" /> <link rel="alternate" hrefLang="ko" href="//m.sbmmt.com/m/ko/faq/486099.html" /> <link rel="alternate" hrefLang="ms" href="//m.sbmmt.com/m/ms/faq/486099.html" /> <link rel="alternate" hrefLang="fr" href="//m.sbmmt.com/m/fr/faq/486099.html" /> <link rel="alternate" hrefLang="de" href="//m.sbmmt.com/m/de/faq/486099.html" /> <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5, user-scalable=1" /><meta name="applicable-device" content="mobile" /><link rel="stylesheet" href="//m.sbmmt.com/m/static/css/style.css?4.5.31"><link href="//m.sbmmt.com/m/static/front/mobcss/newphpcommon.css?1.1" type="text/css" rel="stylesheet"/><link href="//m.sbmmt.com/m/static/front/mobcss/swiper.min.css" type="text/css" rel="stylesheet"/><link href="//m.sbmmt.com/m/static/front/mobcss/newphp.css?1.2" type="text/css" rel="stylesheet"/><link href="//m.sbmmt.com/m/static/css/global.css" type="text/css" rel="stylesheet"/><link href="//m.sbmmt.com/m/static/layui/css/layui.css" type="text/css" rel="stylesheet"/><link href="//m.sbmmt.com/m/static/mobcss/mobindex3.css" type="text/css" rel="stylesheet"/><script src="//m.sbmmt.com/m/static/front/mobjs/jquery-1.6.1.min.js"></script><script src="//m.sbmmt.com/m/static/front/mobjs/swiper.min.js"></script><script src="//m.sbmmt.com/m/static/front/mobjs/newphpcommon.js"></script><link rel="canonical" href="//m.sbmmt.com/m/faq/486099.html"/> <link rel="alternate" hrefLang="zh-cn" href="//m.sbmmt.com/m/zh/faq/486099.html" /> <link rel="alternate" hrefLang="en" href="//m.sbmmt.com/m/faq/486099.html" /> <link rel="alternate" hrefLang="zh-tw" href="//m.sbmmt.com/m/zh-tw/faq/486099.html" /> <link rel="alternate" hrefLang="ja" href="//m.sbmmt.com/m/ja/faq/486099.html" /> <link rel="alternate" hrefLang="ko" href="//m.sbmmt.com/m/ko/faq/486099.html" /> <link rel="alternate" hrefLang="ms" href="//m.sbmmt.com/m/ms/faq/486099.html" /> <link rel="alternate" hrefLang="fr" href="//m.sbmmt.com/m/fr/faq/486099.html" /> <link rel="alternate" hrefLang="de" href="//m.sbmmt.com/m/de/faq/486099.html" /> <script> var canshu = { SeeMore:'See more', FoldUp:'Fold up', Choice:'LANGUAGE', wait:'Loading, please wait~', LoginFirst:"Please log in first", needKeyword:'Enter keyword search', emailPhoneError:'Please enter the correct phone or email address', missPwd:'Please enter the password', emailError:'Please enter your correct email address', VerCode:"Please enter the verification code", getCode:'Sending', pwdError:'Incorrect password format', TwoPassNotMatch:'Two passwords do not match', Bindemail:'Bind email', resetpassword:'reset password', ConfirmPass:'Confirm Password', pwdCheck:'Please enter 6-18 letters or numbers', Editinfor: 'Edit personal information', trimContent:'Please enter content', titleCheck:'Title should be at least 5 words long', choiceLang:'Please select a language classification', Secondreply:'reply', NetWorkError:'Network error, please try again later!', keywordSearch:'Enter keyword search', all_lang_string:'zh|en|zh-tw|ja|ko|ms|fr|de', Next:'Next', Previous:'Previous' }; </script><!-- Google Tag Manager --><script> (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.m.sbmmt.com/gtm.js?id='+i+dl; f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-WWVXRJPW'); </script><!-- End Google Tag Manager --><!-- Google tag (gtag.js) --><script async src="https://www.m.sbmmt.com/gtag/js?id=G-H42EVCYBJC"></script><script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-H42EVCYBJC'); </script><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5902227090019525" crossorigin="anonymous"></script><!--<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6267705206177514" crossorigin="anonymous"></script>--><script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"WebSite","url":"https:\/\/m.php.cn\/","potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/m.php.cn\/search?word={search_term_string}"},"query-input":"required name=search_term_string"}}</script><meta property="article:author" content="青灯夜游" /><meta property="article:published_first" content=",//m.sbmmt.com/faq/486099.html" /><link rel="stylesheet" href="//m.sbmmt.com/m/static/ueditor/third-party/SyntaxHighlighter/shCoreDefault.css?1"><link rel="stylesheet" href="//m.sbmmt.com/m/static/ueditor/third-party/SyntaxHighlighter/shCoreDefault1.css"><link href="//m.sbmmt.com/m/static/mobcss/newphp.css" type="text/css" rel="stylesheet"/><script src="//m.sbmmt.com/m/static/ueditor/third-party/SyntaxHighlighter/shCore.js"></script><script type="text/javascript" src="//m.sbmmt.com/m/static/layui/layui.js"></script><script type="text/javascript" src="//m.sbmmt.com/m/static/js/global.js?4.9.47"></script><script> var xnb_name = 'Virtual currency'; </script><script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"Article","headline":"What are the head tags of html5","description":"The head tags of html5 are: 1. \"<head>\"; 2. \"<title>\"; 3. \"<base>\"; 4. \"<link>\"; 5. \"<style>\"; 6. \" <meta>\"; 7. \"<script>\"; 8. \"<noscript>\".","image":["https:\/\/img.php.cn\/upload\/article\/202112\/17\/2021121711215988732.jpg?x-oss-process=image\/resize,p_40"],"datePublished":"2021-12-17T11:24:47+8:00","author":{"url":"https:\/\/m.php.cn\/member\/287557.html","name":"青灯夜游"},"mainEntityOfPage":{"@type":"WebPage","@id":"https:\/\/m.php.cn\/faq\/486099.html"},"url":"https:\/\/m.php.cn\/faq\/486099.html","articleBody":"<blockquote>\n<p>html5的头部标记有:1、“<\/p>”;2、“<title>”;3、“<base>”;4、“<link>”;5、“<style>”;6、“<meta>”;7、“<script>”;8、“<noscript>”。<\/style>\n<\/title>\n<\/blockquote>\n<p><img src=\"https:\/\/img.php.cn\/upload\/article\/202112\/17\/2021121711215988732.jpg?x-oss-process=image\/resize,p_40\" alt=\"What are the head tags of html5\" ><\/p>\n<p>本教程操作环境:windows7系统、HTML5版、Dell G3电脑。<\/p>\n<h2><strong>html5的头部标记<\/strong><\/h2>\n<p><strong>1、标签<\/strong><\/p>\n<p><\/p> 标签是所有头部标签的容器,这些头部标签用来定义有关 HTML 文档的元数据(描述数据的数据)以及所需资源的引用(例如 CSS 样式文件、JavaScript 脚本文件),对文档能够在浏览器中正确显示起到了非常重要的作用。根据我们的需求,可以在 HTML 头部定义大量的元数据,也可以定义很少或者根本就不定义。虽然头部标签是 HTML 文档的一部分,但其中的内容并不会显示在浏览器中。<pre class='brush:php;toolbar:false;'><head>\n    ....\n<\/head><\/pre><p><strong>2、<title> 标签<\/title><\/strong><\/p>\n<p><\/p>\n<title> 标签用来定义 HTML 文档的标题,只有包含 <title> 标签的文档才算是一个有效的 HTML 文档。另外,一个 HTML 文档中仅允许存在一个 <title> 标签,并且 <title> 标签必须放置在 标签中。<p>注意,在 <\/p>\n<title> 标签内部仅允许包含纯文本内容,不能包含其他 HTML 标签。<p><\/p>\n<title> 标签的主要作用如下所示:<ul style=\"list-style-type: disc;\">\n<li><p>在浏览器标题栏或者任务栏中显示标题;<\/p><\/li>\n<li><p>当将页面添加到收藏夹(书签)时提供标题;<\/p><\/li>\n<li><p>在搜索结果中显示页面标题。<\/p><\/li>\n<\/ul>\n<p>下面的示例演示了如何在 HTML 文档中使用 <\/p>\n<title> 标签:<pre class='brush:php;toolbar:false;'><head>\n    <meta charset=\"utf-8\">\n    <title>php中文网-教程_手册_视频-免费php在线学习平台<\/title>\n<\/head><\/pre><p><\/p>\n<title> 标签的内容必须与当前文档有关,并且不应该过长,中文页面请尽量控制在 30 个字符(包括空格)以内。<p><strong>3、<base> 标签<\/strong><\/p>\n<p><base> 标签用于为页面中所有相对链接指定一个基本链接,当您设置了基本链接后,当前页面中的所有相对链接都会使用这个基本链接作为前缀,如下例所示:<\/p><pre class='brush:php;toolbar:false;'><!DOCTYPE html>\n<html>\n<head>\n    <meta charset=\"utf-8\">\n    <title><base>标签演示<\/title>\n    <base href=\"\/\/m.sbmmt.com\/\">\n<\/head>\n<body>\n    <ul>\n        <li><a href=\"course.html\">视频教程<\/a><\/li>\n        <li><a href=\"course\/type\/3.html\">入门教程<\/a><\/li>\n    <\/ul>\n<\/body>\n<\/html><\/pre><p>上面的示例中第一个 <\/p>\n<li> 标签中的超链接会被解析为“\/\/m.sbmmt.com\/course.html”,第二个 <\/li>\n<li> 中的超链接会被解析为“\/\/m.sbmmt.com\/course\/type\/3.html”。<p>注意,HTML 文档中的 <base> 标签必须出现在任何引用外部资源的标签之前,而且一个 HTML 文档中仅允许定义一个 <base> 标签。<\/p>\n<p><strong>4、<link> 标签<\/strong><\/p>\n<p><link> 标签经常用于引用外部 CSS 样式表,<link> 标签中包含两个主要的属性,分别是 rel 和 href。rel 属性用来指示引用文件的类型,href 属性用来设置外部文件的路径。示例代码如下:<\/p><pre class='brush:php;toolbar:false;'><head>\n    <title>此处书写标题<\/title>\n    <link rel=\"stylesheet\" href=\"common.css\">\n<\/head><\/pre><p>HTML <\/p> 标签中可以包含任意数量的 <link> 标签。<p><strong>5、<style>标签<\/style><\/strong><\/p>\n<p>使用 <style> 标签可以在 HTML 文档中嵌入 CSS 样式,需要注意的是在 <style> 标签中定义的样式仅对当前 HTML 文档有效。示例代码如下:<\/style><\/p><pre class='brush:php;toolbar:false;'><head>\n    <title>此处书写标题<\/title>\n    <style>\n        body { background-color: YellowGreen; }\n        h1 { color: red; }\n        p { color: green; }\n    <\/style>\n<\/head><\/pre><p>注意:对于文档中的唯一样式可以使用 <style> 标签,但对于在多个文档中通用的样式,使用外部样式表更为合适。关于在 HTML 中嵌入 CSS 的更多内容,请转到《HTML嵌入CSS样式(四种方法)》。<\/style><\/p>\n<p><strong>6、<meta> 标签<\/strong><\/p>\n<p><meta> 标签用于提供有关 HTML 文档的元数据,例如页面有效期、页面作者、关键字列表、页面描述等信息。<meta> 标签定义的数据并不会显示在页面上,但却会被浏览器解析。<\/p>\n<p>1) 定义字符集<\/p><pre class='brush:php;toolbar:false;'><meta charset=\"UTF-8\"><\/pre><p>charset 属性用来指定 HTML 文档的字符编码,上面的示例中,我们将文档的字符编码设置为了“UTF-8”。<\/p>\n<p>2) 定义页面描述<\/p><pre class='brush:php;toolbar:false;'><meta name=\"description\" content=\"php中文网提供大量免费、原创、高清的php视频教程,并定期举行公益php培训!可边学习边在线修改示例代码,查看执行效果!php从入门到精通,一站式php自学平台!\"><\/pre><p>定义页面的描述信息有利于搜索引擎的搜索。<\/p>\n<blockquote>\n<p><\/p>\n<title> 标签定义文档标题,name=\"description\" 定义文档描述,描述的长度通常大于标题。<\/title>\n<\/blockquote>\n<p>3) 定义关键字<\/p><pre class='brush:php;toolbar:false;'><meta name=\"keywords\" content=\"php教程,php入门教程,php视频教程,php源码下载,php手册\"><\/pre><p>关键字用于为搜索引擎提供与页面有关的信息。<\/p>\n<p>4) 定义页面作者<\/p><pre class='brush:php;toolbar:false;'><meta name=\"author\" content=\"PHP中文网\"><\/pre><p>通过某些内容管理系统可以自动提取作者信息。<\/p>\n<p>5) 刷新页面<\/p><pre class='brush:php;toolbar:false;'><meta http-equiv=\"refresh\" content=\"30\"><\/pre><p>上例中的代码用于向浏览器发送一个指令,使浏览器在经过指定的时间间隔(30 秒)后自动刷新页面。在 content 属性中除了可以指定时间间隔外,还可以再指定一个链接,这时页面将在指定的时间后重定向到链接所指向的页面,如下例所示:<\/p><pre class='brush:php;toolbar:false;'><meta http-equiv=\"refresh\" content=\"10; url=\/\/m.sbmmt.com\/\"><\/pre><p><strong>7、<script> 标签<\/script><\/strong><\/p>\n<p><script> 标签用于定义 JavaScript 脚本,示例代码如下:<\/script><\/p><pre class='brush:php;toolbar:false;'><head>\n    <title>PHP中文网<\/title>\n    <script>\n        document.write(\"PHP中文网\")\n    <\/script>\n<\/head><\/pre><p><strong>8、<noscript> 标签<\/noscript><\/strong><\/p>\n<p>当用户的浏览器不支持 JavaScript 脚本或者禁用 JavaScript 脚本时,可以在 <noscript> 标签中定义一些内容来替代不能运行的 JavaScript 脚本或者给用户一些提示。除了 <script> 标签外,在 <noscript> 标签中可以包含任何 HTML 元素,如下例所示:<\/script>\n<\/noscript><\/p><pre class='brush:php;toolbar:false;'><head>\n    <title>PHP中文网<\/title>\n    <noscript>\n        <p>您的浏览器不支持 JavaScript 或者您禁用了 JavaScript,请<a href=\"\/\/m.sbmmt.com\/\">点击这里<\/a>了解如何启用 JavaScript。<\/p>\n    <\/noscript>\n<\/head><\/pre><p>相关推荐:《<a href=\"\/\/m.sbmmt.com\/course\/list\/11.html\" target=\"_blank\" textvalue=\"html视频教程\">html视频教程<\/a>》<\/p>\n<\/li>\n<\/title>\n<\/title>\n<\/title>\n<\/title>\n<\/title>\n<\/title>\n<\/title>\n<\/title>"}</script><script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"item":{"@id":"https:\/\/m.php.cn\/","name":"Home"}},{"@type":"ListItem","position":2,"item":{"@id":"https:\/\/m.php.cn\/web-designer.html","name":"Web Front-end"}},{"@type":"ListItem","position":3,"item":{"@id":"https:\/\/m.php.cn\/website-design-ask.html","name":"Front-end Q&A"}},{"@type":"ListItem","position":4,"item":{"@id":"https:\/\/m.php.cn\/faq\/486099.html","name":"What are the head tags of html5"}}]}</script><script type="text/javascript" src="/js/jquery.3.5.2.min.m.js"></script> </head><div style="position: fixed;right: 0;top:100px;width: 125px; z-index:2000;"><div ><a target="_blank" rel="nofollow" href="https://www.520xingyun.com/from/188bet.php" ><img width="120px" height="550px" src="https://www.520xingyun.com/images/188_120.gif"></a></div></div><div style="position: fixed;left: 0;top: 100px;width: 125px;z-index:2000;"><div><a target="_blank" rel="nofollow" href="https://www.520xingyun.com/from/188bet.php"><img width="120px" height="550px" src="https://www.520xingyun.com/images/188_120.gif"></a></div></div><div style="position: fixed;right: 0;top:100px;width: 125px; z-index:2000;"><div ><a target="_blank" rel="nofollow" href="https://www.520xingyun.com/from/188bet.php" ><img width="120px" height="550px" src="https://www.520xingyun.com/images/188_120.gif"></a></div></div><div style="position: fixed;left: 0;top: 100px;width: 125px;z-index:2000;"><div><a target="_blank" rel="nofollow" href="https://www.520xingyun.com/from/188bet.php"><img width="120px" height="550px" src="https://www.520xingyun.com/images/188_120.gif"></a></div></div><body data-commit-time="2023-12-28T14:50:12+08:00" class="body2_2"><link rel="stylesheet" type="text/css" href="//m.sbmmt.com/m/static/csshwm/m_stylehw.css"><header><div class="head"><div class="haed_left"><div class="haed_logo"><a href="//m.sbmmt.com/m/" title="php.cn" class="haed_logo_a"><img src="//m.sbmmt.com/m/static/imghwm/logo.png" alt="php.cn" class="haed_logoimg"></a></div></div><div class="search_div search_div_top2"><input id="key_words" class="search-input" type="text" autocomplete="off" name="keywords" required="required" placeholder="Block,address,transaction,news" value="" onkeydown="if (event.keyCode == 13) searchs('en')"/><a onclick="searchs('en')" href="javascript:;" title="search"><img onerror="this.onerror=''; this.src='//m.sbmmt.com/m/faq/static/imghwm/default1.png'" src="/static/imghwm/find.png" alt="search"></a></div><div class="head_right"><button type="button" class="layui-btn layui-btn-primary headerlan headlanmax lan1" id="lan1sp" lay-on="test-offset-r"><img src="//m.sbmmt.com/m/static/imghwm/m_menu.png" alt=""></button><div id="m_menu" class="m_menu" style="display: none;"><div class="m_editormain12main_top"><img src="//m.sbmmt.com/m/static/imghwm/logo.png" alt="logo"><a href="javascript:;" class="m_editormain12main_topi" id="m_editormain12main_topi_sp"><i class="layui-icon layui-icon-close"></i></a></div><div class="layui-panel m_menu_main"><ul class="layui-menu" id="demo-menu"><li class="layui-menu-item-group layui-menu-item-up m_menus" lay-options="{type: 'group'}"><div class="layui-menu-body-title m_menus_title">Community<i class="layui-icon layui-icon-down"></i></div><ul class="m_menusnames"><li><div class="layui-menu-body-title m_menus_name"><a href="//m.sbmmt.com/m/article.html" title="Articles">Articles</a></div></li><li><div class="layui-menu-body-title m_menus_name"><a href="//m.sbmmt.com/m/faq/zt" title="Topics">Topics</a></div></li><li><div class="layui-menu-body-title m_menus_name"><a href="//m.sbmmt.com/m/wenda.html" title="Q&A">Q&A</a></div></li></ul></li><li class="layui-menu-item-divider"></li><li class="layui-menu-item-group layui-menu-item-up m_menus" lay-options="{type: 'group'}"><div class="layui-menu-body-title m_menus_title">Learn<i class="layui-icon layui-icon-down"></i></div><ul class="m_menusnames"><li><div class="layui-menu-body-title m_menus_name"><a href="//m.sbmmt.com/m/course.html" title="Course">Course</a></div></li><li><div class="layui-menu-body-title m_menus_name"><a href="//m.sbmmt.com/m/dic/29.html" title="Programming Dictionary">Programming Dictionary</a></div></li></ul></li><li class="layui-menu-item-divider"></li><li class="layui-menu-item-group layui-menu-item-up m_menus" lay-options="{type: 'group'}"><div class="layui-menu-body-title m_menus_title">Tools Library<i class="layui-icon layui-icon-down"></i></div><ul class="m_menusnames"><li><div class="layui-menu-body-title m_menus_name"><a href="//m.sbmmt.com/m/toolset/development-tools" title="Development tools">Development tools</a></div></li><li><div class="layui-menu-body-title m_menus_name"><a href="//m.sbmmt.com/m/toolset/website-source-code" title="Website Source Code">Website Source Code</a></div></li><li><div class="layui-menu-body-title m_menus_name"><a href="//m.sbmmt.com/m/toolset/php-libraries" title="PHP Libraries">PHP Libraries</a></div></li><li><div class="layui-menu-body-title m_menus_name"><a href="//m.sbmmt.com/m/toolset/js-special-effects" title="JS special effects">JS special effects</a></div></li><li><div class="layui-menu-body-title m_menus_name"><a href="//m.sbmmt.com/m/toolset/website-materials" title="Website Materials">Website Materials</a></div></li><li><div class="layui-menu-body-title m_menus_name"><a href="//m.sbmmt.com/m/toolset/extension-plug-ins" title="Extension plug-ins">Extension plug-ins</a></div></li></ul></li><li class="layui-menu-item-divider"></li><li lay-options="{id: 100}"><div class="layui-menu-body-title m_menus_oth"><a href="//m.sbmmt.com/m/ai" title="AI Tools">AI Tools</a></div></li><li class="layui-menu-item-divider"></li><li class="layui-menu-item-group layui-menu-item-up m_menus" lay-options="{type: 'group'}"><div class="layui-menu-body-title m_menus_title">Leisure<i class="layui-icon layui-icon-down"></i></div><ul class="m_menusnames"><li><div class="layui-menu-body-title m_menus_name"><a href="//m.sbmmt.com/m/game" title="Game Download">Game Download</a></div></li><li><div class="layui-menu-body-title m_menus_name"><a href="//m.sbmmt.com/m/mobile-game-tutorial/" title="Game Tutorials">Game Tutorials</a></div></li></ul></li><li class="layui-menu-item-divider"></li></ul></div><!-- <div class="m_menu_button">--><!-- <a href="javascript:;" title="singup">Create an account</a>--><!-- </div>--><div class="m_menu_button m_menu_button_login"><a href="//m.sbmmt.com/m/login" title="Login">Log in</a></div><div class="m_menu_button m_menu_button_lang"><button type="button" class="layui-btn layui-btn-primary headerlan headlanmax lan1" id="lan1" lay-on="page2">English<i class="layui-icon layui-icon-triangle-d"></i></button></div></div><div class="m_menu_lang" id="m_menu_lang" style="display: none;"><div class="m_editormain12main_top"><img src="//m.sbmmt.com/m/static/imghwm/logo.png" alt="logo"><a href="javascript:;" class="m_editormain12main_topi" id="m_editormain12main_topi_lan"><i class="layui-icon layui-icon-close"></i></a></div><div class="m_menu_lang_main"><a href="javascript:setlang('zh-cn');" class="m_menu_lang_mains">简体中文<span>zh-cn</span></a><a href="javascript:;" class="m_menu_lang_mains">English<span>en</span></a><a href="javascript:setlang('zh-tw');" class="m_menu_lang_mains">繁体中文<span>zh-tw</span></a><a href="javascript:setlang('ja');" class="m_menu_lang_mains">日本語<span>ja</span></a><a href="javascript:setlang('ko');" class="m_menu_lang_mains">한국어<span>ko</span></a><a href="javascript:setlang('ms');" class="m_menu_lang_mains">Melayu<span>ms</span></a><a href="javascript:setlang('fr');" class="m_menu_lang_mains">Français<span>fr</span></a><a href="javascript:setlang('de');" class="m_menu_lang_mains">Deutsch<span>de</span></a></div></div></div></div></header><script> document.getElementById('lan1sp').addEventListener('click', function (event) { event.preventDefault(); var elements = document.getElementsByClassName('m_menu'); for (var i = 0; i < elements.length; i++) { elements[i].style.display = 'block'; } }); document.getElementById('m_editormain12main_topi_sp').addEventListener('click', function (event) { event.preventDefault(); var elements = document.getElementsByClassName('m_menu'); for (var i = 0; i < elements.length; i++) { elements[i].style.display = 'none'; } }); document.getElementById('lan1').addEventListener('click', function (event) { event.preventDefault(); var elements = document.getElementsByClassName('m_menu_lang'); for (var i = 0; i < elements.length; i++) { elements[i].style.display = 'block'; } }); document.getElementById('m_editormain12main_topi_lan').addEventListener('click', function (event) { event.preventDefault(); var elements = document.getElementsByClassName('m_menu_lang'); for (var i = 0; i < elements.length; i++) { elements[i].style.display = 'none'; } }); </script><main class="m_phpTopic_Details m_phpArticle_Details"><div class="fixed_tab"><a href="" title="" class="fixed_tab_img" id="fixed_tab_img"><img class="lazy" data-src="//m.sbmmt.com/m/static/imghwm/tab_tab.png" src="//m.sbmmt.com/m/static/imghw/default1.png" alt="" /></a></div><div class="m_editormain12main" style="display: none" id="fixed_tab_titlelist"><div class="m_editormain12main_top"><img class="lazy" data-src="//m.sbmmt.com/m/static/imghwm/logo.png" src="//m.sbmmt.com/m/static/imghw/default1.png" alt="logo" /><a href="" title="" title="" class="m_editormain12main_topi" id="fixed_tab_topi"><i class="layui-icon layui-icon-close"></i></a></div><div class="phpeditormainL"><div class="fixed_tab_as"><ul><li><span></span><a href="//m.sbmmt.com/m/faq/#strong-html-的头部标记-strong" title="<strong>html5的头部标记</strong>" class="fixed_tab_a"><strong>html5的头部标记</strong></a></li></ul></div><div class="m_editormain12_close"><a href="" title="" title="" id="fixed_tab_close">close</a></div></div></div><div class="Article_Details_main1M"><div class="phpgenera_Details_mainL1"><a href="//m.sbmmt.com/m/" title="Home" class="phpgenera_Details_mainL1a">Home</a><img class="lazy" data-src="//m.sbmmt.com/m/static/imghwm/top_right.png" src="//m.sbmmt.com/m/static/imghw/default1.png" alt="" /><a href="//m.sbmmt.com/m/web-designer.html" class="phpgenera_Details_mainL1a">Web Front-end</a><img class="lazy" data-src="//m.sbmmt.com/m/static/imghwm/top_right.png" src="//m.sbmmt.com/m/static/imghw/default1.png" alt="" /><a href="//m.sbmmt.com/m/website-design-ask.html" class="phpgenera_Details_mainL1a">Front-end Q&A</a><img class="lazy" data-src="//m.sbmmt.com/m/static/imghwm/top_right.png" src="//m.sbmmt.com/m/static/imghw/default1.png" alt="" /><span>What are the head tags of html5</span></div><div class="Articlelist_txts"><div class="Articlelist_txts_info"><h1><a href="" title="" class="Articlelist_txts_title">What are the head tags of html5</a></h1><div class="Articlelist_txts_info_head"><div class="author_info"><a href="//m.sbmmt.com/m/member/287557.html" class="author_avatar"><img class="lazy" data-src="https://img.php.cn/upload/avatar/000/287/557/5bef70171e9f3249.jpg" alt="青灯夜游" src="//m.sbmmt.com/m/static/imghw/default1.png" alt="author avatar" onerror="this.onerror=''; this.src='//m.sbmmt.com/m/static/imghw/default1.png'"></a><div class="author_detail"><a href="//m.sbmmt.com/m/member/287557.html" class="author_name">青灯夜游</a></div></div></div><span class="Articlelist_txts_time">Dec 17, 2021 am 11:24 AM</span><div class="Articlelist_txts_infos"><span class="Articlelist_txts_infoss on">html5</span></div></div></div><hr /><div class="article_main wenda-list"><blockquote> <p>html5的头部标记有:1、“</p>”;2、“<title>”;3、“<base>”;4、“<link>”;5、“<style>”;6、“<meta>”;7、“<script>”;8、“<noscript>”。</style> </title> </blockquote> <p><img src="/static/imghwm/default1.png" data-src="https://img.php.cn/upload/article/202112/17/2021121711215988732.jpg?x-oss-process=image/resize,p_40" class="lazy" alt="What are the head tags of html5" ></p> <p>本教程操作环境:windows7系统、HTML5版、Dell G3电脑。</p> <h2 id="strong-html-的头部标记-strong"><strong>html5的头部标记</strong></h2> <p><strong>1、标签</strong></p> <p></p> 标签是所有头部标签的容器,这些头部标签用来定义有关 HTML 文档的元数据(描述数据的数据)以及所需资源的引用(例如 CSS 样式文件、JavaScript 脚本文件),对文档能够在浏览器中正确显示起到了非常重要的作用。根据我们的需求,可以在 HTML 头部定义大量的元数据,也可以定义很少或者根本就不定义。虽然头部标签是 HTML 文档的一部分,但其中的内容并不会显示在浏览器中。<pre class='brush:php;toolbar:false;'>&lt;head&gt; .... &lt;/head&gt;</pre><p><strong>2、<title> 标签</title></strong></p> <p></p> <title> 标签用来定义 HTML 文档的标题,只有包含 <title> 标签的文档才算是一个有效的 HTML 文档。另外,一个 HTML 文档中仅允许存在一个 <title> 标签,并且 <title> 标签必须放置在 标签中。<p>注意,在 </p> <title> 标签内部仅允许包含纯文本内容,不能包含其他 HTML 标签。<p></p> <title> 标签的主要作用如下所示:<ul style="list-style-type: disc;"> <li><p>在浏览器标题栏或者任务栏中显示标题;</p></li> <li><p>当将页面添加到收藏夹(书签)时提供标题;</p></li> <li><p>在搜索结果中显示页面标题。</p></li> </ul> <p>下面的示例演示了如何在 HTML 文档中使用 </p> <title> 标签:<pre class='brush:php;toolbar:false;'>&lt;head&gt; &lt;meta charset=&quot;utf-8&quot;&gt; &lt;title&gt;php中文网-教程_手册_视频-免费php在线学习平台&lt;/title&gt; &lt;/head&gt;</pre><p></p> <title> 标签的内容必须与当前文档有关,并且不应该过长,中文页面请尽量控制在 30 个字符(包括空格)以内。<p><strong>3、<base> 标签</strong></p> <p><base> 标签用于为页面中所有相对链接指定一个基本链接,当您设置了基本链接后,当前页面中的所有相对链接都会使用这个基本链接作为前缀,如下例所示:</p><pre class='brush:php;toolbar:false;'>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset=&quot;utf-8&quot;&gt; &lt;title&gt;&lt;base&gt;标签演示&lt;/title&gt; &lt;base href=&quot;//m.sbmmt.com/&quot;&gt; &lt;/head&gt; &lt;body&gt; &lt;ul&gt; &lt;li&gt;&lt;a href=&quot;course.html&quot;&gt;视频教程&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;course/type/3.html&quot;&gt;入门教程&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/body&gt; &lt;/html&gt;</pre><p>上面的示例中第一个 </p> <li> 标签中的超链接会被解析为“//m.sbmmt.com/course.html”,第二个 </li> <li> 中的超链接会被解析为“//m.sbmmt.com/course/type/3.html”。<p>注意,HTML 文档中的 <base> 标签必须出现在任何引用外部资源的标签之前,而且一个 HTML 文档中仅允许定义一个 <base> 标签。</p> <p><strong>4、<link> 标签</strong></p> <p><link> 标签经常用于引用外部 CSS 样式表,<link> 标签中包含两个主要的属性,分别是 rel 和 href。rel 属性用来指示引用文件的类型,href 属性用来设置外部文件的路径。示例代码如下:</p><pre class='brush:php;toolbar:false;'>&lt;head&gt; &lt;title&gt;此处书写标题&lt;/title&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;common.css&quot;&gt; &lt;/head&gt;</pre><p>HTML </p> 标签中可以包含任意数量的 <link> 标签。<p><strong>5、<style>标签</style></strong></p> <p>使用 <style> 标签可以在 HTML 文档中嵌入 CSS 样式,需要注意的是在 <style> 标签中定义的样式仅对当前 HTML 文档有效。示例代码如下:</style></p><pre class='brush:php;toolbar:false;'>&lt;head&gt; &lt;title&gt;此处书写标题&lt;/title&gt; &lt;style&gt; body { background-color: YellowGreen; } h1 { color: red; } p { color: green; } &lt;/style&gt; &lt;/head&gt;</pre><p>注意:对于文档中的唯一样式可以使用 <style> 标签,但对于在多个文档中通用的样式,使用外部样式表更为合适。关于在 HTML 中嵌入 CSS 的更多内容,请转到《HTML嵌入CSS样式(四种方法)》。</style></p> <p><strong>6、<meta> 标签</strong></p> <p><meta> 标签用于提供有关 HTML 文档的元数据,例如页面有效期、页面作者、关键字列表、页面描述等信息。<meta> 标签定义的数据并不会显示在页面上,但却会被浏览器解析。</p> <p>1) 定义字符集</p><pre class='brush:php;toolbar:false;'>&lt;meta charset=&quot;UTF-8&quot;&gt;</pre><p>charset 属性用来指定 HTML 文档的字符编码,上面的示例中,我们将文档的字符编码设置为了“UTF-8”。</p> <p>2) 定义页面描述</p><pre class='brush:php;toolbar:false;'>&lt;meta name=&quot;description&quot; content=&quot;php中文网提供大量免费、原创、高清的php视频教程,并定期举行公益php培训!可边学习边在线修改示例代码,查看执行效果!php从入门到精通,一站式php自学平台!&quot;&gt;</pre><p>定义页面的描述信息有利于搜索引擎的搜索。</p> <blockquote> <p></p> <title> 标签定义文档标题,name="description" 定义文档描述,描述的长度通常大于标题。</title> </blockquote> <p>3) 定义关键字</p><pre class='brush:php;toolbar:false;'>&lt;meta name=&quot;keywords&quot; content=&quot;php教程,php入门教程,php视频教程,php源码下载,php手册&quot;&gt;</pre><p>关键字用于为搜索引擎提供与页面有关的信息。</p> <p>4) 定义页面作者</p><pre class='brush:php;toolbar:false;'>&lt;meta name=&quot;author&quot; content=&quot;PHP中文网&quot;&gt;</pre><p>通过某些内容管理系统可以自动提取作者信息。</p> <p>5) 刷新页面</p><pre class='brush:php;toolbar:false;'>&lt;meta http-equiv=&quot;refresh&quot; content=&quot;30&quot;&gt;</pre><p>上例中的代码用于向浏览器发送一个指令,使浏览器在经过指定的时间间隔(30 秒)后自动刷新页面。在 content 属性中除了可以指定时间间隔外,还可以再指定一个链接,这时页面将在指定的时间后重定向到链接所指向的页面,如下例所示:</p><pre class='brush:php;toolbar:false;'>&lt;meta http-equiv=&quot;refresh&quot; content=&quot;10; url=//m.sbmmt.com/&quot;&gt;</pre><p><strong>7、<script> 标签</script></strong></p> <p><script> 标签用于定义 JavaScript 脚本,示例代码如下:</script></p><pre class='brush:php;toolbar:false;'><head> <title>PHP中文网</title> <script> document.write("PHP中文网") </script> </head></pre><p><strong>8、<noscript> 标签</noscript></strong></p> <p>当用户的浏览器不支持 JavaScript 脚本或者禁用 JavaScript 脚本时,可以在 <noscript> 标签中定义一些内容来替代不能运行的 JavaScript 脚本或者给用户一些提示。除了 <script> 标签外,在 <noscript> 标签中可以包含任何 HTML 元素,如下例所示:</script> </noscript></p><pre class='brush:php;toolbar:false;'><head> <title>PHP中文网</title> <noscript> <p>您的浏览器不支持 JavaScript 或者您禁用了 JavaScript,请<a href="//m.sbmmt.com/">点击这里</a>了解如何启用 JavaScript。</p> </noscript> </head></pre><p>相关推荐:《<a href="//m.sbmmt.com/m/course/list/11.html" target="_blank" textvalue="html视频教程">html视频教程</a>》</p> </li>

The above is the detailed content of What are the head tags of html5. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Related Article
The Benefits of React: Performance, Reusability, and MoreThe Benefits of React: Performance, Reusability, and MoreApr 15, 2025 am 12:05 AM

React’s popularity includes its performance optimization, component reuse and a rich ecosystem. 1. Performance optimization achieves efficient updates through virtual DOM and diffing mechanisms. 2. Component Reuse Reduces duplicate code by reusable components. 3. Rich ecosystem and one-way data flow enhance the development experience.

React: Creating Dynamic and Interactive User InterfacesReact: Creating Dynamic and Interactive User InterfacesApr 14, 2025 am 12:08 AM

React is the tool of choice for building dynamic and interactive user interfaces. 1) Componentization and JSX make UI splitting and reusing simple. 2) State management is implemented through the useState hook to trigger UI updates. 3) The event processing mechanism responds to user interaction and improves user experience.

React vs. Backend Frameworks: A ComparisonReact vs. Backend Frameworks: A ComparisonApr 13, 2025 am 12:06 AM

React is a front-end framework for building user interfaces; a back-end framework is used to build server-side applications. React provides componentized and efficient UI updates, and the backend framework provides a complete backend service solution. When choosing a technology stack, project requirements, team skills, and scalability should be considered.

HTML and React: The Relationship Between Markup and ComponentsHTML and React: The Relationship Between Markup and ComponentsApr 12, 2025 am 12:03 AM

The relationship between HTML and React is the core of front-end development, and they jointly build the user interface of modern web applications. 1) HTML defines the content structure and semantics, and React builds a dynamic interface through componentization. 2) React components use JSX syntax to embed HTML to achieve intelligent rendering. 3) Component life cycle manages HTML rendering and updates dynamically according to state and attributes. 4) Use components to optimize HTML structure and improve maintainability. 5) Performance optimization includes avoiding unnecessary rendering, using key attributes, and keeping the component single responsibility.

React and the Frontend: Building Interactive ExperiencesReact and the Frontend: Building Interactive ExperiencesApr 11, 2025 am 12:02 AM

React is the preferred tool for building interactive front-end experiences. 1) React simplifies UI development through componentization and virtual DOM. 2) Components are divided into function components and class components. Function components are simpler and class components provide more life cycle methods. 3) The working principle of React relies on virtual DOM and reconciliation algorithm to improve performance. 4) State management uses useState or this.state, and life cycle methods such as componentDidMount are used for specific logic. 5) Basic usage includes creating components and managing state, and advanced usage involves custom hooks and performance optimization. 6) Common errors include improper status updates and performance issues, debugging skills include using ReactDevTools and Excellent

React and the Frontend Stack: The Tools and TechnologiesReact and the Frontend Stack: The Tools and TechnologiesApr 10, 2025 am 09:34 AM

React is a JavaScript library for building user interfaces, with its core components and state management. 1) Simplify UI development through componentization and state management. 2) The working principle includes reconciliation and rendering, and optimization can be implemented through React.memo and useMemo. 3) The basic usage is to create and render components, and the advanced usage includes using Hooks and ContextAPI. 4) Common errors such as improper status update, you can use ReactDevTools to debug. 5) Performance optimization includes using React.memo, virtualization lists and CodeSplitting, and keeping code readable and maintainable is best practice.

React's Role in HTML: Enhancing User ExperienceReact's Role in HTML: Enhancing User ExperienceApr 09, 2025 am 12:11 AM

React combines JSX and HTML to improve user experience. 1) JSX embeds HTML to make development more intuitive. 2) The virtual DOM mechanism optimizes performance and reduces DOM operations. 3) Component-based management UI to improve maintainability. 4) State management and event processing enhance interactivity.

React Components: Creating Reusable Elements in HTMLReact Components: Creating Reusable Elements in HTMLApr 08, 2025 pm 05:53 PM

React components can be defined by functions or classes, encapsulating UI logic and accepting input data through props. 1) Define components: Use functions or classes to return React elements. 2) Rendering component: React calls render method or executes function component. 3) Multiplexing components: pass data through props to build a complex UI. The lifecycle approach of components allows logic to be executed at different stages, improving development efficiency and code maintainability.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools