AMP Boilerplate 程式碼
重要提示:此文件不適用於您目前選擇的格式 email!
head > style[amp-boilerplate]
和 noscript > style[amp-boilerplate]
AMP HTML 文件必須在其 head
標籤中包含以下 boilerplate。目前使用正規表達式進行驗證,因此盡可能減少變更是非常重要的。目前,允許的變更為:
- 在
style
標籤開始後和關閉前立即插入任意空白字元。 - 將以下程式碼片段中的任何空格替換為任意空白字元。
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
您可以使用 boilerplate 產生器 快速設定 AMP 頁面的基本骨架。它還提供了結構化資料、建立 PWA 等的程式碼片段!