html meta用法範例介紹

高洛峰
發布: 2017-02-23 13:25:32
原創
1210 人瀏覽過

範例用法 

<!DOCTYPE html> 
<!--[if lt IE 7]><html class="ie6"><![endif]--> 
<!--[if IE 7]><html class="ie7"><![endif]--> 
<!--[if IE 8]><html class="ie8"><![endif]--> 
<!--[if IE 9]><html class="ie9"><![endif]--> 
<!--[if (gt IE 9)|!(IE)]><!--> 
<html class="w3c"> 
<!--<![endif]--> 
<head> 
<meta charset="utf-8" /> 
<title>tinyCss--my css study tidy</title> 
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible" /> 
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport" /> 
<meta content="my css study tidy" name="description" /> 
<meta content="css,tidy" name="keywords" /> 
<meta content="index,follow" name="robots" /> 
<meta content="tinycss" name="application-name" /> 
<meta content="no-cache" http-equiv="Cache-Control" /> 
<meta content="-1" http-equiv="Expires" /> 
</head> 
<body></body> 
</html>
登入後複製

[code] 
提示一: 

viewport, 當你的頁面有寬度時,例如寬度為1000px,設定width=1000, 相容性會更好些。

提示二: 

X-UA-Compatible, 此屬性僅為ie8瀏覽器識別,讓ie8用ie7的模式渲染是常見的應用;這樣:content="IE =7";不用這個meta會是比較好的建議,因為畢竟ie8...。

提示三: 

Expires:文件過期時間,過了這個時間就需要從伺服器從新請求,而不可以用快取;content="-1"理論上是停用快取的。


更多html meta用法範例介紹相關文章請關注PHP中文網!


相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!