Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
489 views
in Technique[技术] by (71.8m points)

移动端布局,底部的div被挤下去,麻烦帮看看

上代码

<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<head>
    <meta charset="UTF-8">
    <title>1</title>
    <style>
        * {
            margin: 0px;
            padding: 0px;
        }
        
        html {
            height: 100%;
        }
        
        body {
            min-height: 100%;
            display: flex;
            flex-direction: column;
        }
        
        .content {
            flex: 1;
        }
        
        .wp {
            height: 200px;
            background-color: pink;
        }
        
        .footer {
            position: fixed;
            bottom: 100px;
            white-space: nowrap;
            overflow-x: scroll;
            overflow-y: hidden;
            text-align: center;
            line-height: 60px;
            background-color: #DEDEDE;
            width: 100%;
            height: 60px;
        }
        
        .nav {
            display: inline-block;
            width: 200px;
            height: 60px;
            border-right-style: solid;
            border-right-width: 1px;
            border-right-color: #EEEEEE;
        }
        
        .image {
            width: 62px;
            height: 60px;
        }
    </style>
</head>

<body>
    <div class="content">
        <div class="wp">测试</div>
        <div class="wp">测试</div>
        <div class="wp">测试</div>
        <div class="wp">测试</div>
        <div class="wp">测试</div>
        <div class="wp">测试</div>
        <div class="wp">测试</div>

    </div>
    <div class="footer">
        <img src="./image/list.png" alt="" class="image">
        <div class="nav">测试模块</div>
        <div class="nav">测试模块</div>
        <div class="nav">测试模块</div>
        <div class="nav">测试模块</div>
        <div class="nav">测试模块</div>
        <div class="nav">测试模块</div>
        <div class="nav">测试模块</div>

    </div>
</body>

</html>

list.png
image

效果图
image.png

求问大神是啥情况,前端小白求大腿


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

可以给image加一个vertical-align: middle


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...