【发布时间】:2021-01-21 19:12:32
【问题描述】:
当你申请overflow-x: hidden时,
它会一直滚动到LEFT并隐藏溢出到RIGHT的所有内容,
我想要相反的行为:
它会一直滚动到RIGHT并隐藏溢出到LEFT的所有内容,
所以它看起来像:(当然滚动条不应该是可见的)
此外,当overflow 未被触发时,自然“流”不应受到影响。这些项目仍应从左侧开始,如下所示:
这里是参考代码:
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>
请注意,我们处理的是<ol> 元素,而不是文本,因此direction: rtl 将不起作用。因此,为什么这个问题不同于:Overflow to left instead of right
【问题讨论】:
-
我不明白 :D 你能解释一下你想要达到的目标吗?