【发布时间】:2020-09-30 20:25:35
【问题描述】:
我有一个导航栏,我希望链接位于中心。我现在使用类名“ml-auto”将它们放在右侧,但我无法管理它们移动到中心。有谁能帮忙吗?在我的代码下方。
nav_item = dbc.Nav(
[
dbc.NavItem(dbc.NavLink("World Map", active= True, href="/page-1")),
dbc.NavItem(dbc.NavLink("Table", active= True, href="/page-2")),
dbc.NavItem(dbc.NavLink("Moran's l", active= True, href="/page-3")),
dbc.NavItem(dbc.NavLink("Scatter Plots", active= True, href="/page-4"))
],
fill= True
)
navbar = dbc.Navbar(
[
html.A(
# Use row and col to control vertical alignment of logo / brand
dbc.Row(
[
dbc.Col(html.Img(src= oord_logo, height="100px"), className="ml-5"),
],
align="center",
no_gutters=True,
),
href="https://plot.ly",
),
dbc.NavbarToggler(id="navbar-toggler"),
dbc.Nav([nav_item], navbar=True, className="ml-auto",)
],
color="white",
dark=False,
className = "mb-5"
)
【问题讨论】:
-
你试过用
className="m-auto"代替className="ml-auto"吗?
标签: python css bootstrap-4 plotly-dash