Reputation: 341
I'm working on a mobile web app and I've noticed on both my test phones, which are BlackBerry 9700 Bold (OS 5.0) and BlackBerry Tour 9630 (OS 4.7) do not render width properly.
I have a simple table that I've declared to be width 100%, but the table doesn't expand and take up 100% of the screen. There is a gutter / white border of 10px or so to the right of the screen. If I hard code the width to be 480px, then it takes up the entire screen, but I don't want to hard code width values since they may be different depending on what BlackBerry the user is using.
I'm using this meta tag: <meta name="HandheldFriendly" content="true" />
and experimented with setting the viewport meta tag with little success.
Any ideas? I realize I could set the width dynamically using JavaScript, but I'd rather not. Also, if I save the rendered page as HTML and then upload that HTML to the server, then when I browse to that page from the BlackBerry the width is 100%! This is weird considering it's the same code. Perhaps something is wrong when the page is dynamically created and the width gets messed up.
Anyone else experience something like this?
Upvotes: 0
Views: 1211
Reputation: 11
I solved this problem thanks to the viewport meta like that :
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0;" />
After that a simple "body{width:100%}" works fine !
And it's compatible with other phones.
Upvotes: 0
Reputation: 11
I managed to get rid of the gutter space by adding this in my CSS:
body
{
margin: 0px;
}
Upvotes: 1
Reputation: 943
I actually just solved this for my project. I added a min-width:470px to the divs that were not filling the full BlackBerry width, and it fixed it.
Upvotes: 0