head 元素包含了所有的头部标签元素,可以添加在头部区域的元素标签为: 、、<meta>、<link>、<script>、<noscript>、<base></span></span></p> <p><span style="font-size: 14pt; font-family: 'Microsoft YaHei';"><span style="font-size: 16px;"> 下面将一一解释各标签的作用</span></span></p> <p><strong><span style="font-size: 14pt;"><span style="font-size: 16px;"><title></span></span></strong></p> <ol class=" list-paddingleft-2"> <li><p><span style="font-size: 14pt; font-family: 'Microsoft YaHei';"><span style="font-size: 16px;">用于定义不同文档的标题</span></span></p></li> <li><p><span style="font-size: 14pt; font-family: 'Microsoft YaHei';"><span style="font-size: 16px;">定义浏览器工具栏的标题</span></span></p></li> <li><p><span style="font-size: 14pt; font-family: 'Microsoft YaHei';"><span style="font-size: 16px;">当网页添加至收藏夹,显示在收藏夹中的标题</span></span></p></li> <li><p><span style="font-size: 14pt; font-family: 'Microsoft YaHei';"><span style="font-size: 16px;">显示在搜索引擎结果页面的标题</span></span></p></li> </ol> <p class="cnblogs_code"><br></p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:html;toolbar:false;"> eg: <title> 我是标题 </title></pre><div class="contentsignin">登录后复制</div></div><h3 class="public-p-title"><span style="font-size: 16px;"><base></span></h3><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="public-pre"><span style="font-size: 15px;"><span style="font-family: 'Microsoft YaHei';"> 标签描述了基本的链接地址/链接目标,该标签作为HTML文档中所有的链接标签的默认链接。</span><br/></span></pre><div class="contentsignin">登录后复制</div></div><p class="cnblogs_code"><br/></p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:html;toolbar:false;"> eg: <base href="www.beck.ren/images/" target="_blank"></base></pre><div class="contentsignin">登录后复制</div></div><h3 class="public-p-title"><span style="font-size: 16px;"><link></span></h3><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="public-pre"> 标签定义了文档与外部资源之间的关系,通常用于链接样式表。</pre><div class="contentsignin">登录后复制</div></div><p class="cnblogs_code"><br/></p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:html;toolbar:false;"> eg: <link type="text/css" href="../index.css"></pre><div class="contentsignin">登录后复制</div></div><h3 class="public-p-title"><span style="font-size: 16px;"><style></span></h3><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="public-pre"> 标签定义了HTML文档的样式文件引用地址.内容指定样式渲染HTML文档</pre><div class="contentsignin">登录后复制</div></div><p class="cnblogs_code"><br/></p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:html;toolbar:false;">eg: <style> *{ margin:0; padding: 0; } <style> //css写法</pre><div class="contentsignin">登录后复制</div></div><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="public-pre"><meta></pre><div class="contentsignin">登录后复制</div></div><ol class=" list-paddingleft-2"><li><p><span style="font-family: 'Microsoft YaHei';"><span style="font-size: 16px;">meta 标签描述基本的元数据</span><span style="font-size: 15px;"><span style="font-size: 16px;"><strong><br/></strong></span></span></span></p></li><li><p><span style="font-size: 16px; font-family: 'Microsoft YaHei';">浏览器会解析标签提供的元数据,但元数据不会显示在页面上</span></p></li><li><p><span style="font-size: 16px; font-family: 'Microsoft YaHei';">meta 元素通常用于指定网页的 "描述"、"关键词"、"文件的最后修改时间"、"作者"、......</span></p></li><li><p><span style="font-size: 16px; font-family: 'Microsoft YaHei';">元数据可以告诉浏览器(如何显示内容或重新加载页面)及搜索引擎(关键词),及其他 web 服务</span></p></li></ol><p class="cnblogs_code"><br/></p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:js;toolbar:false;">eg: //定义关键字 <meta name="keywords content="HTML, CSS, XML, XHTML, JavaScript""> //定义描述内容 <meta name="description" content="Free Web tutorials on HTML and CSS"> //定义作者 <meta name="author" content="Hege Refsnes"> //定义每30秒刷新当前页面 <meta http-equiv="refresh" content="30"></pre><div class="contentsignin">登录后复制</div></div><h3 class="public-p-title"><span style="font-size: 16px;"><script></span></h3><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="public-pre"> 标签定义了 HTML 文档的 JS 文件引用地址.</pre><div class="contentsignin">登录后复制</div></div><p class="cnblogs_code"><br/></p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:js;toolbar:false;">eg: <script src="loading.js"></script></pre><div class="contentsignin">登录后复制</div></div>