导航栏下的 div 宽度为 100% 显示滚动条

嘿伙计们,我希望你们一切都好,所以我正在制作一个页面。主要有一个导航栏,在导航栏下面有一个引导网格和一个页脚..所以我想显示页面,因为导航栏和页脚之间的网格覆盖了em之间的空间,为此我使用了行的宽度100%,但是它似乎不起作用。这是我的代码。因此它成为每个设备的单个页面。没有滚动条


索引.php


<html>

<head>

    <title></title>

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">

    <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>

<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>

<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>

<script src="https://kit.fontawesome.com/a076d05399.js"></script>

<link rel="stylesheet" href="path/to/font-awesome/css/font-awesome.min.css">

<link rel="stylesheet" type="text/css" href="css/main.css">

</head>

<body>

    <!-- NAVBAR -->

            <nav class="navbar navbar-light main_nav">

                <i class="fas fa-bars"></i>

                <div class="logo mr-auto">

                    <img class="navbar-brand" src="images/michatroom.png" width="150">

                </div>

            </nav>

    <!-- NAVBAR END -->


    <div class="container-fluid">

        <div class="row my_row">

            <div class="col-md-2">

                www

            </div>

            <div class="col-md-8">

                www

            </div>

            <div class="col-md-2">

                www

            </div>

        </div>

    </div>


慕斯王
浏览 123回答 1
1回答

MMMHUHU

只需将overflow:hidden添加到css的body中body{overflow:hidden;}* { margin:0; padding:0; }.main_nav {&nbsp; &nbsp; background: #006080;}.logo {&nbsp; &nbsp; margin-left: 10px;}.my_row > div {&nbsp; &nbsp; border: 1px solid black;}.my_row {&nbsp; &nbsp; height: 100%;}<html><head>&nbsp; &nbsp; <title></title>&nbsp; &nbsp; <meta name="viewport" content="width=device-width, initial-scale=1.0">&nbsp; &nbsp; <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">&nbsp; &nbsp; <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script><script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script><script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script><script src="https://kit.fontawesome.com/a076d05399.js"></script><link rel="stylesheet" href="path/to/font-awesome/css/font-awesome.min.css"><link rel="stylesheet" type="text/css" href="css/main.css"></head><body>&nbsp; &nbsp; <!-- NAVBAR -->&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <nav class="navbar navbar-light main_nav">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <i class="fas fa-bars"></i>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <div class="logo mr-auto">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <img class="navbar-brand" src="images/michatroom.png" >&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </nav>&nbsp; &nbsp; <!-- NAVBAR END -->&nbsp; &nbsp; <div class="container-fluid">&nbsp; &nbsp; &nbsp; &nbsp; <div class="row my_row">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <div class="col-md-2" style='width:20%'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; www&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <div class="col-md-8" style='width:60%'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; www&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <div class="col-md-2" style='width:20%'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; www&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>&nbsp; &nbsp; &nbsp; &nbsp; </div>&nbsp; &nbsp; </div>&nbsp; &nbsp; <nav class="navbar navbar-bottom navbar-light bg-faded">&nbsp; <a class="navbar-brand" href="#">Fixed bottom</a></nav></body></html>
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Html5