Laravel  
laravel
文档
数据库
架构
入门
php技术
    
Laravelphp
laravel / php / java / vue / mysql / linux / python / javascript / html / css / c++ / c#

html5 app

作者:故事没有她   发布日期:2025-08-22   浏览:89

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>HTML5 App Example</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background-color: #f0f0f0;
        }
        .app-container {
            background-color: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            text-align: center;
        }
        button {
            padding: 10px 20px;
            font-size: 16px;
            cursor: pointer;
        }
    </style>
</head>
<body>
    <div class="app-container">
        <h1>HTML5 App</h1>
        <p>This is a simple HTML5 app example.</p>
        <button onclick="showMessage()">Click Me</button>
    </div>

    <script>
        function showMessage() {
            alert('Hello from HTML5 App!');
        }
    </script>
</body>
</html>

解释说明

  1. HTML 结构:

    • <!DOCTYPE html>: 声明文档类型为 HTML5。
    • <html lang="en">: 设置页面语言为英语。
    • <meta charset="UTF-8">: 设置字符编码为 UTF-8。
    • <meta name="viewport" content="width=device-width, initial-scale=1.0">: 确保页面在移动设备上正确显示。
    • <title>: 设置页面标题。
    • <style>: 内联样式,用于美化页面。
    • <div class="app-container">: 包含应用的主要内容。
    • <button onclick="showMessage()">: 按钮点击时调用 JavaScript 函数。
  2. CSS 样式:

    • 使用简单的 CSS 来居中布局并美化页面元素。
  3. JavaScript:

    • function showMessage(): 定义一个简单的 JavaScript 函数,在用户点击按钮时弹出提示框。

上一篇:html怎么插入图片

下一篇:html a标签打开新窗口

大家都在看

静态html源码

404 html

ios打开html

colspan在html中是什么意思

xml转html

html时间代码

html2canvas使用

html标题标签是什么

html 换行符号

html中b标签的作用

Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3

Laravel 中文站