In my website I have a fixed-size rectangle with header. Normally text size is quite big. However, if text is too long it will be truncated. But I'd rather font shrink automatically, like `font-size: size-to-fit`. Is it possible in CSS without JS? No, but you could use an SVG image set to width: 100%.
以上就是Dynamic font size in CSS的详细内容，更多请关注web前端其它相关文章！