html头部<head>元素包含关于文档的概要信息,也被称为元信息(meta-information)
html <title> 元素/<title> 标签定义了不同文档的标题,<title> 在 html/xhtml 文档中是必须的(代码部分为一个简单的html文档)
1 <!doctype html> 2 <html> 3 <head> 4 <title>title of the document</title> 5 </head> 6 <body> 7 the content of the document...... 8 </body> 9 </html>
html <base> 元素/<base> 标签描述了基本的链接地址/链接目标,该标签作为html文档中所有的链接标签的默认链接,在 html 中,<base> 标签没有结束标签;在 xhtml 中,<base> 标签必须被正确地关闭
1 <head> 2 <base href="https://www.cnblogs.com/dhnblog/" target="_blank"> 3 </head>
html <link> 元素/<link> 标签定义了文档与外部资源之间的关系,<link> 标签通常用于链接到样式表:
1 <head> 2 <link rel="stylesheet" type="text/css" href="mystyle.css"> 3 </head>
html <style> 元素/<style> 标签定义了html文档的样式文件引用地址,在<style> 元素中你需要指定样式文件来渲染html文档:
1 <head> 2 <style type="text/css"> 3 body {background-color:yellow} 4 p {color:blue} 5 </style> 6 </head>
html <meta> 元素/meta标签描述了一些基本的元数据;<meta> 标签提供了元数据。元数据也不显示在页面上,但会被浏览器解析;meta元素通常用于指定网页的描述,关键词,文件的最后修改时间,作者,和其他元数据;元数据可以使用于浏览器(如何显示内容或重新加载页面),搜索引擎(关键词),或其他web服务;<meta>一般放置于 <head>区域
<meta> 标签- 使用实例:
1 为搜索引擎定义关键词: 2 <meta name="keywords" content="html, css, xml, xhtml, javascript"> 3 为网页定义描述内容: 4 <meta name="description" content="free web tutorials on html and css"> 5 定义网页作者: 6 <meta name="author" content="hege refsnes">
每30秒钟刷新当前页面:
1 <meta http-equiv="refresh" content="30">
html <script> 元素,<script>标签用于加载脚本文件,如: javascript
html head 元素如图:
如对本文有疑问, 点击进行留言回复!!
网友评论