Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Viewport Tag Syntax

I have been looking on the web and I'm still confused on which works and does not. I see errors on chrome when I use the semi-colon, but the iPhone recognizes it. The comma works also without errors. I'm wondering which one is qualified as the correct way of writing it.

Semi Colons -

<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />

Commas -

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" / >

https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html

I'm just looking for a correct interpretation of why I have this error if both work, especially why it throws an error on Chrome.

like image 634
xivo Avatar asked Apr 05 '11 16:04

xivo


People also ask

What are viewport tags?

Viewport is a meta tag located in the <head> of the HTML. It's the visible part of a web page that a user can see from their device or monitor.

What is the viewport in HTML?

The browser's viewport is the area of the window in which web content can be seen. This is often not the same size as the rendered page, in which case the browser provides scrollbars for the user to scroll around and access all the content.

What is @- MS viewport in CSS?

@-ms-viewport rule (Internet Explorer) Specifies properties that describe the viewport.


1 Answers

Commas are the correct delimiters for viewport properties. iPhone Safari (and other browsers) might be more forgiving and interpret semicolons as delimiters as well, but then you're relying on the browser's error handling.

like image 180
andreasbovens Avatar answered Nov 07 '22 04:11

andreasbovens