HTML 整体缩放

sunfeng 2018-11-12 21:53 阅读数 33 #小技巧
html 页面缩放主要有两种,IE 可使用 CSS body{zoom:1.2;}  。其它 浏览器可使用 body{transform: scale(1.2);} 这个是从中心点缩放,所以需要配合另外一个属性使用 以下是样例 ZOOM,应该只支持IE :
<html>
<head>
<style type="text/css">body {zoom:1.5;}</style>
</head>
<body>
<h1>这是标题 1</h1>
<h2>这是标题 2</h2>
<p>这是段落</p>
<p class="no2">这个段落设置了内边距。</p>
</body>
</html>
其它浏览器可使用 transform 例:
<html>
<head>
<style type="text/css">
body {transform: scale(1.5) translate(200px, 100px); }
</style>
</head>
<body>
<h1>这是标题 1</h1>
<h2>这是标题 2</h2>
<p>这是段落</p>
<p class="no2">这个段落设置了内边距。</p>
</body>
</html>
上一篇:共享文件夹 下一篇:获取光猫超级密码

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

搜索
标签列表