jupyter notebook默认字体太小,不好看,如下图:
可以按以下方法进行修改:
1、在以下链接中找文件codemirror.css并打开
C:\Users\zhang\anaconda3\pkgs\notebook-6.4.12-py39haa95532_0\Lib\site-packages\notebook\static\components\codemirror\lib
2、修改文件中241行括号内的参数
修改前图片如下:
修改后如下:
也可以直接用以下代码替换241行.CodeMirror pre.CodeMirror-line-like及{}内的代码。
.CodeMirror pre.CodeMirror-line-like {
/* Reset some styles that the rest of the page might have set */
-moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
border-width: 0;
background: transparent;
font-family: Consolas, "PingFangSC-Medium", "Microsoft YaHei";
font-size: 18pt;
margin: 0;
white-space: pre;
word-wrap: normal;
line-height: 22pt;
color: inherit;
z-index: 2;
position: relative;
overflow: visible;
-webkit-tap-highlight-color: transparent;
-webkit-font-variant-ligatures: contextual;
font-variant-ligatures: contextual;
}
修改后效果: