- AMP:Building Accelerated Mobile Pages
- Ruadhan O'Donoghue
- 156字
- 2021-07-08 10:04:06
Art-direction and responsive images
Let's get back to the issue with the responsive image in our article page example. The problem is that on wider viewports, the image becomes stretched and pixelated as it is scaled. This is because the intrinsic size of our original image is smaller than the viewport on larger screens.
To get around this, you might decide to use a larger image, so that no matter how big the screen is, the image will never be scaled up. The problem with this approach is that it's not good for performance. In most cases, the user will end up downloading a larger image than is needed. Since images are one of the biggest contributors to the page size, if you have a few images like these, they can add up to poor page-load times.
Luckily, there is an HTML5 feature that AMP supports that offers a way to fix this: the srcset attribute.
- ASP.NET Core:Cloud-ready,Enterprise Web Application Development
- 計算思維與算法入門
- Python從入門到精通(精粹版)
- Julia機器學習核心編程:人人可用的高性能科學計算
- Oracle數據庫從入門到運維實戰
- 單片機應用技術
- 用Flutter極速構建原生應用
- STM32F0實戰:基于HAL庫開發
- Learning DHTMLX Suite UI
- Nginx實戰:基于Lua語言的配置、開發與架構詳解
- HTML5與CSS3基礎教程(第8版)
- Learning Unreal Engine Android Game Development
- C語言程序設計
- Swift 4從零到精通iOS開發
- Access 2010數據庫應用技術實驗指導與習題選解(第2版)