应用自定义CSS#
若要应用自定义css,可以添加一个 /custom/custom.css
Jupyter中的文件 config
目录。你可以找到这条路, ~/.jupyter
,通过运行以下命令添加到此目录 jupyter --paths
。您可以在其中创建名为的文件夹 custom
并创建一个 custom.css
文件夹中的文件。
Jupyter造型#
您可以使用自定义的css文件修改默认的Jupyter样式。
/* Modify Jupyter Styles */
#top-panel-wrapper,
#jp-top-bar {
background-color: #aecad4 !important;
}
#menu-panel-wrapper,
#jp-MainMenu,
#menu-panel {
background-color: #aecad4 !important;
}
.jp-NotebookPanel-toolbar {
background-color: #aecad4 !important;
}
.lm-MenuBar-content {
color: #02484d;
}
好了! [a screenshot custom jupyter styling] (https://user-images.githubusercontent.com/12378147/245519958-17ce04e7-edc2-434e-8d93-a5c2de9fb225.png)
降价#
定制css的另一个潜在应用是样式标记。
/* Headings */
h1,
h2 {
font-family: Impact, Charcoal, sans-serif;
font-weight: bold;
text-shadow: 2px 2px 4px #000000;
}
h1 {
font-size: 52px;
margin-bottom: 40px;
color: #10929e;
text-decoration: underline;
}
h2 {
font-size: 448px;
margin-bottom: 32px;
color: #76b4be;
text-transform: uppercase;
}
/* Block Quotes */
blockquote {
font-family: Georgia, serif;
font-size: 16px;
color: #19085c;
border-left: 8px solid #effffc;
background-color: #eafcff;
padding: 20px;
}
/* Lists */
ul,
ol {
font-family: Verdana, Geneva, sans-serif;
font-size: 18px;
color: #333333;
margin-bottom: 24px;
}
好了! [a screenshot of custom markdown styling] (https://user-images.githubusercontent.com/12378147/245520291-968848d3-d336-4523-a046-023b15082ff8.png)