Skip to main content

HTML Guide

Free site validation

Find out what web pages on your sites are affected by HTML issues.

Bad value X for attribute “(width | height)” on element “iframe”: Expected a digit but saw “.” instead.

The attributes width and height on an iframe expect a valid positive integer without any decimals.

Here’s an example of incorrect code where decimals are being used for dimension attributes:

<iframe src="example.html" height="602.88" width="800.2"></iframe>

Corrected code without decimals:

<iframe src="example.html" height="603" width="800"></iframe>

In the corrected code, the width and height values has been changed to a whole number, which conforms to the standard integer value expected by the W3C validator.

Learn more:

Related W3C validator issues