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

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.
主站蜘蛛池模板: 宿迁市| 曲水县| 吉隆县| 凌海市| 汉寿县| 阳曲县| 兰考县| 蒲江县| 集贤县| 隆子县| 定州市| 南安市| 会理县| 格尔木市| 铅山县| 玛沁县| 通渭县| 三原县| 云和县| 无极县| 安福县| 肇州县| 肥西县| 望奎县| 怀远县| 闻喜县| 东阳市| 双鸭山市| 嘉兴市| 乌兰浩特市| 诏安县| 淮北市| 屯门区| 苍溪县| 上杭县| 乌海市| 江永县| 绥中县| 仁寿县| 宁武县| 蒲江县|