Opera Mobile 10 Viewport Tag Problems

Forums » Dev.Opera » General Web Development Discussions

You need to be logged in to post in the forums. If you do not have an account, please sign up first.

Go to last post

15. April 2010, 19:50:35

iphoneman

Posts: 5

Opera Mobile 10 Viewport Tag Problems

The final build of Opera Mobile 10 appears to have issues with the viewport tag. I believe it was working on beta 1 but I don't have that build around anymore to test with.

Here is some test HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta name="viewport" content="width=device-width">
<meta name="mobileoptimized" content="0">
</head>
<body>
<img src="http://static.myopera.com/community/graphics/main/logo.png">
</body>
</html>

In Opera Mobile 10, the image will appear pixelated because it is zoomed to 200%. Now look at the same page in IE on the same device and renders correctly. Adding a maximum-scale and initial-scale seem to have no affect. I've tested this with the final build of OperaMobi 10 on:

Q9H (Win 6.1)
WinMo 6.1.4 emulator (VGA)

27. April 2010, 14:40:15

mmalaka

Posts: 5

I have this problem with Opera Mobile 9.5 also....
Any advice please?

28. April 2010, 08:10:10

fraloo

Posts: 2

I have the same problem in both 9.5 and 10 (even if they behave a bit different). Testing my code in the opera mobil emulator on (both mac and windows) gives me the expected result. But on Opera 9.5 or 10 on a Windows mobile (HTC Touch HD2) it is zoomed in as iPhoneman said.

This reference page mentioned in this article also works fine in the emulator, but is also zoomed in an incorrect way in both Opera 9.5 and 10.

My ugly work around, that worked for Opera 9.5 became:

<meta name="viewport" content="width=320, user-scalable=no, initial-scale=0.6, maximum-scale=0.6, minimum-scale=0.6" />


Anyone with better luck?

ps. I'm using the HTML5 doctype

1. July 2010, 04:15:12

tooperm

Posts: 1

I have same problem

wroks fine in emulator,not in phone

10. August 2010, 04:29:45

am2605

Posts: 10

Hi,

I'm seeing this one too. Is there any further update? Or any workaround that may work on other devices also?

Many thanks,
Andrew.

19. September 2010, 13:58:17

FxDx

Posts: 1

Same problem here too. Just noticed after installing the emulator.

Offtopic: They could add a menu to the emulator to change resolutions, or rotate the browser.

7. December 2010, 16:32:20

stefpro

Posts: 2

I have similar problem.

In opera mobile screen is zoomed by 140% by default...

Any idea to change it in html code?

7. December 2010, 18:05:40

stefpro

Posts: 2

initial-scale does not work sad

9. February 2011, 11:26:31

cuongluu8

Posts: 1

I got around this problem by using a different docType.
Use the following page header

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

Then remove all your viewport tags.

I got this code from the mobile google.com web page.

9. February 2011, 15:12:13

dstorey

Posts: 237

Originally posted by cuongluu8:

I got around this problem by using a different docType.



Opera Mobile assumes that any document with a mobile specific doctype, such as XHTML Mobile Profile or XHTML Basic are designed and optimised for mobile, while documents with a regular doctype are not optimised for mobile generally. Thus if there is a desktop doctype the overview mode is enabled, which you can control with the viewport meta element. If there is a mobile doctype the overview mode is disabled and a regular 1:1 viewport is used.

There were some bugs in the viewport meta element support in Opera Mobile. They should be fixed in the latest version.
<q>Knowledge speaks, but wisdom listens.</q> - Jimi Hendrix

David Storey, Chief Web Opener, Product Manager Opera Dragonfly, Opera Software ASA

Forums » Dev.Opera » General Web Development Discussions