J'essaie de faire une div avec un height: calc(100% - 80px)
et un overflow: scroll
. La div ignore complètement ces deux règles. Voici ce que j'ai essayé:Div ignorer les propriétés de hauteur et de débordement
.tab-content {
clear: both;
height: calc(100% - 80px);
overflow: auto;
}
#tutorial {
padding: 5%;
}
Tutorial
<div id="tutorial" class="tab-content">
Tutorial content
<br> Tutorial content
<br> Tutorial content
<br> Tutorial content
<br> Tutorial content
<br> Tutorial content
<br> Tutorial content
<br> Tutorial content
<br> Tutorial content
<br> Tutorial content
<br> Tutorial content
<br> Tutorial content
<br> Tutorial content
<br> Tutorial content
<br> Tutorial content
<br> Tutorial content
<br> Tutorial content
<br> Tutorial content
<br> Tutorial content
<br> Tutorial content
<br> Tutorial content
<br> Tutorial content
<br> Tutorial content
<br> Tutorial content
<br> Tutorial content
<br> Tutorial content
<br> Tutorial content
<br> Tutorial content
</div>
S'il vous plaît me alerter où je me trompe et comment résoudre le problème.
'calc (100% - 80px);' il n'y aura pas de débordement, comment pourriez-vous faire défiler? –
@DanielH le contenu pourrait déborder la div, c'est alors qu'il y aurait défilement. –
cela fonctionne déjà? https://jsfiddle.net/dalinhuang/h6Lam4rr/ –