如何使整个屏幕的div减去x像素

Hac*_*man 1 css

底部的导航栏是一组像素.如何使chart1(红色背景)覆盖导航栏上方的所有内容.现在它说95%的高度,但在更大的屏幕上,导航栏小于5%,小于大于.谢谢您的帮助!

〜IGNORE~它不会让我提交,因为大多数代码所以我必须添加更多的写作...它不会让我提交,因为大多数代码所以我必须添加更多的写作......它不会让我提交的主要是代码,所以我必须添加更多的写作...它不会让我提交因为大部分代码所以我必须添加更多的写作...它不会让我提交,因为大多数代码所以我必须添加更多的写作...它不会让我提交,因为大多数代码所以我必须添加更多的写作... ~IGNORE END~

#chart1 {
    background-color:red;
    /* Height and width fallback for older browsers. */
    height: 95%;
    width: 100%;

    /* Set the height to match that of the viewport. */
    height: 95vh;

    /* Set the width to match that of the viewport. */
    width: 100vw;

    /* Remove any browser-default margins. */
    margin: 0;
    
}

.sideButton {
    position: absolute !important;
    z-index: 10 !important;
    transform-origin: bottom left;
    transform:rotate(7deg);
            -ms-transform:rotate(90deg); /* IE 9 */
            -moz-transform:rotate(90deg); /* Firefox */
            -webkit-transform:rotate(90deg); /* Safari and Chrome */
            -o-transform:rotate(90deg); /* Opera */
}
   
Run Code Online (Sandbox Code Playgroud)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <!-- Required meta tags -->
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

        <!-- Bootstrap CSS -->
        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
       
        
</head>
        <title>Stock Data - Highcharts</title>   
    </head>
    <body>
        <nav class="navbar fixed-bottom navbar-light bg-light compressed">
            <div class="navbar-brand">Control Panel</div>

            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse border-left" id="navbarSupportedContent">
                
            </div>
        </nav>
        
        <!-- Calls the chart -->
            
        <div id="chart1"></div>
        
        <!-- jQuery: for CSV import and other calls -->
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
        
       
   
        <!-- Bootstrap for the control panel -->
        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
        
        <!-- All the custom js for this page -->
        <script type="text/javascript" src="official_stock_chart.js"></script>  
        
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

Bri*_*per 5

你试过CSS calc()吗?

height: calc(100% - 5px)
Run Code Online (Sandbox Code Playgroud)