css - CSS 元素边缘为 "outside"滚动框边缘意味着什么?

标签 css js-scrollintoview

解释以下规范的正确方法是什么?

"If element edge A and element edge B are both outside scrolling box edge A and scrolling box edge B, do nothing."


来源:

https://drafts.csswg.org/cssom-view/#dom-scrolllogicalposition-nearest:~:text=If%20element%20edge%20A%20and%20element%20edge%20B%20are%20both%20outside%20scrolling%20box%20edge%20A%20and%20scrolling%20box%20edge%20B

根据this answer ,上述段落的定义应该是保持不变,如果它已经在 View 中。如果这确实是定义,那么,该段落不应该被重写为“元素边缘 A 在滚动框边缘 A 的外部,元素边缘 B 在滚动框边缘 B 的内部”吗?假设“外部”表示下方,“内部”表示上方(使用标准网络坐标系)。

CSS 规范自 2016 年以来一直采用这种形式,因此该规范应该是正确的。解释规范的正确方法应该是什么?

谢谢!

最佳答案

“外部”表示该元素对用户可见。相反,“内部”意味着该元素位于用户不可见的区域中。因此:

  • “滚动框边缘 A 外侧”= 滚动框边缘 A 下方

  • “滚动框边缘 B 外侧”= 滚动框边缘 B 上方

关于css - CSS 元素边缘为 "outside"滚动框边缘意味着什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76384627/

相关文章:

javascript - 在粘性元素上使用 scrollIntoView

python - chromedriver 版本 >74 时出现 MoveTargetOutOfBoundsException 问题

html - 变换时平移 Y 未在中间垂直对齐

jquery - 如何使 flexbox 布局的一部分变得粘性?

javascript - CSS/HTML - 使固定 div 占据屏幕的 20%,另一个可滚动

html - 如何让 element.scrollintoview 在位置 :fixed footer 下工作

javascript - 滚动到 View /滚动到顶部

css - 悬停时 html 对齐不正确

html - CSS <UL> 在 Firefox 中无法正确呈现

滚动到 View 动画