[英]how to reduce the size of the web page on browser to 90% by default?
我希望当我的gwt项目在任何浏览器上加载时,默认情况下浏览器上的大小减小到90%。 我在javascript中搜索了它,但找不到任何东西。
您可以尝试以下方法:
public void onModuleLoad() {
int totalWidth = Window.getClientWidth();
GQuery.$(RootPanel.get()).width((int) (totalWidth * 0.9));
}
要下载GQuery,请转到:
https://code.google.com/p/gwtquery/wiki/Downloads
并下载最新版本(现在是gwtquery-1.4.2)。 然后,在您的Xxx.gwt.xml中引入:
<inherits name='com.google.gwt.query.Query'/>
还有...快乐的编码!
直接在gwt项目的html页面的主体上添加css,它将完全适合您项目的所有页面。
尝试使用简单的CSS
<style type="text/css">
.zoom {
zoom: 0.9; /* all browsers */
-moz-transform: scale(0.9); /* Firefox */
}
</style>
托管的JSP / HTML
<body class="zoom">
有关更多信息,请查看CSS中的“缩放”功能是什么?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.