html 標籤: meta, script, style

meta

meta是html語言head區的一個輔助性標籤。
做用有:SEO, 緩存, 窗口大小, 字符集等.javascript

meta標籤分兩類,http-equivnamehtml

1. name

keywords

<meta name="keywords" content="SEO關鍵字">

description

<meta name="description" content="SEO主要內容">

robots

<meta name="robots" content="none">

content具體參數以下:
信息參數爲all:默認值, 文件將被檢索,且頁面上的連接能夠被查詢;
信息參數爲none:文件將不被檢索,且頁面上的連接不能夠被查詢;
信息參數爲index:文件將被檢索;
信息參數爲follow:頁面上的連接能夠被查詢;
信息參數爲noindex:文件將不被檢索,但頁面上的連接能夠被查詢;
信息參數爲nofollow:文件將被檢索,但頁面上的連接不能夠被查詢;

author

<meta name="author" content="your@email.com">

generator

表明說明網站的採用的什麼軟件製做java

<meta name="generator"content="FrontPage 4.0"/>

copyright

<meta name="copyright" content="the Meta Tags Company">

viewport

屏幕的縮放web

width             viewport的寬度(數值/device-width)
height            viewport的高度(數值/device-height)
user-scalable     是否容許縮放,(yes/no)
initial-scale     初始化比例(範圍從 > 0 到 10)
minimum-scale     容許縮放的最小比例
maximum-scale     容許縮放的最大比例
target-densitydpi 值有如下(通常推薦設置中等響度密度或者低像素密度,後者設置具體的值dpi_value,另外webkit內核已不許備再支持此屬性)
   -- dpi_value   通常是70-400//沒英寸像素點的個數
   -- device-dpi  設備默認像素密度
   -- high-dpi    高像素密度
   -- medium-dpi  中等像素密度
   -- low-dpi     低像素密度
<meta name="viewport" content="width=device-width,height=device-height, user-scalable=no,initial-scale=1, minimum-scale=1, maximum-scale=1,target-densitydpi=device-dpi ">

format-detection

忽略手機號和郵箱chrome

<meta name="format-detection" content="telphone=no, email=no"/>

X-UA-Compatible

優先使用 IE 最新版本和 Chrome瀏覽器

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>

screen-orientation

強制屏幕方向緩存

<meta name="screen-orientation" content="portrait">
<meta name="screen-orientation" content="portrait">
<!-- QQ強制豎屏 -->

<meta name="x5-orientation" content="portrait">
<!-- UC強制全屏 -->
<meta name="full-screen" content="yes">
<!-- QQ強制全屏 -->

<meta name="x5-fullscreen" content="true">
<!-- UC應用模式 -->
<meta name="browsermode" content="application">
<!-- QQ應用模式 -->
<meta name="x5-page-mode" content="app">

apple-mobile-web-app-capable

開啓對web app程序的支持, 即刪除默認的蘋果工具欄和菜單欄,開啓全屏顯示服務器

<meta name="apple-mobile-web-app-capable" content="yes">

apple-mobile-web-app-status-bar-style

改變頂部狀態條的顏色, 默認值爲 default(白色),能夠定爲 black(黑色)和 black-translucent(灰色半透明)cookie

<meta name="apple-mobile-web-app-status-bar-style" content="black" />

2. http-equiv

expires(過時)

<meta http-equiv="expires"content=""> 
必須使用GMT格式

Pragma

禁止瀏覽器從本地計算機的緩存中訪問頁面內容。app

<meta http-equiv="Pragma"content="no-cache">

Refresh

自動刷新, 停留time秒後指向新頁面

<meta http-equiv="Refresh"content="time;URL=http://www.google.com">

Set-Cookie

若是網頁過時,那麼cookie也將被刪除。

<meta http-equiv="Set-Cookie" content="ACCOUNT=9983373; path=/; expires=Thursday, 20-May-09 00:15:00 GMT">

Window-target

強制頁面在當前窗口以獨立頁面顯示.
注意:這個屬性是用來防止別人在框架裏調用你的頁面。Content選項:_blank、_top、_self、_parent.

_blank 連接文件在新的窗口中打開

_parent 連接文件將在當前窗口的父級窗口中打開

_self 連接文件在當前窗口(幀)中打開

_top 連接文件全屏顯示

<meta http-equiv="Window-target"content="_top">

content-type

<meta http-equiv="content-Type"content="text/html;charset=utf8"> 
or
<meta charset="UTF-8"> H5新標籤

content-language

<meta http-equiv="Content-Language"content="zh-cn"/>

Cache-Control

Cache-Control指定請求和響應遵循的緩存機制。在請求消息或響應消息中設置Cache-Control並不會修改另外一個消息處理過程當中的緩存處理過程。請求時的緩存指令包括no-cache、no-store、max-age、max-stale、min-fresh、only-if-cached,響應消息中的指令包括public、private、no-cache、no-store、no-transform、must-revalidate、proxy-revalidate、max-age。各個消息中的指令含義以下

Public指示響應可被任何緩存區緩存

Private指示對於單個用戶的整個或部分響應消息,不能被共享緩存處理。這容許服務器僅僅描述當用戶的部分響應消息,此響應消息對於其餘用戶的請求無效

no-cache指示請求或響應消息不能緩存

no-store用於防止重要的信息被無心的發佈。在請求消息中發送將使得請求和響應消息都不使用緩存。

max-age指示客戶機能夠接收生存期不大於指定時間(以秒爲單位)的響應

min-fresh指示客戶機能夠接收響應時間小於當前時間加上指定時間的響應

max-stale指示客戶機能夠接收超出超時期間的響應消息。若是指定max-stale消息的值,那麼客戶機能夠接收超出超時期指定值以內的響應消息。

imagetoolbar

<meta http-equiv="imagetoolbar"content="false"/>

Content-Script-Type

<meta http-equiv="Content-Script-Type"Content="text/javascript">

Pics-label

網站評級, 具體查詢RSAC

<meta http-equiv="Pics-label" Contect="(PICS-1.1'http://www.rsac.org/ratingsv01.html'I gen comment 'RSACi North America Sever' by 'inet@microsoft.com'for 'http://www.microsoft.com' on '1997.06.30T14:21-0500' r(n0 s0 v0 l0))">

Page-Enter、Page-Exit

這個是頁面被載入和調出時的一些特效

3. 其餘標籤

Base
你網頁上的全部相對路徑在連接時都將在前面加上Base

<Base href="http://www.google.com/" target="_blank">

script標籤

async
若是 async="async":腳本相對於頁面的其他部分異步地執行(當頁面繼續進行解析時,腳本將被執行)
若是不使用 async 且 defer="defer":腳本將在頁面完成解析時執行
若是既不使用 async 也不使用 defer:在瀏覽器繼續解析頁面以前,當即讀取並執行腳本

<script type="text/javascript" src="demo_async.js" async="async"></script>

chartset

<script type="text/javascript" src="myscripts.js" charset="UTF-8"></script>

defer
IE Only. 規定是否對腳本執行進行延遲,直到頁面加載爲止. (適用於不影響頁面加載的腳本)

<script type="text/javascript" defer="defer"></script>

參考文章
http://blog.csdn.net/kongjiea/article/details/17092413
http://www.jb51.net/web/158860.html
http://www.haorooms.com/post/html_meta_ds

相關文章
相關標籤/搜索