Center canvas (again)

The previous attempt could leave parts of the canvas outside the
document, making it impossible to reach. Use a safer method as
recommended by Mozilla.
This commit is contained in:
Pierre Ossman 2017-02-03 11:43:17 +01:00
parent 93c4b5caaa
commit 9865432a02
1 changed files with 5 additions and 20 deletions

View File

@ -526,7 +526,7 @@ input[type=button]:active, select:active {
background-color: #fff; background-color: #fff;
color: #fff; color: #fff;
border: 0; border: 0;
position: relative; position: absolute;
left: -40px; left: -40px;
z-index: -1; z-index: -1;
ime-mode: disabled; ime-mode: disabled;
@ -786,29 +786,19 @@ input[type=button]:active, select:active {
/* Main container */ /* Main container */
#noVNC_container { #noVNC_container {
display: table;
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: #313131; background-color: #313131;
border-bottom-right-radius: 800px 600px; border-bottom-right-radius: 800px 600px;
/*border-top-left-radius: 800px 600px;*/ /*border-top-left-radius: 800px 600px;*/
} }
:root.noVNC_connected #noVNC_container {
background-color: rgb(40, 40, 40);
border-radius: 0;
}
/* HTML5 Canvas */ /* HTML5 Canvas */
#noVNC_screen { #noVNC_screen {
position: absolute; display: flex;
margin: 0px; width: 100%;
padding: 0px; height: 100%;
bottom: 0px; background-color: rgb(40, 40, 40);
top: 0px;
left: 0px;
right: 0px;
width: auto;
height: auto;
} }
:root:not(.noVNC_connected) #noVNC_screen { :root:not(.noVNC_connected) #noVNC_screen {
display: none; display: none;
@ -818,11 +808,6 @@ input[type=button]:active, select:active {
* scaling will occur. Canvas size depends on remote VNC * scaling will occur. Canvas size depends on remote VNC
* settings and noVNC settings. */ * settings and noVNC settings. */
#noVNC_canvas { #noVNC_canvas {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto; margin: auto;
} }