设置jupyter notebook背景

这是我目前的背景,设置步骤如下:

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页面。 

参考链接:自定义jupyter notebook界面样式 - 知乎

  • 5
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值