如何解决如何将卡片图像对准Plotly Dash Bootstrap组件的中心?
有没有一种方法可以将dbc.card图像对准Plotly Dash Bootstrap的中心?我浏览了文档,只能找到“顶部”和“底部”。谢谢。下面是代码片段:
import dash_bootstrap_components as dbc
import dash_html_components as HTML
card = dbc.Card(
[
dbc.CardImg(src="/static/images/placeholder286x180.png",top=True),dbc.CardBody(
[
html.H4("Card title",className="card-title"),html.P(
"Some quick example text to build on the card title and "
"make up the bulk of the card's content.",className="card-text",),dbc.Button("Go somewhere",color="primary"),]
),],style={"width": "18rem"},)
解决方法
需要解决同样的问题,这是我使用 Bootstrap cheatsheet 发现的:
dbc.CardImg(src="/static/images/placeholder286x180.png",className = 'align-self-center')
我是新手,所以它可能不是最正确的,但它对我有用。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。