LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Mobile
User Name
Password
Linux - Mobile This forum is for the discussion of all topics relating to Mobile Linux. This includes Android, Tizen, Sailfish OS, Replicant, Ubuntu Touch, webOS, and other similar projects and products.

Notices


Reply
  Search this Thread
Old 03-27-2015, 03:10 PM   #1
dogpatch
Member
 
Registered: Nov 2005
Location: Central America
Distribution: Mepis, Android
Posts: 490
Blog Entries: 4

Rep: Reputation: 238Reputation: 238Reputation: 238
Android: meta viewport device-width


Specifically: why does this tag:
Code:
<meta name="viewport" content="width=device-width"/>
produce a page on my Android which doesn't fit the screen? The user must scroll to the right to see the whole page.

Worse, if I specify a specific page width, as, e.g:
Code:
 <meta name="viewport" content="width=420px"/>
Google will complain (correctly, i suppose) that this will not work well for many mobile devices and so will not index my site for mobile devices.

Am I missing something, or is my Android browser just stupid?
 
Old 03-28-2015, 03:56 AM   #2
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
Quote:
or is my Android browser just stupid?
I didn't think they made IE for android...

The solution is as simple as it is devious. Find a page that renders correctly on your android browser and then steal the html code from the head element...
And of course, claim later it took hours of work and endless combing of the W3C site, but you eventually ciphered it out.
 
1 members found this post helpful.
Old 03-28-2015, 12:22 PM   #3
dogpatch
Member
 
Registered: Nov 2005
Location: Central America
Distribution: Mepis, Android
Posts: 490

Original Poster
Blog Entries: 4

Rep: Reputation: 238Reputation: 238Reputation: 238
Well, it took hours of work and endless combing of the W3C site, but I eventually ciphered out that there is nothing at all wrong with
Code:
<meta name="viewport" content="width=device-width"/>
My page requires horizontal scrolling because its contents really don't fit within the android screen. Which is to say, i have some adjustments to make; in this case, to a form and its input fields. Duh!

Last edited by dogpatch; 03-28-2015 at 12:24 PM. Reason: correct typo
 
Old 03-28-2015, 12:44 PM   #4
dogpatch
Member
 
Registered: Nov 2005
Location: Central America
Distribution: Mepis, Android
Posts: 490

Original Poster
Blog Entries: 4

Rep: Reputation: 238Reputation: 238Reputation: 238
By the way, thanks dijetlo. Clicked your post as helpful before seeing that your reputaion is disabled. Anyway, your suggestion put me onto the 'View Source' solution to which I have resorted many times, but in this case, was not seeing the forest for the trees, sortof.

Only - I've never thought of 'View Source' as being devious.
 
1 members found this post helpful.
  


Reply

Tags
android, device-width, viewport



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
android: prevent automatic view width adjustment dogpatch Linux - Mobile 2 11-29-2014 08:53 AM
LXer: Turn Your Netbook into an Android Device with Android x86 LXer Syndicated Linux News 0 03-03-2012 06:00 PM
get console window width: why ioctl always return 0 width? karatelambda Programming 2 07-07-2010 07:57 AM
Add Hotspare to existing meta device eldo Linux - Server 2 11-18-2009 10:16 PM
assign hot spare for a meta device eldo Linux - Server 1 11-18-2009 02:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Mobile

All times are GMT -5. The time now is 06:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration