HTML中元信息meta标志属性的剖析(附代码)
发布时间:09/01 来源:未知 浏览:
关键词:
所谓meta标志就是用来描写一个HTML网页文档的属性,也称为元信息,这些信息并不会显示在阅读器的页面中,例如作者、日期和时间、网页描写、页面刷新等。
根本语法:
<meta name = " "content=" "> <meta http-equiv=" " content = " ">
name属性与content属性
name属性用于描写网页,它是以“名称/值”情势的名称,name属性的值所描写的内容(值)通过content属性表示,便于搜索引擎机器人查寻、分类。其中最重要的是description、keywords和robots。
http-equiv属性与content属性
http-equiv属性用于供给HTTP和谈的响应头报文,它是以“名称/值”情势的名称,http-equiv属性的值所描写的内容(值)通过content属性表示,平常为网页加载前供给给阅读器等设备使用。其中最重要的是content-type charset供给编码信息,refresh刷新与跳转页面,no-cache页面缓存,expires网页缓存过期时间。
meta标志的使用办法
<meta name = "keyworlds" contend="信息参数"/> <meta name = "description" contend="信息参数"/> <meta http-equiv = "content-type" contend="text/html;charset=信息参数"/> ----在HTML5中可写成<meta charset="UTF-8"> <meta name = "author" contend="信息参数"/> <meta http-equiv = "refresh" contend="时间; url=网址参数"/>
例子:
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="keywords" content="前端开发"> <meta name="description" content="前端开发"> <meta http-equiv="refresh" content="3;url=https://www.baidu.com/"> <title>前端开发技术初步利用</title></head></html>
相关引荐:
HTML不一样表格属性的总结(附代码)
以上就是HTML中元信息meta标志属性的剖析(附代码)的具体内容,更多请关注百分百源码网其它相关文章!