HTML element font size

Tests the effect of setting font-size on the root <html> element. Demonstrates that setting a fixed font-size on the <html> element will overwrite any browser font size settings (as opposed to say the browser applying an additional multiple to the <html> font-size based on browser font size settings.

For this reason avoid setting a fixed font-size on the <html> element.

You can test this by looking at the results of the code examples below, then change your browser font size settings and see what difference it makes.

Default HTML font size

Using the default font-size on the <html> element.

Fixed HTML font size

Using a fixed font-size: 10px on the <html> element.