设置网页的icon图标

来源:互联网 发布:阿里云怎么备案域名 编辑:程序博客网 时间:2024/05/01 15:44

有两种方式设置:

1.<link rel="icon" type="image/x-icon" href="..." />2.<link rel="shortcut icon" type="image/x-icon" href="..." />

两种方式的区别为:第一种用于希望为浏览器提供另外一种备用的图像比如gif动态图等,而第二种是大多数遵守标准的浏览器所能识别的。一般建议两个都写,如下:

<!Doctype html><html>    <head>        <meta http-equiv="author" content="chengxi" />        <meta http-equiv="keywords" content="icon,style,html5" />        <title设置icon图标</title>        <link rel="shortcut icon" type="image/x-icon" href=""http://c.csdnimg.cn/public/favicon.ico" />        <link rel-"icon" type="image/x-icon" href=""http://c.csdnimg.cn/public/favicon.ico" />    </head>    <body>        <!--body content-->    </body></html>
0 0
原创粉丝点击