In this example, I need to hide content horizontally with overflow-x set to hidden. However, it is also automatically adding the vertical scrollbar when I do this. I have read where setting overflow-x or overflow-y sets the other to auto, thus forcing the scrollbar to show. Is there a way around this?
<div class="div1">
<div class="div2">
</div>
<div class="div3">
</div>
</div>
div.div1 {
width: 300px;
height: 300px;
background-color: #000;
overflow-y: visible;
overflow-x: hidden;
}
div.div2 {
width: 600px;
height: 80px;
background-color: #ebebeb;
margin-top: 20px;
}
div.div3 {
width: 90px;
height: 400px;
margin-left: auto;
margin-right: auto;
background-color: #900;
}