Consider this example: I manually set the body's zoom to 60% so that the #content div fits horizontally on the screen (The #content div must not wrap or scroll).
body{
zoom:60%
}
#content{
overflow-x: hidden;
white-space: nowrap;
}
<div id="content">
THIS CONTENT HAS TO FIT HORIZONTALLY ON SCREEN, THIS CONTENT CAN'T WRAP NOR SCROLL BLA BLA BLA BLA BLA BLA BLA
</div>
How can I zoom out or make the content smaller so that it automatically fits the width of the screen? Can you give me an example or direct me to a tutorial?
I've been reading about @ViewPort and jquery's scale function but it doesn't work for me.
The solution was to manipulate the CSS Scale class through javascript and doing a simple calculation
I've been testing this and it works pretty well. Not Prefect:
Adjusts the zoom (I call the function 3 times because every time the adjustZoom function is called it changes the size and adjusts itself).
It works fine in Chrome but not in FireFox (because the scrollWidth doesn't work as needed here)
What variable could I place so that the content adjusts to either the width "clientWidth" or the height "clientHight" depending on whether the screen is portrait or landscape?
I put the following code and it works perfectly on horizontal screen, however on vertical screen the content is cut off.
The code I put is this: