【发布时间】:2021-12-31 15:33:13
【问题描述】:
我正在使用 Bootstrap 5 并尝试在屏幕上显示日历;但是高度比屏幕高度长约 25%。如何让容器高度适合屏幕高度。我也试过css中的“height: 100%”和“height: 80%”。
css
.sectionHeight {
height: 100vh;
width: auto;
}
html:
<div id="calendarAdmin" class="container sectionHeight" style="background-repeat: repeat; background-image: url('images/body-bg.jpg');">
<div id="includedContent"></div>
<div class="col-lg-12 col-md-12 col-sm-12 col-12 beta">
<h3>Full Callendar</h3>
<div style="text-align: center;">
<span id="ajaxGetUserServletResponse1" style="color: red; background-color: white;"></span>
</div>
<div id="loader"><img src="images/spinner.gif"/></div><!-- loading spinner -->
<div class="whiteBackground" id="calendar"></div>
</div>
</div>
【问题讨论】:
-
你有没有为 html 设置 css 规则并且 body 有 100% 的高度?
-
@AloisoGomes - 是的,如上所述,我尝试过“身高:100%”。
-
尝试删除类“容器”,它的引导规则标记为!重要,或者尝试将“h-100”添加到类
标签: html css bootstrap-5