Code
Flux
主页
粘贴
复制
下载
格式化
运行
index.html
UTF-8
基本示例
交互示例
1
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>示例页面</title> <style> body { font-family: 'Arial', sans-serif; line-height: 1.6; margin: 0; padding: 20px; background-color: #f5f5f5; color: #333; } .container { max-width: 800px; margin: 0 auto; background-color: white; padding: 30px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); } h1 { color: #2c3e50; text-align: center; margin-bottom: 20px; } button { display: block; margin: 20px auto; padding: 10px 20px; background-color: #3498db; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 16px; transition: background-color 0.3s; } button:hover { background-color: #2980b9; } .card { background-color: #f9f9f9; border: 1px solid #e0e0e0; border-radius: 8px; padding: 20px; margin: 20px 0; } </style> </head> <body> <div class="container"> <h1>HTML代码运行示例</h1> <p>这是一个示例页面,展示如何在浏览器中运行HTML代码。</p> <div class="card"> <h2>功能特点</h2> <ul> <li>支持内联CSS样式</li> <li>支持内联JavaScript</li> <li>实时预览效果</li> </ul> </div> <button onclick="showMessage()">点击我</button> <script> function showMessage() { alert('Hello, World!'); } </script> </div> </body> </html>
Preview