html meta用法示例介紹

字號:


    示例用法
    代碼如下:
    <!DOCTYPE html>
    <!--[if lt IE 7]><html><![endif]-->
    <!--[if IE 7]><html><![endif]-->
    <!--[if IE 8]><html><![endif]-->
    <!--[if IE 9]><html><![endif]-->
    <!--[if (gt IE 9)|!(IE)]><!-->
    <html>
    <!--<![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, 當(dāng)你的頁面有寬度時,比如寬度為1000px,設(shè)定width=1000, 兼容性會更好些。
    提示二:
    X-UA-Compatible, 此屬性僅為ie8瀏覽器識別,讓ie8用ie7的模式渲染是一種常見的應(yīng)用;這樣:content="IE=7";不用這個meta會是比較好的建議,因為畢竟ie8...。
    提示三:
    Expires:文檔過期時間,過了這個時間就需要從服務(wù)器從新請求,而不可以用緩存;content="-1"理論上是禁用緩存的。