Can I zoom into a web page like IE or Firefox do, using programming?

后端 未结 3 2091
天命终不由人
天命终不由人 2020-12-10 22:54

Simple - I have a layout that is 800 by 600. When I press Ctrl and +, it zooms in and looks wonderful.

I want to know if there\'s a CSS/Javascript way to do the same

3条回答
  •  再見小時候
    2020-12-10 23:07

    You can set all sizes as dynamic (use em for fonts, % for divs/images sizes). Then change the main wrapper and the main font size using javascript.

    You can also use CSS switching. Put all the colors and such in one css file. Then create 3 or 4 levels of zoom and inside hardcode different sizes for all the existing classes.

    Example:

    main.css

    a{color:red;}
    

    small.css

    a{font-size:10px;}
    

    medium.css

    a{font-size:12px;}
    

提交回复
热议问题