1. 主页
  2. 文档
  3. 移动端屏幕适配
  4. 简单适配应用

简单适配应用

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <title>2.3 简单适配应用</title>
    <style>
        * {
            box-sizing: border-box;
            padding: 0;
            margin: 0;
        }

        .header-container {
            height: 2.5rem;
            background-color: rgba(222, 24, 27, 0.9);
        }

        .main-container {
            padding: 2.5rem 0;
            background-color: #eee;
        }

        .slider-container {
            height: 9.15rem;
            background-color: green;
        }

        .nav-container {
            height: 8.475rem;
            background-color: blue;
        }

        .recommend-container {
            height: 50.0rem;
            background-color: pink;
        }

        .tabbar-container {
            height: 2.5rem;
            background-color: #fff;
        }

        html, body {
            width: 100%;
            height: 100%;
        }
        .header-container,
        .tabbar-container {
            position: fixed;
            left: 0;
            z-index: 1000;
            width: 100%;
        }
        .header-container {
            top: 0;
        }
        .tabbar-container {
            bottom: 0;
        }
    </style>
    <script src="js/simple.js"></script>
</head>
<body>
    
    <header class="header-container"></header>

    <div class="main-container">
        <div class="slider-container"></div>

        <nav class="nav-container"></nav>

        <div class="recommend-container"></div>
    </div>

    <div class="tabbar-container"></div>
</body>
</html>
这篇文章对您有用吗?

我们要如何帮助您?