html meta用法示例介紹

字號(hào):


    示例用法
    代碼如下:
    <!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, 當(dāng)你的頁面有寬度時(shí),比如寬度為1000px,設(shè)定width=1000, 兼容性會(huì)更好些。
    提示二:
    x-ua-compatible, 此屬性僅為ie8瀏覽器識(shí)別,讓ie8用ie7的模式渲染是一種常見的應(yīng)用;這樣:content=ie=7;不用這個(gè)meta會(huì)是比較好的建議,因?yàn)楫吘筰e8...。
    提示三:
    expires:文檔過期時(shí)間,過了這個(gè)時(shí)間就需要從服務(wù)器從新請(qǐng)求,而不可以用緩存;content=-1理論上是禁用緩存的。