Does stating
<meta name="viewport" content="width=device-width" />
have the same effect as stating
<meta name="viewport" content="width=768" />
for the ipad?
The viewport meta tag tells the browser that the width of the screen should be considered the "Full Width" of the page. Meaning no matter the width of the device you are on, whether on desktop or mobile. the website will follow the width of the device the user is on.
Throw the viewport meta tag into your <head> , plus the @viewport rule into your CSS when you're building flexible layouts and you're good to go.
Nearly every photo you take on your iPhone has a batch of hidden information stored within: metadata. This metadata, known more specifically as EXIF data for images, contains descriptive information that makes each image unique. That includes the creation date, camera information and settings and your location.
Setting The ViewportThe width=device-width part sets the width of the page to follow the screen-width of the device (which will vary depending on the device). The initial-scale=1.0 part sets the initial zoom level when the page is first loaded by the browser.
It depends indeed on the orientation of the device: setting a specific pixel value will cause your layout to be scaled up with a factor of 1.333 to fit inside the 1024px device width when in landscape mode.
Setting width=device-width
on the other hand will not scale anything up, but change the viewport width, for which you then can craft an optimized layout using media queries. Or that is at least the theory: the iPad somehow interprets width=device-width
as 768px even in landscape mode. In order to get the real device width, you have to add initial-scale=1.
Hence, I disagree with James' suggestion. Just go for:
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
and deal with size differences using liquid / responsive layout techniques.
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