- AMP:Building Accelerated Mobile Pages
- Ruadhan O'Donoghue
- 201字
- 2021-07-08 10:04:03
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.
推薦閱讀
- Node.js 10實戰
- HoloLens Beginner's Guide
- Mastering Selenium WebDriver
- Mastering Kotlin
- MySQL 8 DBA基礎教程
- Building Serverless Applications with Python
- MATLAB 2020從入門到精通
- Apache Kafka Quick Start Guide
- R語言與網絡輿情處理
- MySQL從入門到精通(軟件開發視頻大講堂)
- 深度學習原理與PyTorch實戰(第2版)
- ASP.NET 4.0 Web程序設計
- 跟戴銘學iOS編程:理順核心知識點
- Hands-On Robotics Programming with C++
- 亮劍C#項目開發案例導航