0
点赞
收藏
分享

微信扫一扫

动态内容加载

code_balance 2024-10-10 阅读 16

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Dynamic Content Loading</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            background-color: #f0f2f5;
        }
        .container {
            max-width: 600px;
            margin: 50px auto;
            padding: 20px;
            background-color: white;
            border-radius: 8px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            text-align: center;
        }
        .content {
            display: none;
            margin: 20px 0;
            padding: 20px;
            background-color: #e9ecef;
            border-radius: 5px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>Dynamic Content Loading</h1>
        <button onclick="loadContent()">Load Content</button>
        <div id="content" class="content">
            <h2>Loaded Content</h2>
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
        </div>
    </div>

    <script>
        function loadContent() {
            document.getElementById('content').style.display = 'block';
        }
    </script>
</body>
</html>

举报

相关推荐

0 条评论