網(wǎng)站設(shè)計中meta標簽的組成
來源:實搜網(wǎng)絡(luò) 2013-11-27
meta標簽共有兩個屬性,它們分手是http-equiv屬性和name屬性,分歧的屬性又有分歧的參數(shù)值,這些分歧的參數(shù)值就完成了分歧的網(wǎng)頁功用。
1、name屬性
name屬性首要用于描畫網(wǎng)頁,與之對應的屬性值為content,content中的內(nèi)容首如果便于搜索引擎機械人查找信息和分類信息用的。
meat標簽的name屬性語法把戲是:<meta name=\\\"參數(shù)\\\" content=\\\"細致的參數(shù)值\\\"> 。
個中name屬性首要有以下幾種參數(shù):
a、keywords(關(guān)鍵字)
說明:keywords用來通知搜索引擎你網(wǎng)頁的關(guān)鍵字是什么。
舉例:<meta name =\\\"keywords\\\" content=\\\"science, education,culture,politics,ecnomics,relationships, entertaiment, human\\\">
b、description(網(wǎng)站內(nèi)容描畫)
說明:description用來通知搜索引擎你的網(wǎng)站首要內(nèi)容。
舉例:<meta name=\\\"description\\\" content=\\\"this page is about the meaning of science, education,culture.\\\">
c、robots(機械人導游)
說明:robots用來通知搜索機械人哪些頁面需求索引,哪些頁面不需求索引。
content的參數(shù)有all,none,index,noindex,follow,nofollow。默許是all。
舉例:<meta name="robots" content="none">
d、author(作者)
說明:標注網(wǎng)頁的作者
舉例:<meta name="author" content="zsin,zsin@zsin.net">
2、http-equiv屬性
http-equiv望文生義,相當于http的文件頭浸染,它可以向閱讀器傳回一些有用的信息,以輔佐精確和精確地展現(xiàn)網(wǎng)頁內(nèi)容,與之對應的屬性值為content,content中的內(nèi)容其實就是各個參數(shù)的變量值。
meat標簽的http-equiv屬性語法把戲是:<meta http-equiv=\\\"參數(shù)\\\" content=\\\"參數(shù)變量值\\\"> ;個中http-equiv屬性首要有以下幾種參數(shù):
a、expires(刻日)
說明:可以用于設(shè)定網(wǎng)頁的到期時分。一旦網(wǎng)頁過時,必需到效勞器上重新傳輸。
用法:<meta http-equiv=\\\"expires\\\" content=\\\"fri, 12 jan 2001 18:18:18 gmt\\\">
屬意:必需運用gmt的時分把戲。
b、pragma(cache方式)
說明:遏止閱讀器從當?shù)乇荣悹幷摍C的緩存中接見頁面內(nèi)容。
用法:<meta http-equiv=\\\"pragma\\\" content=\\\"no-cache\\\">
屬意:多么設(shè)定,接見者將無法脫機閱讀。
c、refresh(刷新)
說明:自動刷新并指向新頁面。
用法:<meta http-equiv=\\\"refresh\\\" content=\\\"2;url=http://www.zsin.net\\\">
屬意:個中的2是指勾留2秒鐘后自動刷新到url網(wǎng)址。
d、set-cookie(cookie設(shè)定)
說明:假設(shè)網(wǎng)頁過時,那么存盤的cookie將被刪除。
用法:<meta http-equiv=\\\"set-cookie\\\" content=\\\"cookievalue=xxx; expires=friday, 12-jan-2001 18:18:18 gmt; path=/\\\">
屬意:必需運用gmt的時分把戲。
e、window-target(展現(xiàn)窗口的設(shè)定)
說明:強迫頁面在當前窗口以自力頁面展現(xiàn)。
用法:<meta http-equiv=\\\"window-target\\\" content=\\\"_top\\\">
屬意:用來防止別人在框架里調(diào)用自己的頁面。
f、content-type(展現(xiàn)字符集的設(shè)定)
說明:設(shè)定頁面運用的字符集。
用法:<meta http-equiv=\\\"content-type\\\" content=\\\"text/html; charset=gb2312\\\">
實搜網(wǎng)絡(luò)為您提供網(wǎng)絡(luò)推廣,網(wǎng)絡(luò)營銷,網(wǎng)站建設(shè),SEO優(yōu)化,微信開發(fā),網(wǎng)站托管等服務,服務熱線:0311-66697360