它有点像 Figma 的 hug content, 据说 CSS 2.1 也是有类似的概念, 只是没有被正式纳入 CSS 里. CSS 3 才开始用的. 参考: [译] CSS 内在尺寸教程(min-content、max-content 和 fit-content )(must read, 里面还有很多运用场景例子) 理解CSS3 max/min-content及fit-content等width值 3 useful CSS values...
p { font-size: 1.1rem; } @media (min-width: 1200px) { p { font-size: 1.2rem; } } @media (max-width: 350px) { p { font-size: 0.9rem; } } Copy Sure, this works, but what happens when the user uses a 4K monitor? Or a foldable phone? There are other tried and true ...