【问题标题】:Custom style in Jupyter LabJupyter Lab 中的自定义样式
【发布时间】:2018-05-30 09:14:26
【问题描述】:

我使用以下几行来更改降价单元格的样式

from IPython.core.display import HTML
with open( './custom.css', 'r' ) as f: style = f.read()
HTML( style )

文件custom.css 包含这些行

<style>
   div.text_cell_render {font-family: "Times New Roman", Times, serif;}
</style>

这在jupyter-notebook 中按预期工作(它更改了markdown 的默认字体),但在jupyter-lab 中没有效果。

我该怎么做?

【问题讨论】:

    标签: python css jupyter-notebook jupyter-lab


    【解决方案1】:

    JupyterLab 使用的 CSS 类集与 jupyter-notebook 不同。

    要使用jp-MarkdownOutput 类来定位降价单元格,例如:

    <style>
       div.jp-MarkdownOutput {font-family: "Times New Roman", Times, serif;}
    </style>
    

    您可以在 the documentation 中阅读有关 JupyterLab 中 CSS 的更多信息。

    【讨论】:

      猜你喜欢
      • 2020-11-13
      • 1970-01-01
      • 2023-03-31
      • 2019-03-15
      • 2017-08-01
      • 2020-04-18
      • 1970-01-01
      • 1970-01-01
      • 2019-03-06
      相关资源
      最近更新 更多