html5一些特性

1.添加Html5标识头
<!DOCTYPE html>
2.注释
<!-- -->
3.块元素
<h1> <p><ul><li><div>
4.内联元素
<a><b><em><img><span>
5.内联框架iframe

<body>
		<iframe width="450" height="350" src="http://maps.google.co.uk/maps?q=moma+new+york&amp;output=embed" frameborder="1">
		</iframe>
	</body>

嵌入地图。也可嵌入网页,视频,图片,广告。用途很广

seamless用于说明不需要嵌入滚动条。

与超链接的target属性配合使用

<a href="www.toutiao.com target="tt">点我看新闻</a>
<a href="www.taobao.com" target="tt">点我上淘宝</a>
<iframe name="tt" frameborder="0" width="900" height="300"></iframe>

与表单的target属性配合使用

<form action=""https://so.toutiao.com/search" traget="container">
<input type="text" name="keyword">
<button>搜索</button>
</form>

<iframe name="container" frameborder="0" width="900" height="300"></iframe>
6.meta

<head>
		<title>Information About Your Pages</title>
		<meta name="description" content="An Essay on Installation Art" />
		<meta name="keywords" content="installation, art, opinion" />
		<meta name="robots" content="nofollow" />
		<meta http-equiv="author" content="Jon Duckett" />
		<meta http-equiv="pragma" content="no-cache" />
		<meta http-equiv="expires" content="Fri, 04 Apr 2014 23:59:59 GMT" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewpoint" content="width=device-width,initial-scale=1.0">
         <meta http-equiv="refresh" content="10;url=http://www.baidu.com" />
	</head>

description 用于描述网页信息
keywords 包含关键字,现已经少用
robots 指定搜索引擎是否可以把该页面加入搜索结果中。不希望加入使用noindex,希望加入用index,希望搜索引擎加入但不要收集页面的其他页面。使用nofollow
author指名作者
pragma用于防止浏览器对页面缓存
expires用于指定页面过期时间。必须按照示例格式来显示时间。
X-UA-Compatible:使用edge渲染IE浏览器(兼容性问题)
refresh 多少秒后跳转至url,不写url原地刷新
viewpoint 适配移动端相关(暂不清楚用途)

Define the character set used:

<meta charset="UTF-8">
Define keywords for search engines:

<meta name="keywords" content="HTML, CSS, JavaScript">
Define a description of your web page:

<meta name="description" content="Free Web tutorials">
Define the author of a page:

<meta name="author" content="John Doe">
Refresh document every 30 seconds:

<meta http-equiv="refresh" content="30">
Setting the viewport to make your website look good on all devices:

<meta name="viewport" content="width=device-width, initial-scale=1.0">
posted @ 2024-09-29 13:29  zhongta  阅读(9)  评论(0)    收藏  举报