18910140161

Python-如何在Plotly Dash中设置按钮样式,使其看起来更干净,并与其他组件更一致-堆栈溢出

顺晟科技

2022-10-18 12:59:57

69

如何移动按钮";显示表格";所以它和我的过滤器很匹配?正如你所看到的,这一点也不吸引人。它应该上升一点。我可以使用什么CSS样式方法?我怎样才能添加阴影,并有一个更干净的外观。

号外:(我从来没有使用过CSS)有没有一些类型的网站,我可以测试不同的CSS功能,看看影响?

enter image description here

html.Div([
    html.Div([
        dcc.Dropdown(
            id='sim-filter',
            style={'font-size': '12px', 'width': '90px', 'display': 'inline-block', 'margin-right': '5px'}
        ),
        dcc.Dropdown(
            id='event-filter',
            style={'font-size': '12px', 'width': '240px', 'display': 'inline-block', 'margin-right': '5px'}
        ),
        dcc.Dropdown(
            id='time-filter',
            style={'font-size': '12px', 'width': '180px', 'display': 'inline-block', 'margin-right': '5px'}
        ),
        html.Button(id='my-button', n_clicks=0, children="Show table",
                    style={'font-size': '12px', 'width': '140px', 'display': 'inline-block', 'margin-bottom': '10px', 'margin-right': '5px', 'height':'25px'})
    ])

顺晟科技:

您可以尝试在verticalAlign中更改style

例如,将'height':'37px', 'verticalAlign': 'top'添加到按钮的样式:

style={'font-size': '12px', 'width': '140px', 'display': 'inline-block', 'margin-bottom': '10px', 'margin-right': '5px', 'height':'37px', 'verticalAlign': 'top'}
  • TAG:
相关文章
我们已经准备好了,你呢?
2024我们与您携手共赢,为您的企业形象保驾护航