首先进入路径
<D:\Anaconda3\envs\pytorch-gpu\Lib\site-packages\notebook\static\components\codemirror\lib>
下,这是Anaconda的安装路径,<\envs\>是安装的虚拟环境,根据路径找到<codemirror.css>文件,编辑文件中。
更改字体:
.CodeMirror { /* Set height, width, borders, and global font properties here */ font-family: Consolas; height: 300px; color: black; direction: ltr; }
更改字号:
.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: inherit; font-size: 15px; //更改字体大小 margin: 0; white-space: pre; word-wrap: normal; line-height: inherit; color: inherit; z-index: 2; position: relative; overflow: visible; -webkit-tap-highlight-color: transparent; -webkit-font-variant-ligatures: contextual; font-variant-ligatures: contextual; }