I have seen code that is written like this: <meta name="viewport" content="width=device-width, initial-scale=1">, but I have also seen code that is written like this: <meta name="viewport" content="width=device-width, initial-scale=1.0"> Is there a difference between initial-scale=1 and initial-scale=1.0?
No. The specification describes the viewport <meta> tag content parsing algorithm non-normatively, but says the following about values:
If a prefix of property-value can be converted to a number using
strtod, the value will be that number. The remainder of the string is ignored.
strtod is a function from the C standard library. strtod("1") is equal to strtod("1.0"), which is equal to the number 1, so there's no difference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With