Link to home
Start Free TrialLog in
Avatar of darren-w-
darren-w-Flag for United Kingdom of Great Britain and Northern Ireland

asked on

scaling viewport to fit whole webpage

Hi

I have a webpage that is designed to fit inside the screen of a ipad, but I would like to accommodate for the fact that some users will sometimes have tags open and in this case I would like to further reduce the viewports width in order to hold the whole page in the view.

Can this be done with JavaScript, and what would be the best approach?

Darren
Avatar of Mrunal
Mrunal
Flag of India image

Most common thing for achieving complete width of any resolution / machine, assign width for outer container in percentage. (like- width:100%)

It will automatically shrinks accordingly.

Hope this helps you.
Avatar of darren-w-

ASKER

Thanks,

not so sure if it would solve the problem if the available height was smaller than expected I would like to increase the vp width so that the full height was shown, attached sketch
Untitled.gif
Darren,

Do you want to have complete height or width? In your question you are asking about width.
Now you need to have complete height.

can you please share your code and what exactly you want?
I would ideally like to do this:

<meta name="viewport" content="height=[full height of content]" />

based on this:  <meta name="viewport" content="width=device-width" /> which will resize the page to fit the width

Yes, my original question is worded incorrectly:
this: further reduce the viewports width
should read: further increase the viewports width



ASKER CERTIFIED SOLUTION
Avatar of darren-w-
darren-w-
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
found solution  myself