Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a difference between initial-scale=1 and initial-scale=1.0?

Tags:

html

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?


1 Answers

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.

like image 91
D. Pardal Avatar answered Jul 02 '26 05:07

D. Pardal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!