- 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.
推薦閱讀
- 實戰(zhàn)Java程序設計
- 網頁設計與制作教程(HTML+CSS+JavaScript)(第2版)
- Python漫游數學王國:高等數學、線性代數、數理統(tǒng)計及運籌學
- SharePoint Development with the SharePoint Framework
- 從0到1:Python數據分析
- 可解釋機器學習:模型、方法與實踐
- 快人一步:系統(tǒng)性能提高之道
- RabbitMQ Cookbook
- Python數據結構與算法(視頻教學版)
- Vue.js光速入門及企業(yè)項目開發(fā)實戰(zhàn)
- Building Business Websites with Squarespace 7(Second Edition)
- R的極客理想:量化投資篇
- 寫給青少年的人工智能(Python版·微課視頻版)
- 創(chuàng)新工場講AI課:從知識到實踐
- Flutter之旅