我不得不使用ipyvuetify在jupyter笔记本上渲染的高亮文本。
为了实现这一目标,我从以下几个方面着手:
import ipyvuetify as vue
pp=vue.Html(tag='mark',style_='font-weight: bold', children=['this is the first text highlighted green'], background_color='green')
pp2=vue.Html(tag='mark',style_='font-weight: bold', children=['this is a second text highlighted red'], background_color='red')
pp3=vue.Html(tag='p',style_='font-weight: bold', children=['blueblue'], background_color='blue')
display(pp,pp2,pp3)这会产生以下结果:

但是期望的结果应该是:

发布于 2021-05-19 16:47:48
ipyvuetify.Html没有'background_color‘属性,也没有'color’属性。你可以通过'style_‘标签设置背景颜色,就像设置粗体一样。
import ipyvuetify as vue
pp=vue.Html(tag='mark',style_='font-weight: bold; background-color:green', children=['this is the first text highlighted green'])
pp2=vue.Html(tag='mark',style_='font-weight: bold; background-color:red', children=['this is a second text highlighted red'])
pp3=vue.Html(tag='p',style_='font-weight: bold; background-color:blue', children=['blueblue'])
display(pp,pp2,pp3)https://stackoverflow.com/questions/67595679
复制相似问题