这是我目前的背景,设置步骤如下:
1.找到并打开"C:\Users\username\.jupyter\custom\custom.css"
2.修改css文件(图方便请直接看下面的css文件全部代码,完成替换。记得更改图片url)
如果稍微了解html,可以在jupyter notebook界面,右击“检查”,进入网页调试窗口,逐个让光标划过右边的HTML代码上的DOM元素,当你感兴趣的、想要修改的区域高亮了,那么记住然后在custom.css中修改,也就是加一行该类的样式定义就行。
tooltip上显示的类名,或者就是光标所在的HTML标签中"class="后面的那一串。
然后在custom.css中修改,也就是加一行该类的样式定义就行。
div.cell.text_cell.rendered.selected{ font-family: UD Digi Kyokasho NK-R; font-size: 20pt; }
如法炮制,就可以修改整个页面上的字体,及其大小。
接着,我们修改页面的背景图片,为了美观,我们将一些大组件的透明度设成0.7
/* body 顺便设置背景图片*/ body { height: 100%;width: 100%; background: url("https://i.loli.net/2020/09/16/EM1xdskGr9tKbpn.jpg"); /* 背景图垂直、水平均居中 */ background-position: center center; /* 背景图不平铺 */ background-repeat: no-repeat; /* 当内容高度大于图片高度时,背景图像的位置相对于viewport固定 */ background-attachment: fixed; /* 让背景图基于容器大小伸缩 */ background-size: cover; /* 设置背景颜色,背景图加载过程中会显示背景色 */ background-color: rgba(250, 250, 250, alpha); } /* 文件目录界面组件 */ div #tab_content{ background-color: rgba(250, 250, 250, 0.7); } /* 文字及代码编辑区 */ div #menubar-container.container{ background-color: rgba(250, 250, 250, 0.7); color: #C8C8FF; } div #notebook-container.container{ background-color: rgba(250, 250, 250, 0.7); }
css文件全部代码如下:
div.cell.text_cell.rendered.selected{
font-family: UD Digi Kyokasho NK-R;
font-size: 20pt;
}
/* body 顺便设置背景图片*/
body {
height: 100%;width: 100%;
background: url("https://s2.loli.net/2022/01/09/54bu1Gg29CZOTVK.jpg");
/* 背景图垂直、水平均居中 */
background-position: center center;
/* 背景图不平铺 */
background-repeat: no-repeat;
/* 当内容高度大于图片高度时,背景图像的位置相对于viewport固定 */
background-attachment: fixed;
/* 让背景图基于容器大小伸缩 */
background-size: cover;
/* 设置背景颜色,背景图加载过程中会显示背景色 */
background-color: rgba(250, 250, 250, alpha);
}
/* 文件目录界面组件 */
div #tab_content{
background-color: rgba(250, 250, 250, 0.7);
}
/* 文字及代码编辑区 */
div #menubar-container.container{
background-color: rgba(250, 250, 250, 0.7);
color: #C8C8FF;
}
div #notebook-container.container{
background-color: rgba(250, 250, 250, 0.7);
}
上面的url括号里面的网址:"https://i.loli.net/2020/09/16/EM1xdskGr9tKbpn.jpg"可以自己去https://i.loli.net上传一个图片,然后更改为你图片的位置。不知道为什么我输入本地图片地址就没有用。因此我当初设置的时候也上传了我的图片。
保存。刷新Jupyter notebook页面。