Tagged articles
2 articles
Page 1 of 1
WeChatFE
WeChatFE
Feb 13, 2017 · Frontend Development

How to Eliminate Front‑End Image Layout Shift with Smart Placeholder Optimization

By inlining placeholder logic, triggering it at DOMContentLoaded, and calculating placeholder dimensions based on the nearest non‑zero‑width ancestor rather than screen width, this guide shows how to prevent first‑screen layout shifts caused by image loading in modern web front‑end development.

Browser Renderingimage placeholderlayout shift
0 likes · 9 min read
How to Eliminate Front‑End Image Layout Shift with Smart Placeholder Optimization
JavaScript
JavaScript
Jan 16, 2017 · Frontend Development

How to Stop Mobile Layout Shifts Caused by Lazy‑Loaded Images

This article explains why images that load after the DOM cause noticeable layout jumps on mobile pages and presents four CSS‑based solutions—media queries with pixels, rem units, viewport‑based vm units, and percentage padding—along with a complete example that eliminates the shift.

CSSMobilefrontend
0 likes · 4 min read
How to Stop Mobile Layout Shifts Caused by Lazy‑Loaded Images