python - 类型错误:ID 为“Br(None)”的 `dash_html_components.P` 组件(版本 1.0.3)检测到 `children` 以外的道具的组件
问题描述
我是 Dash 和 HTML/CSS 的新手,我发现<br>
在 Dash 中创建标签时存在问题。
我正在尝试使用其中创建一个带有文本中断的段落,html.Br()
但错误一直告诉我我没有将它包裹起来,children
即使我有。这是我的代码:
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
## CSS color codes ##
colors = {
'background': '#87CEFA',
'text': '#000000'
}
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
## Creating HTML style ##
app.layout = html.Div(children=[
html.H1(children='First Dash Server',
style={
'textAlign': 'center',
'color': colors['text']
}
),
html.Div(children= 'Dash: A web application framework for Python.',
style={
'textAlign': 'center',
'color': colors['text']}
),
html.Div(children=[
html.H2('Information on server'),
html.P('This is a Dash server and requirements are:'
'X')]
),
html.Div(children=[
html.H2(('Introduction to the project'),
html.P('In the process of idea building for this coursework I decided to host my visualisations on a dashboard using the Dash library in python.',
html.Br(),
'I started with a simple line graph using matplotlib'))]
),
这可能在 HTML 中丢失了一些东西,但我不明白出了什么问题。
任何帮助将不胜感激。
解决方案
推荐阅读
- c - 严格的别名违规:为什么 gcc 和 clang 生成不同的输出?
- android - SELECT * FROM sqlite_master WHERE type='table' 返回 Android Pie 中 sqlite 中的元数据表
- java - @ControllerAdvice 中@ExceptionHandler 返回的 ResponseEntity 无法在 swagger-ui.html 中显示
- fonts - 如果 OpenType 中的 Local 和 Global Subr INDEX 基本上是可重用的组件
- c# - 从 CADES 签名的 XML 文件中提取原始文件内容
- java - 根据 GitLab C 上的 JWT 异常,无法在 JSON 有效负载中找出错误
- django-rest-framework - 未提供身份验证凭据 - Django
- r - 隐藏和清除 selectInput
- jenkins - 如何在 Jenkins 中使用审计跟踪插件将当前日期和时间附加到日志文件名
- arrays - 以字符串为键的 VB.Net 数组