diff --git a/stack/cas/castext2/blocks/jsxgraph.block.php b/stack/cas/castext2/blocks/jsxgraph.block.php
index 2339533a5b2f4fd111fc9d99c875d85702a05f8c..b6e1490813b48d8dff4baedec8aafac3d8e94943 100644
--- a/stack/cas/castext2/blocks/jsxgraph.block.php
+++ b/stack/cas/castext2/blocks/jsxgraph.block.php
@@ -121,13 +121,13 @@ class stack_cas_castext2_jsxgraph extends stack_cas_castext2_block {
             $height = $xpars['height'];
         }
 
-        $astyle = "width:calc(100% - 3px);height:calc(100% - 3px);";
+        $astyle = "width:calc(100% - 3px);height:calc(100vh - 3px);";
 
         if (array_key_exists('aspect-ratio', $xpars)) {
             $aspectratio = $xpars['aspect-ratio'];
             // Unset the undefined dimension, if both are defined then we have a problem.
             if (array_key_exists('height', $xpars)) {
-                $astyle = "height:calc($100% - 3px);aspect-ratio:$aspectratio;";
+                $astyle = "height:calc(100% - 3px);aspect-ratio:$aspectratio;";
             } else if (array_key_exists('width', $xpars)) {
                 $astyle = "width:calc(100% - 3px);aspect-ratio:$aspectratio;";
             }