AMP

繼續前進

恭喜您,您已建立您的第一個 AMP 頁面!它應該看起來像下面的範例

<!DOCTYPE html>
<html >
  <head>
    <meta charset="utf-8" />
    <title>My AMP Page</title>
    <link rel="canonical" href="self.html" />
    <meta name="viewport" content="width=device-width" />
    <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>
    <script async src="https://cdn.ampproject.org/v0.js"></script>
    <script async custom-element="amp-base-carousel" src="https://cdn.ampproject.org/v0/amp-base-carousel-0.1.js"></script>
    <style amp-custom>
      h1 {
        margin: 1rem;
      }
       body {
        background-color: blue;
      }
    </style>
  </head>
  <body>
    <h1 id="hello">Hello AMPHTML World!</h1>
    <amp-base-carousel loop="true"  width="600" height="400" layout="responsive">
        <amp-img src="https://source.unsplash.com/Ji_G7Bu1MoM/600x400" width="600" height="400" layout="responsive"></amp-img>
        <amp-img src="https://source.unsplash.com/4yCXNMLP9g8/600x400" width="600" height="400" layout="responsive"></amp-img>
        <amp-img src="https://source.unsplash.com/QrgRXH81DXk/600x400" width="600" height="400" layout="responsive"></amp-img>
        <amp-img src="https://source.unsplash.com/8QJSi37vhms/600x400" width="600" height="400" layout="responsive"></amp-img>
    </amp-base-carousel>
    <button on="tap:hello.hide">
      Goodbye AMPHTML World!
    </button>
  </body>
</html>
在 playground 中開啟此程式碼片段

既然您已經開始使用 AMP,接下來要做什麼?

使用 AMP 和您最愛的框架或 CMS 建置網站

許多框架和 CMS 都有 AMP 整合,例如 Eleventy 和 WordPress。請參閱完整清單並開始使用!

將 AMP 與內部解決方案整合

AMP 是一個前端框架,您可以將其與您的後端解決方案整合。使用可用的工具AMP 優化工具,充分利用 AMP!

透過 AMP 學習網頁開發

如果您是網頁開發新手,您可以從AMP 的網頁開發課程開始您的旅程!這些三個免費課程已在世界各地的學校和培訓計畫中使用。現在您可以在我們的網站上線上修習這些課程。這些課程適合初學者和經驗豐富的網頁開發人員,將帶領您從零到 AMP!