Modern Flat Iframe - MeggiTools
Run
Toggle Theme
Share Link
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Modern Flat Iframe</title> <style> body { font-family: 'Arial', sans-serif; background: #f5f5f5; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } .iframe-container { position: relative; width: 80%; height: 70%; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 10px 15px rgba(0,0,0,0.1); transition: box-shadow 0.3s ease; } .iframe-container:hover { box-shadow: 0 15px 25px rgba(0,0,0,0.2); } .iframe-title { position: absolute; top: 10px; left: 20px; background: #6200ea; color: #fff; padding: 5px 10px; border-radius: 5px; font-size: 1.2em; } iframe { width: 100%; height: 100%; border: none; border-radius: 10px; } .button-container { position: absolute; bottom: 10px; right: 10px; display: flex; gap: 10px; } .iframe-button { background: #6200ea; color: #fff; border: none; padding: 8px 16px; border-radius: 5px; cursor: pointer; font-size: 0.9em; transition: background 0.3s ease; } .iframe-button:hover { background: #3700b3; } </style> </head> <body> <div class="iframe-container"> <div class="iframe-title">Modern Flat Iframe</div> <iframe src="https://www.example.com" title="Example Iframe"></iframe> <div class="button-container"> <button class="iframe-button" onclick="refreshIframe()">Refresh</button> <button class="iframe-button" onclick="fullscreenIframe()">Fullscreen</button> </div> </div> <script> function refreshIframe() { document.querySelector('iframe').src += ''; } function fullscreenIframe() { const iframe = document.querySelector('iframe'); if (iframe.requestFullscreen) { iframe.requestFullscreen(); } else if (iframe.mozRequestFullScreen) { // Firefox iframe.mozRequestFullScreen(); } else if (iframe.webkitRequestFullscreen) { // Chrome, Safari and Opera iframe.webkitRequestFullscreen(); } else if (iframe.msRequestFullscreen) { // IE/Edge iframe.msRequestFullscreen(); } } </script> </body> </html>