我正在尝试为我的reveal.js 演示文稿制作一个标题,使其粘贴在屏幕顶部。标题中的内容在每张幻灯片的基础上都是动态的,因此我必须将标记放置在部分标记内。
显然,如果标记位于部分标记内,position:fixed 并不能真正在 Reveal.js 中提供令人满意的结果。我无法真正弄清楚为什么会这样,但我在 github 存储库中找到了一些信息,建议设置演示文稿大小以适应视口大小:
Reveal.initialize {
...
width: '100%',
height: '100%',
...
}
但它对我来说仍然不起作用 - 看起来演示文稿并没有真正受到上述影响。这是一个演示:
https://dl.dropboxusercontent.com/u/706446/_linked%20stuff/reveal.js/index.html https://dl.dropboxusercontent.com/u/706446/_linked%20stuff/reveal.js/index.html
有什么想法如何解决这个问题吗?
将其添加到 css 中:
.reveal.slide .slides > section, .reveal.slide .slides > section > section {
min-height: 100% !important;
display: flex !important;
flex-direction: column !important;
justify-content: center !important;
position: absolute !important;
top: 0 !important;
align-items: center !important;
}
section > h1, section > h2 {
position: absolute !important;
top: 0 !important;
margin-left: auto !important;
margin-right: auto !important;
left: 0 !important;
right: 0 !important;
text-align: center !important;
}
.print-pdf .reveal.slide .slides > section, .print-pdf .reveal.slide .slides > section > section {
min-height: 770px !important;
position: relative !important;
}
- Demo https://rawgit.com/rofrol/reveal.js/fixed_header/ https://rawgit.com/rofrol/reveal.js/fixed_header/
- Code https://github.com/rofrol/reveal.js/blob/fixed_header/index.html#L411 https://github.com/rofrol/reveal.js/blob/fixed_header/index.html#L411
- 讨论https://github.com/hakimel/reveal.js/issues/1312 https://github.com/hakimel/reveal.js/issues/1312 https://github.com/hakimel/reveal.js/issues/180 https://github.com/hakimel/reveal.js/issues/180
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)