[英]Bootstrap 4 .sticky-top changes to thead
since a few days .sticky-top class does not work anymore on thead tags.因为几天后 .sticky-top 类不再适用于 thead 标签。 Last Week it just worked perfectly, now I came back and tried few things on my App and it stopped working.上周它运行得很好,现在我回来并在我的应用程序上尝试了一些东西,但它停止了工作。 Anyone got an idea why?有人知道为什么吗?
<thead class="sticky-top>
...
<thead>
That just worked perfectly.那只是完美地工作。 Now I cannot use it anymore.现在我不能再使用它了。 I tested it with just divs and for divs its still working, but I get an electron-dom error that I cannot spawn a div as a child of an table and i cannot spawn thead/th as child of a div.我只用 div 对其进行了测试,对于 div,它仍然可以工作,但是我收到一个电子 dom 错误,即我无法将 div 生成为表的子项,也无法将 thead/th 生成为 div 的子项。
Cheers, Puschek干杯,普舍克
For everyone that is interessted in this problem:对于对这个问题感兴趣的每个人:
Somehow you cannot sticky-top directly on thead (I just wonder why it worked 1 week ago...) so you have to stick the elements to your <thead>
.不知何故,你不能直接粘在顶部(我只是想知道为什么它在 1 周前有效......)所以你必须将元素粘在你的<thead>
。 So just give every single <th>
the .sticky-top
class and it works without any problems.所以只要给每个<th>
.sticky-top
类,它就可以毫无问题地工作。
Greetings问候
Position an element at the top of the viewport, from edge to edge, but only after you scroll past it.将元素从边缘到边缘放置在视口的顶部,但只能在滚动经过它之后。 The .sticky-top
utility uses CSS's position: sticky
, which isn't fully supported in all browsers. .sticky-top
实用程序使用 CSS 的position: sticky
,并非所有浏览器都完全支持它。
Microsoft Edge and IE11 will render position: sticky
as position: relative
. Microsoft Edge 和 IE11 将呈现position: sticky
为position: relative
。 As such, we wrap the styles in a @supports
query, limiting the stickiness to only browsers that properly can render it.因此,我们将样式包装在@supports
查询中,将粘性限制为仅能正确呈现它的浏览器。
<div class="sticky-top">...</div>
Learn more about it了解更多
https://getbootstrap.com/docs/4.0/utilities/position/#sticky-top https://getbootstrap.com/docs/4.0/utilities/position/#sticky-top
cheers i had the same issue欢呼我有同样的问题
check: Few stuff to corrected检查:需要纠正的东西很少
http://blog.cloud66.com/position-sticky-problem/ . http://blog.cloud66.com/position-sticky-problem/ 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.