Last active
July 15, 2016 14:04
-
-
Save bclinkinbeard/c45ef0f77687756ac8f17ea8db992f74 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Document</title> | |
| <style> | |
| body { | |
| margin: 0; | |
| } | |
| div { | |
| display: flex; | |
| justify-content: center; | |
| align-items: center; | |
| width: 100%; | |
| height: 100vh; | |
| background-color: lightgreen; | |
| border: 5px solid darkolivegreen; | |
| box-sizing: border-box; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div> | |
| <h1>Hello</h1> | |
| </div> | |
| <script> | |
| function handleResize () { | |
| document | |
| .querySelector('h1') | |
| .textContent = window.innerWidth + 'x' + window.innerHeight; | |
| } | |
| window.onresize = handleResize; | |
| handleResize(); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment