I have read a lot of answers and tried a lot of code about how to hide a scrollbar in a div, but the answers are almost always for divs with a fixed size, for which the solution is to just hide the scroll bar in a wrapper div, and then in the working div to just move (hide) the scroll bar off screen. But for this to work you have to know the size of the div, and all my divs are calculated using width:%.
Can someone give me an idea how to hide the scroll bar in the div showing with css, seeing that I am using Angular2 framework and do not want to include javascript/jquery in it.
HTML:
<div id="boks3">
* <br>
* <br>
* <br>
* <br>
* <br>
* <br>
* <br>
* <br>
* <br>
* <br>
* <br>
</div>
<div id="stack1">
<div id="boks1">
</div>
<div id="boks5">
</div>
</div>
<div id="stack2">
<div id="boks2">
</div>
<div id="boks4">
</div>
</div>
CSS:
#stack1 {
position: absolute;
width: 100%;
height: 100px;
background-color: #000000;
}
#boks3,
#boks1,
#boks2,
#boks4,
#boks5 {
background-color: #ff3333;
width: 32%;
position: absolute;
margin-left: 33.5%;
padding: 0px 0px 0px 5px;
z-index: 3;
height: 100px;
text-align: left;
overflow: auto;
}
#boks1 {
background-color: #ff6666;
margin-left: 2%;
z-index: 1;
height: 100px;
}
#boks2 {
background-color: #ff4d4d;
margin-left: 17%;
z-index: 2;
height: 100px;
}
#boks5 {
background-color: #ff0000;
margin-left: 65%;
z-index: 1;
text-align: right;
height: 100px;
}
#boks4 {
background-color: #ff1a1a;
margin-left: 50%;
z-index: 2;
text-align: right;
height: 100px;
}
#stack1:hover #boks1,
#stack1:hover #boks5 {
background-color: yellow;
z-index: 4;
}
#stack2:hover #boks2,
#stack2:hover #boks4 {
background-color: green;
z-index: 4;
}
Also the position: absolute; makes it different from the other similar questions that have been asked I feel. At the moment I can hide the scroll bar, but when I resize the browser window you can see parts of it sticking out.