<code> tag not styling properly in ipython notebook

时间:2015-07-28 15:35:04

标签: html css ipython-notebook

I'm trying to use the <code> tag in a markdown cell of an ipython notebook. However the expected styling behavior is being over written:

renderedhtml.less

I've tried:

  • over writing the default custom.css per here: doesn't work
  • add a custom code cell that loads a custom.css per here: doesn't work
  • adding a <style> definition within the cell containing the <code> tag: doesn't work
  • adding the style in-line to the <code> tag: this works

Anyone know how I prevent this style from being over-written?

1 个答案:

答案 0 :(得分:0)

看起来我使用了错误的标签来定义css;我跟着the guide here,然后用

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