【问题标题】:How to prevent line breaks on reveal.js at headline如何防止在标题上的reveal.js换行
【发布时间】:2014-03-13 19:17:48
【问题描述】:

我目前正在使用reveal.js 破解一些幻灯片,想知道如何防止标题中的单词出现换行符?也许我只是错过了文档的一部分,但没有任何线索。

例如拥有<h1>Some reallongword</h1><h1>Some reall \n ongword</h1> 结束

更新:我在标题等中添加了手册 <br>。不确定这是否是最佳解决方案,但似乎至少可以工作。

【问题讨论】:

    标签: html reveal.js


    【解决方案1】:

    晚了一个月,但发布以供参考。

    /css/reveal.css 在第 70 行有这个

    .reveal h1,
    .reveal h2,
    .reveal h3,
    .reveal h4,
    .reveal h5,
    .reveal h6 {
        -webkit-hyphens: auto;
           -moz-hyphens: auto;
                hyphens: auto;
    
        word-wrap: break-word;
        line-height: 1;
    }
    

    您可以将其更改为

    -webkit-hyphens: manual;
       -moz-hyphens: manual;
            hyphens: manual;
    
    word-wrap: normal;
    

    或将更改嵌入 index.html 本身。

    <style type="text/css">
            .reveal h1,
            .reveal h2,
            .reveal h3,
            .reveal h4,
            .reveal h5,
            .reveal h6 {
                word-wrap: normal;
                -webkit-hyphens: manual;
                -moz-hyphens: manual;
                hyphens: manual;
            }
        </style>
    

    在 Firefox 和 Chromium 中测试。不过不确定它是否可以在自定义主题中使用。

    编辑:哎呀,错字了。

    【讨论】:

    • 它在自定义主题中工作,并且在那里(或在演示文稿的
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-02
    • 1970-01-01
    • 2018-03-25
    相关资源
    最近更新 更多