gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 17:07:26 27 4
gpt4 key购买 nike

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

~忽略~它不会让我提交,因为主要是代码,所以我必须添加更多的写作......它不会让我提交,因为主要是代码,所以我必须添加更多的写作......它不会让我提交,因为主要是代码,所以我必须添加更多的写作......它不会让我提交,因为主要是代码,所以我必须添加更多的写作......它不会让我提交,因为主要是代码,所以我必须添加更多的写作......它不会让我提交,因为主要是代码,所以我必须添加更多的写作......~忽略结束~

#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 */
}
<!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>

最佳答案

你试过 CSS calc()

height: calc(100% - 5px)

关于css - 如何使整个屏幕减去 x 像素的 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50975983/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com