Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Auto Website Zoom

    Thanks in advance for any help. I am not very experienced at web design. I have spent a ton of time making a webpage with text in graphics (yes, I know, bad idea). The person I am making it for decided "on my bigger laptop, the text is too small. Can you fix that" So to save myself a ton of work, I'd like to set an automatic css zoom based on the browsers screen resolution.

    e.g.

    If 1024, then zoom: 100.
    if 1440, then zoom 120.
    If 1600, then zoom 150

    or somethings like that. I can do some basic stuff in CSS, but seems like maybe javascript is required to pull this off. Help!

  2. #2
    Senior Coder Logic Ali's Avatar
    Join Date
    Sep 2010
    Location
    London
    Posts
    1,028
    Thanks
    0
    Thanked 207 Times in 202 Posts
    If you don't get a better solution, you could try running this inside the <body> section:
    Code:
    <script type='text/javascript'>
       document.body.style.fontSize = screen.width / 1000 + 'em';
    </script>
    All font sizes in the document must be set in em units.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •