python-3.x - 使用 plotly/dash 更改链接的外观
问题描述
我正在与Dash合作构建仪表板。考虑以下代码:
def get_index():
index = html.Div([
dcc.Link('Page 1', href='/page-1'),
html.Br(),
dcc.Link('Page 2', href='/page-2')
], style = {'display':'inline-block','columnCount': 2})
return index
这在我的应用程序中为我提供了以下输出:
问题:如何删除链接下方的栏并更改字体和颜色?
谢谢!
解决方案
您可以通过添加style
为命名参数来自定义链接,例如
dcc.Link('Page 1', href='/page-1',
style={'font-family': 'Times New Roman, Times, serif', 'font-weight': 'bold'})
style 参数只是普通的 CSS。
在我看来,向你的 Dash 应用程序添加外部 CSS更可取,因为你可以分离代码逻辑和布局。
推荐阅读
- regex - apache mod_rewrite 更改深度链接中的基本 URL
- java - 在 setOnClickListener 上共享图像和文本
- github - 如何将我的 GitHub Enterprise 帐户与 Visual Studio Code 连接
- json - 如何从 json 服务器正确显示 JSON 数据
- docker - 从 dockerized 环境运行时,Chrome 的 webkitSpeechRecognition API 不给出结果
- python - 无法使用 BlobTrigger (azure.functions) [Python] 读取内容/数据
- mysql - 错误:SET FOREIGN_KEY_CHECKS = ON 和 #2014 - 命令不同步;你现在不能运行这个命令
- java - Butterknife @BindView 中的 AnnotationTypeMismatchException,布局在另一个文件夹结构中定义
- reactjs - 使用 Webpack StaticSiteGeneratorPlugin 和样式化组件反应静态站点渲染
- email - 指定多个电子邮件收件人时,SendGrid 如何通知(传递打开单击)事件