Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在 CSS 中将元素定位为“固定”。当我这样做时,它会将其从流程中取出,所有流入的内容都会被掩盖,并与我的“固定”元素重叠。
为了解决这个问题,我一直在放置一个与流入的固定元素相同大小的虚拟元素。使用相对定位和偏移流入元素只会导致更多问题和更多调整,我已经学会避免这样做。
有没有更优雅的方法来完成防止重叠,也许使用 CSS 属性?