Skip to content

Commit

Permalink
Centered using flexbox
Browse files Browse the repository at this point in the history
  • Loading branch information
MHShetty committed Aug 11, 2021
1 parent 8a16b71 commit 6895dfd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
22 changes: 12 additions & 10 deletions app/src/main/assets/viewer.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ body, canvas, #padding {
background: black;
}

html, body {
display: table;
height: 100%;
width: 100%;
text-align:center;
}

.textLayer {
position: absolute;
left: 0;
Expand Down Expand Up @@ -69,14 +76,9 @@ body, canvas, #padding {
top: 0px;
}

#content {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;

width: 100%;
height: 100%;
#content-wrapper {
display: flex;
justify-content: center; /* center horizontally */
align-items: center;
height: 100%;
}
4 changes: 3 additions & 1 deletion app/src/main/assets/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
</head>
<body>
<div id="padding"></div>
<canvas id="content"></canvas>
<div id="content-wrapper">
<canvas id="content"></canvas>
</div>
<div id="text" class="textLayer"></div>
<script src="viewer.js"></script>
</body>
Expand Down

0 comments on commit 6895dfd

Please sign in to comment.