For a while, I am trying to implement this where an anchor tag is inside a flex box container having flex-wrap: nowrap
and overflow:auto
now this works in google chrome but it doesn't work in safari for smaller screen sizes as well as Iphone. Following is the code
<html>
<head>
</head>
<style>
.flex-div {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-flex-wrap: nowrap;
-ms-flex-wrap: nowrap;
flex-wrap: nowrap;
overflow-x: auto;
}
.flex-div a {
display: inline-block;
white-space: nowrap;
margin-left: 10px;
margin-right: 10px;
}
</style>
<body>
<div class="flex-div">
<a>Modern & contemporary</a>
<a>Modern & contemporary</a>
<a>Modern & contemporary</a>
<a>Modern & contemporary</a>
<a>Modern & contemporary</a>
<a>Modern & contemporary</a>
<a>Modern & contemporary</a>
<a>Modern & contemporary</a>
<a>Modern & contemporary</a>
<a>Modern & contemporary</a>
<a>Modern & contemporary</a>
<a>Modern & contemporary</a>
</div>
</body>
Try this.. Also I've removed unused css.
.flex-div {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: horizontal;
overflow-x: auto;
}
.flex-div a {
white-space: nowrap;
margin-left: 10px;
margin-right: 10px;
-ms-flex: none;
-webkit-flex: none;
flex: none;
}
<div class="flex-div">
<a>Modern & contemporary</a>
<a>Modern & contemporary</a>
<a>Modern & contemporary</a>
<a>Modern & contemporary</a>
<a>Modern & contemporary</a>
<a>Modern & contemporary</a>
<a>Modern & contemporary</a>
<a>Modern & contemporary</a>
<a>Modern & contemporary</a>
<a>Modern & contemporary</a>
<a>Modern & contemporary</a>
<a>Modern & contemporary</a>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With