I somehow lost track of what I am doing wrong here:
I got a simple content
<div>
.it has a
height
of100% - 30px
and amargin-top
of30px
, ...so together they add up to100%
of the parent elements height.the parent element is the body with
height
set to100vh
. No margins, no paddings.However I do still get a y-scroll bar on the right. Can anyone explain to me, why that is?
I put a minimal example here to show what I mean: https://jsfiddle.net/kemo8npa/4/
Can someone explain to me, why i get the scrollbar?
html {
margin: 0;
padding: 0;
}
body {
height: 100vh;
margin: 0;
padding: 0;
background-color: purple;
}
.content {
height: calc(100% - 30px);
margin-top: 30px;
background-color: blue;
width: 300px;
}
<div class="content">
content
</div>
edit: changed example to be more minimal.