I would like to create a webpage with a section that scrolls horizontally using flexbox. However, the code results in each box being reduced in size to fit the screen, rather than overflowing and enabling for horizontal scrolling.
Code:
.main {
flex-direction: row;
-webkit-flex-direction: row;
overflow: scroll;
width: 100%;
height: 100vh;
}
.portfolio_item {
width: 50%;
}
.flex {
display: flex !important;
display: -webkit-flex !important;
}
<div class="main flex">
<div class="portfolio_item willow">
<a class="link" href="https://aubergewillowinn.com/">
<div class="filter flex">
<h3 class="portfolio_item-text">Willow Inn</h3>
</div>
</a>
</div>
<div class="portfolio_item bellevue">
<a class="link" href="http://www.bellevuemtl.com/">
<div class="filter flex">
<h3 class="portfolio_item-text">Bellevue Condominiums</h3>
</div>
</a>
</div>
<div class="portfolio_item willow">
<a class="link" href="https://aubergewillowinn.com/">
<div class="filter flex">
<h3 class="portfolio_item-text">Willow Inn</h3>
</div>
</a>
</div>
<div class="portfolio_item bellevue">
<a class="link" href="http://www.bellevuemtl.com/">
<div class="filter flex">
<h3 class="portfolio_item-text">Bellevue Condominiums</h3>
</div>
</a>
</div>
</div>
.mainto100%, you can go higher than that, try a value like 200% or 250%