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.
我在 div 元素之后的运行时放置了一个标签。使用 z-index 放置它,但标签的位置似乎是固定的,即使我提到的是绝对的。当我滚动它时它正在移动。有人可以建议吗?
$("#button").after($('<span id=label> Testing </span>')) CSS: #label { position:absolute; top:20px; left:200px; Z-index:1; }
根据 W3C:
该absolute位置是“相对于盒子的包含块”,这意味着它随其容器滚动。所以如果我有
absolute
<body> ... <p style="position: absolute">STUFF!</p> ... </body>
然后它将相对于 滚动body。
body
该fixed位置“相对于视口滚动,滚动时不会移动”。它相对于视口或浏览器窗口滚动。所以如果我有
fixed
<body> ... <p style="position: fixed">STUFF!</p> ... </body>
然后当我滚动时,相对于我的浏览器窗口,文本将保持不变。
我有以下情况
/drug 下的所有内容都是安全的我不希望用户能够查看 /drug 下的任何内容,所以我在我的 spring 安全配置中有这个规则。
<intercept-url pattern="/drug/**" access="hasRole('ROLE_