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

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.
主站蜘蛛池模板: 绥芬河市| 左云县| 子长县| 龙门县| 新源县| 昆明市| 南投市| 靖西县| 克什克腾旗| 左权县| 红安县| 柞水县| 文水县| 阳谷县| 建阳市| 武汉市| 固安县| 友谊县| 祁门县| 青川县| 孝义市| 明溪县| 灵璧县| 莒南县| 赤水市| 清镇市| 涪陵区| 互助| 灵宝市| 崇礼县| 沙田区| 大埔区| 湖南省| 泊头市| 苗栗市| 磴口县| 贺兰县| 张家界市| 焦作市| 滁州市| 栾川县|