How to make Electron WebView fill specified size?

This is an issue other people have reported too. Here in atom discussion webview autosize.

It seems that 'autosize' doesn't say the last word about the resulting window size; css parameters may interfere and change the result.

There are some css workarounds proposed for this issue that may help:

Set html and body width to 100%:

html, body {
   width: 100%;
   height: 100%;
   margin: 0;
   padding: 0;
}

Set viewport relative units in webview css:

webview {
  display: block;   /* iframes are inline by default */
  border: none;     /* Reset default border */
  height: 80vh;     /* Viewport-relative units */
  width: 95vw;
}