简体   繁体   中英

how to reduce the size of the web page on browser to 90% by default?

I want that when my project of gwt loads on any browser its size on browser by default reduces to 90%. I searched for it in javascript but couldnt find anything.

You can try this:

public void onModuleLoad() {
  int totalWidth = Window.getClientWidth();
  GQuery.$(RootPanel.get()).width((int) (totalWidth * 0.9));
}

For downloading GQuery, go to:

https://code.google.com/p/gwtquery/wiki/Downloads

and download the latest version (right now is gwtquery-1.4.2). Then, in your Xxx.gwt.xml introduce:

<inherits name='com.google.gwt.query.Query'/>

And... happy coding!

直接在gwt项目的html页面的主体上添加css,它将完全适合您项目的所有页面。

Try with simple CSS

<style type="text/css">
     .zoom {
          zoom: 0.9; /* all browsers */
         -moz-transform: scale(0.9); /* Firefox */
      }
</style>

hosted JSP/HTML

<body class="zoom">

For more info have a look at What Does 'zoom' do in CSS?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM