我正在尝试在ipython笔记本的markdown单元格中使用<code>标记。但是,预期的样式行为已被覆盖:

html - &lt;code&gt;标签在ipython Notebook中无法正确样式化-LMLPHP

我试过了:


重写每个here的默认custom.css:不起作用
添加一个自定义代码单元格,每个here加载一个custom.css:不起作用
在包含<style>标记的单元格中添加<code>定义:不起作用
将样式直接添加到<code>标记中:有效


有谁知道我如何防止这种风格被覆盖?

最佳答案

似乎我使用了错误的标签来定义CSS;我遵循the guide here,然后使用

.rendered_html code {
    padding:2px 4px;
    font-size: 90%;
    color: #c7254e;
    background-color: #f9f2f4;
    border-radius: 4px;
}

关于html - <code>标签在ipython Notebook中无法正确样式化,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/31680970/

10-10 00:00
查看更多