【发布时间】:2021-12-25 23:10:26
【问题描述】:
我正在尝试使用 html5 在文章元素中实现垂直滚动,但它没有按我的意愿工作。如果我添加
,而不是保持固定尺寸元素增加文章的高度。 我在这里发布代码和结果。
/*Especificidad 003*/
body section article {
display: grid;
grid-template-columns: auto auto auto auto auto;
grid-column-start: 1;
grid-column-end: 6;
overflow-y: scroll;
padding: 5%;
margin: 5%;
background-color: white;
border: 0.5em;
}
/*Especificidad 004*/
body section article p {
display: grid;
grid-template-columns: auto auto auto auto auto;
grid-column-start: 1;
grid-column-end: 6;
}
<section>
<h1>Calculadora RPN</h1>
<article>
<h2>Contenido de la pila</h2>
<p>Prueba</p>
<p>Prueba</p>
<p>Prueba</p>
<p>Prueba</p>
<p>Prueba</p>
<p>Prueba</p>
<p>Prueba</p>
<p>Prueba</p>
<p>Prueba</p>
<p>Prueba</p>
<p>Prueba</p>
<p>Prueba</p>
<p>Prueba</p>
<p>Prueba</p>
<p>Prueba</p>
<p>Prueba</p>
</article>
</section>
【问题讨论】: