Probing Browser Limits with Infinite CSS Values

2025-08-08
Probing Browser Limits with Infinite CSS Values

The author experimented with setting element width and height to `calc(infinity * 1px)` in CSS to explore how different browser rendering engines handle infinite values. Chrome and Safari capped the value at approximately 33,554,400 pixels. However, Firefox Nightly exhibited unusual behavior; height was limited to the text line height, while width reached millions of pixels, yet the layout width was roughly half. Further tests with font size and line-height revealed similar discrepancies, with Firefox's rendering drastically different from other browsers. The author speculates on the reasons for these oddities and invites readers to provide explanations.

Development