官术网_书友最值得收藏!

AMP components

We've seen how AMP restricts HTML. It's not all bad though: AMP also extends HTML with replacement tags that provide similar behavior to the forbidden tags, but in a constrained and performance-optimized way. These are known as AMP components or AMP custom elements.

There are three types of AMP component:

  • Built in/core components: These components are ready to use in your AMP-HTML page right away. They are distributed with the core AMP-JS library, so you don't need to explicitly include them in the head of your document. These include the most commonly used tags, such as amp-img , amp-video, and amp-pixel.
  • Extended components: These components extend the functionality beyond the most common core components. You need to include them explicitly before you can use them on your page. For example, to use form elements, you need to include the form extension in the head of your AMP document:
      <script async custom-element="amp-form" 
src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script>
  • Experimental components: These are components that have been released to the public but are not yet finalized and don't validate yet. Experimental features are opt-in, and can be activated at the document or the feature level. We'll see more on these features later. AMP experimental features are described online here: github.com/ampproject/amphtml/tree/master/tools/experiments.
主站蜘蛛池模板: 绥化市| 岳西县| 奉新县| 龙陵县| 肇庆市| 安义县| 鱼台县| 曲阳县| 潼南县| 图片| 阜康市| 永胜县| 南充市| 红河县| 两当县| 杭州市| 杭州市| 五大连池市| 工布江达县| 西宁市| 江城| 开鲁县| 玉环县| 庆元县| 灯塔市| 米泉市| 攀枝花市| 孟连| 永和县| 稷山县| 辽阳县| 攀枝花市| 平舆县| 光泽县| 呼伦贝尔市| 通渭县| 平顶山市| 临海市| 江陵县| 时尚| 阳高县|