文档元数据base link meta元素
2015-08-06 15:38
288 查看
base元素:
base元素用于指定文档的默认基地址以及链接的打开方式
例子:
<head>
<base href="/new/addr/" />
<base target="_blank" />
</head>
<body>
<!--浏览器会请求/new/addr/1.gif这个文件-->
<img src="1.gif" />
<!--页面将会在新窗口打开-->
<a href="index.html"></a>
</body>
link元素:
1、定义css样式表
<link rel="stylesheet" type="text/css" href="style.css" />
2、定义网页的图标,可使用H5新属性sizes规定尺寸
<link rel="icon" href="favicon.ico" type="image/x-icon" sizes="16*16" />
3、苹果ios系统添加网页到桌面上,图标设置
<link rel="apple-touch-icon" href="..png" sizes="57*57" />
<link rel="apple-touch-icon-precomposed" href="..png" sizes="72*72" />
注释:因为苹果有不同的分辨率,所以设置不同尺寸的icon
apple-touch-icon和apple-touch-icon-precomposed区别:ios会默认给你的图标添加一些样式,如果你需要保留你图标的原始样式,使用apple-touch-icon-precomposed
4、ios应用添加启动画面(单击图标后在页面加载完成之前显示的广告图)
<link rel="apple-touch-startup-image" media="screen and (orientation:portrait)" href="/apple_startup.png" />
<link rel="apple-touch-startup-image" media="screen and (orientation:landscape)" href="/apple_startup1.png" />
注释:portrait表示竖屏,landscape表示横屏
meta元素:
<meta http-equiv="refresh" content="5" />
注释:5秒后刷新页面
<meta http-equiv="set-cookie" content="key=x;path=y" />
注释:设置cookie
另:author、description、keywords(英文逗号分隔)描述在SEO中发挥着重要的作用
ios6之后的设备使用Safari访问时弹出下载应用的提示:
<meta name="apple-itunes-app" content="app-id=123456">
使页面不能手动缩放:
<meta name="viewport" content="user-scalable=no,width=device-width,initial-scale=1.0,maximum-scale=1.0" />
base元素用于指定文档的默认基地址以及链接的打开方式
例子:
<head>
<base href="/new/addr/" />
<base target="_blank" />
</head>
<body>
<!--浏览器会请求/new/addr/1.gif这个文件-->
<img src="1.gif" />
<!--页面将会在新窗口打开-->
<a href="index.html"></a>
</body>
link元素:
1、定义css样式表
<link rel="stylesheet" type="text/css" href="style.css" />
2、定义网页的图标,可使用H5新属性sizes规定尺寸
<link rel="icon" href="favicon.ico" type="image/x-icon" sizes="16*16" />
3、苹果ios系统添加网页到桌面上,图标设置
<link rel="apple-touch-icon" href="..png" sizes="57*57" />
<link rel="apple-touch-icon-precomposed" href="..png" sizes="72*72" />
注释:因为苹果有不同的分辨率,所以设置不同尺寸的icon
apple-touch-icon和apple-touch-icon-precomposed区别:ios会默认给你的图标添加一些样式,如果你需要保留你图标的原始样式,使用apple-touch-icon-precomposed
4、ios应用添加启动画面(单击图标后在页面加载完成之前显示的广告图)
<link rel="apple-touch-startup-image" media="screen and (orientation:portrait)" href="/apple_startup.png" />
<link rel="apple-touch-startup-image" media="screen and (orientation:landscape)" href="/apple_startup1.png" />
注释:portrait表示竖屏,landscape表示横屏
meta元素:
<meta http-equiv="refresh" content="5" />
注释:5秒后刷新页面
<meta http-equiv="set-cookie" content="key=x;path=y" />
注释:设置cookie
另:author、description、keywords(英文逗号分隔)描述在SEO中发挥着重要的作用
ios6之后的设备使用Safari访问时弹出下载应用的提示:
<meta name="apple-itunes-app" content="app-id=123456">
使页面不能手动缩放:
<meta name="viewport" content="user-scalable=no,width=device-width,initial-scale=1.0,maximum-scale=1.0" />
相关文章推荐
- monkey
- this is often breadth players low cost cheap cabal 2 alz
- python函数
- Cisco ASA 5505 密码重置
- jQuery UI vs EasyUI
- 【Unity】2D动画控制器详解
- Java--垃圾回收
- Python调用c扩展记录——ctype
- SQL
- 面试题
- 微信APP支付,服务器端生成prepay_id,及后续处理
- 123456加密md5是多少md5密码16位和32位加密
- nginx 502错 failed (13: Permission denied)
- Codeforces Round #257 (Div. 2) B Jzzhu and Sequences
- iOS项目的重命名方法完整图文教程
- Tomcat去掉8080端口的方法
- 如何关闭AlertDialog.Builder对话框
- iOS开发之保存图片
- [Leetocde]Lowest Common Ancestor of a Binary Search Tree
- 黑马程序员——java高新技术——网络编程