Rare Earth Juejin Tech Community
Jul 25, 2024 · Frontend Development
Why a 0.5px Border Renders as 1px and How to Fix It
This article explains why CSS borders set to 0.5px often appear as 1px on various devices, discusses browser rendering and device pixel ratio issues, and provides five practical solutions—including pseudo‑elements, shadows, SVG, and container tricks—to achieve sub‑pixel borders in H5 layouts.
CSSWeb Developmentborder
0 likes · 6 min read