<!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>write</title> <style> body { background-color: #EEE; margin: 0; font-size: 16px; font-family: Charter, 'Bitstream Charter', 'Sitka Text', Cambria, serif; font-weight: normal; overflow: hidden; } textarea { box-sizing: border-box; width: 100%; height: 100vh; font-size: 1.5em; border: none; margin: 0; padding: 1em max(calc(50vw - 15em), 1em); font-family: inherit; overflow: scroll; color: #333; resize: none; } textarea:focus { outline: none; } button { position: absolute; right: 0; bottom: 0; } body:fullscreen button { display: none; } @media print { button { display: none; } } </style> </head> <body> <textarea autofocus placeholder="Start typing..."></textarea> <button>go fullscreen</button> <script> document.querySelector('button').addEventListener('click', () => { if (!document.fullscreenElement) { document.body.requestFullscreen(); } }); </script> </body> </html>