无法更改子栏的高度

时间:2016-09-01 11:22:15

标签: html css

我尝试使用bootstrap创建2个导航栏,它们都是屏幕上的。但不知怎的,我无法更改第二个导航栏的min-heightheight

我试图将min-height值更改为40px,但它不会影响任何内容。

我当前的HTML代码如下所示:

<?php
    require_once('handling/classes/site_config_class.php');
    $site_config = new site_config_class();
?>

<!DOCTYPE html>
<html lang="en">
<head>
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width, initial-scale=1">
     <title><?php echo $site_config->site_title_home; ?></title>
     <!-- Stylesheet includes -->
     <link href="assets/css/bootstrap.min.css" rel="stylesheet">
     <link href="assets/css/stylesheet.css" rel="stylesheet">
     <!-- Core include -->
     <script src="handling/core/engine/babylon.2.4.core.js"></script>
     <!-- Core js include -->
     <script src="handling/core/js/initScene.js"></script>
</head>
<body>
    <nav class="navbar navbar-default">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="#">
                    <div class="logo"></div>
                </a>
            </div>

            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
                    <li class="navbar_active"><a href="#">DASHBOARD</a></li>
                    <li><a href="#">ENTER WORLD</a></li>
                    <li><a href="#">WARDROBE</a></li>
                    <li><a href="#">SHOPPING</a></li>
                    <li><a href="#">DESIGNER</a></li>
                    <li><a href="#">PURCHASE</a></li>
                </ul>

                <ul class="nav navbar-nav navbar-right">
                    <span class="glyphicon glyphicon-comment navbar_icons" aria-hidden="true"></span>
                    <span class="glyphicon glyphicon-bell navbar_icons" aria-hidden="true"></span>
                    <span class="glyphicon glyphicon-shopping-cart navbar_icons" aria-hidden="true"></span>
                    <span class="glyphicon glyphicon-fullscreen navbar_icons" aria-hidden="true"></span>
                    <span class="glyphicon glyphicon-log-out navbar_icons" aria-hidden="true"></span>
                </ul>
            </div>
        </div>
    </nav>
    <nav class="navbar navbar-default subnavbar">
        <div class="container-fluid">
            <ul class="nav navbar-nav">
                <li><a href="#">SHOPPING</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <li><a href="#">SHOPPING</a></li>
            </ul>
        </div>
    </nav>
    <div class="col-md-12 no_padding">
        <canvas id="screen"></canvas>
    </div>

    <!-- Javascript includes -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
    <script src="assets/js/bootstrap.min.js"></script>
</body>
</html>

我的CSS代码如下:

body {
    margin: 0px;
    width: 100%;
    height: 100%;
    background-color: #f2f2f2;
}

.logo {
    width: 101px;
    height:25px;
    background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGUAAAAZCAYAAAAonOB1AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA85pVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTMyIDc5LjE1OTI4NCwgMjAxNi8wNC8xOS0xMzoxMzo0MCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wUmlnaHRzPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvcmlnaHRzLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzE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cJJow5ZswJtEu4FgPrd0oYNG2rNeH5YWJhfOLAqNXcgsGrBtHiNzapgDFkzTZZCgiqHlWXrwIYAoZDYj2FXvGfPHg8Ha3gDVmAEew4Dzc3NdSwXWC5kwEoBkMh1zqYWxcXFLs5TnuEEE+WEUfaJZoUsY0JaCfCzHSwIWvSbAWtD7gFwMB7HKYxvBQwmR+2rdYwME8WEBUPycaKoy61g2fNVAjyX3PacseCK5cQWzyUaXYttCMyfYyqv+akuCjFWVhIwWrQV7z9sw0a9yE9ydTwacQQru2BEHOAwIaGtWLq/LczWv5QOjQKdVpMzWJIAz6HZK2nhZXTdKjHAoLjzq2Qh47B43pdRmOELqr/jeXAHZ8+erUQGL20Fd8nUFLESbBGCxHtSwtmKBBfjK8/95MIygYWJBVUDS0WaRVp8xVJvk79mEeCgxsr7IUHKbd74EvsooMJxAHLz5s1uZX8b5Rdq/0Js/zoFqGOiP67zTPZT5AJgB8QOZoAxUW3AHg89r9BkLQ6rFc1mSmhmpIJmy5tpDmUjsF/IS5bbkPBGcRrh28QRYSNCxMEhwmPMZvGJUYQ0yGfKS7RwPJLKKgFMuG4pypjflyC6nUd5V5HHBJX/SrSbNv75dEjedJN3JnWfF+H+F9Ic+VOitRbP/ZiyStr0w7N6hFLx9Ziy1GXYFuC7ryX7Zmo5FODxtwADAEmcDDJfqeMTAAAAAElFTkSuQmCC);
}

/* Navbar */

.navbar {
    min-height: 52px !important;
    line-height: 52px !important;
    background-color: #3d3d3d !important;
    border-radius: 0px !important;
    border: none !important;
    margin-bottom: 0px !important;
}

.navbar-brand {
    padding: 12px 15px !important;
}

.navbar-default .navbar-nav>li>a {
    font-family: "Segoe UI";
    font-size: 12px;
    font-style: normal;
    font-variant: normal;
    font-weight: bold;
    color: #f2f2f2 !important;
}

.navbar-default .navbar-nav>li>a:hover {
    color: #a1a1a1 !important;
}

.navbar_icons {
    color: #a8a8a8 !important;
    margin-left: 10px;
    font-size: 14px;
}

.navbar_icons:hover {
    color: #fff !important;
    cursor: pointer;
}

/* Subnavbar */

.subnavbar {
    background-color: #fff !important;
    min-height: 40px !important;
}

/* Canvas */

#screen {
    width: 100%;
    height: 500px;
}

.no_padding {
    padding: 0px !important;
}

可在此处查看网站预览:Link to site

有谁知道如何将子弹子height设置为40px?

3 个答案:

答案 0 :(得分:0)

你可以尝试给它&#34;身高&#34;以及&#34; min-height&#34;

nav.subnavbar {
     background-color: #fff !important;
     height:40px;
     min-height: 40px !important;
  }

答案 1 :(得分:0)

添加此css您的自定义CSS

.subnavbar .navbar-nav> li > a {
    padding-bottom: 10px;
    padding-top: 10px;
}

答案 2 :(得分:0)

出现这种情况是因为你有一些 .subnavbar .navbar-nav&gt;的样式。 li>一个 您应该更改此元素的填充