html5 移動適配寫法

來源:互聯網
上載者:User

標籤:最新   抓取   方案   agent   content   移動端   但我   alt   can   

在pc版網頁(http://pc_url) 上,添加:

<link rel="alternate" media="only screen and(max-width: 640px)" href="http://pc_url" >

在移動版網頁(http://mobile_url) 上,所需的注釋應為:

<link rel="canonical" href="http://mobile_url" >

之前的Meta標記(mobile agent)會繼續沿用,但我們推薦使用HTMAL5語言製作的移動頁面使用最新方案進行跳轉適配,其它如xml語言的移動頁跳轉適配,需要繼續使用之前的meta標記方式:

<meta name="mobile-agent"content="format=[wml|xhtml|html5]; url=mobile_url">

html5新增的移動適配寫法如上,這個主要是為了百度等搜尋引擎抓取到網站的移動端網址是什麼,不是自動當裝置切換到手機時自動跳轉的.若實現自動跳轉還需要js.

 

參考:http://www.cnblogs.com/osfipin/p/5852037.html

html5 移動適配寫法

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.