When you apply overflow-x: hidden
,
it'll scroll you all the way to the LEFT and hide everything that overflows to the RIGHT,
like: (and of course it also hides the scrollbar, which I didn't do here.)
I want the opposite behavior:
it'll scroll you all the way to the RIGHT and hide everything that overflows to the LEFT,
so it'll look like: (again the scrollbar shouldn't be visible of course)
Also, when the overflow
isn't triggered the natural "flow" shouldn't be affected. The items should still start from the left like so:
Here is the reference code:
nav {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: stretch;
justify-content: flex-start !important;
overflow-x: shown;
ol {
flex: 1;
}
}
<!DOCTYPE html>
<html>
<head>
<body>
<nav>
<ol>
<li class="dir marked">
<a href="../../..">
LinearAlgebra
</a>
</li>
</ol>
<ol>
<li class="dir marked">
<a href="../..">
other
</a>
</li>
</ol>
<ol>
<li class="dir marked">
<a href="..">
nested
</a>
</li>
<li class="file">
<a href="../../test.html">
test
</a>
</li>
</ol>
<ol>
<li class="dir marked">
<a href="">
x2Nested
</a>
</li>
<li class="file">
<a href="../nested.html">
nested
</a>
</li>
</ol>
<ol>
<li class="file">
<a href="anotherFile.html">
anotherFile
</a>
</li>
<li class="file">
<a href="x2Nested.html">
x2Nested
</a>
</li>
</ol>
</nav>
</body>
</html>
Note we are dealing with <ol>
elements, not text, so direction: rtl
won't work. Hence why this question is different from: Overflow to left instead of right