HTML/CSS 在线运行工具
快速测试代码逻辑与视觉呈现,无需本地环境
HTML 代码
<!DOCTYPE html> <html> <head> <title>测试页面</title> <style> body { font-family: Arial, sans-serif; background: linear-gradient(to right, #ff9966, #ff5e62); margin: 0; padding: 20px; display: flex; justify-content: center; align-items: center; min-height: 100vh; } .container { text-align: center; background: white; padding: 40px; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); max-width: 600px; } h1 { color: #2c3e50; margin-bottom: 30px; } .btn { background: linear-gradient(to right, #3498db, #2c3e50); color: white; border: none; padding: 15px 40px; border-radius: 30px; cursor: pointer; font-size: 18px; transition: all 0.3s; } .btn:hover { transform: scale(1.05); box-shadow: 0 5px 15px rgba(0,0,0,0.2); } </style> </head> <body> <div class="container"> <h1>欢迎使用在线代码运行工具</h1> <p>这是一个即时预览的HTML/CSS运行环境</p> <button class="btn">点击测试</button> </div> </body> </html>
CSS 代码
/* 自定义样式 */ body { background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d); } .container { border: 2px solid #3498db; } button { background: linear-gradient(to right, #8e2de2, #4a00e0); }
代码预览
运行代码
重置代码