【问题标题】:highlighting text with ipyvuetify使用 ipyvuetify 突出显示文本
【发布时间】:2021-08-08 05:59:31
【问题描述】:

我必须在 jupyter notebook 中使用 ipyvuetify 突出显示文本。

为了实现这一点,我开始如下:

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)

这会产生:

但愿望结果应该是:

【问题讨论】:

    标签: python voila ipyvuetify


    【解决方案1】:

    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)
    

    【讨论】:

      猜你喜欢
      • 2013-04-07
      • 2011-11-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-11
      相关资源
      最近更新 更多