这个问题在这里已有答案:
我想这样做#nav和#contenido填充所有剩余的屏幕,
我的身体
<header>
<?php include "includes/header.php"; ?>
</header>
<aside id="nav">
<?php include("includes/nav.php") ?>
</aside>
<div id="contenido">
<?php include("pages/pages.php"); ?>
</div>
<footer class="centradohorizontal centradovertical">
<?php include "includes/footer.php"; ?>
</footer>
在header.php有一个简单的标题,也在footer.php
我的css :(我已从页眉和页脚中删除了CSS)
body {
display: grid;
grid-template-columns: 1fr 4fr;
grid-template-rows: auto 1fr auto;
grid-template-areas: "head head" "navegacion contenido" "foot foot";
color: #333 !important
}
header {
grid-area: head
}
#nav {
grid-area: navegacion;
background-color: #eb322a !important;
height: 100%
}
#contenido {
grid-area: contenido;
height: 100%
}
.centradovertical {
display: flex;
align-items: center
}
.centradohorizontal {
display: flex;
justify-content: center
}
我的问题是四舍五入:
qazxsw poi我想这样做,红色div扩大100%,但我把高度100%,它不起作用