【问题标题】:reveal.js produces blank pagereveal.js 产生空白页
【发布时间】:2017-07-06 14:37:09
【问题描述】:

我在让reveal.js 工作时遇到了一些问题。由于instructions 并没有真正说明将文件放在哪里或给它们命名(这很明显吗?),我什至无法让指令页面上的示例代码正常工作:

<html>
    <head>
        <link rel="stylesheet" href="css/reveal.css">
        <link rel="stylesheet" href="css/theme/white.css">
    </head>
    <body>
        <div class="reveal">
            <div class="slides">
                <section>Slide 1</section>
                <section>Slide 2</section>
            </div>
        </div>
        <script src="js/reveal.js"></script>
        <script>
            Reveal.initialize();
        </script>
    </body>
</html>

我已将此代码放入名为test.html 的文件中,并将reveal.js 存储库中的css 文件夹复制到与test.html 相同的文件夹中。

当我在 Firefox 或 IE 中打开 test.html 时,我只是得到一个完全白色的网页,上面没有任何内容,当我按下箭头键时没有任何反应。如果我将"css/theme/white.css" 更改为其他主题,我会设法更改页面的背景颜色,但我仍然没有得到任何内容。

我做错了什么?

【问题讨论】:

    标签: html css reveal.js


    【解决方案1】:

    我意识到除了引用css文件夹中的文件外,代码还引用了js文件夹中的文件。因此,我还需要将reveal.js存储库中的js文件夹复制到与test.html相同的文件夹中。

    或者,我可以更改引用,这样我就有了

            <link rel="stylesheet" href="<path-to-reveal.js>/css/reveal.css">
            <link rel="stylesheet" href="<path-to-reveal.js>/css/theme/white.css">
    

            <script src="<path-to-reveal.js>/js/reveal.js"></script>
    

    test.html.

    【讨论】:

      猜你喜欢
      • 2018-01-07
      • 2015-11-18
      • 2020-08-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-24
      相关资源
      最近更新 更多