如何使用ons-select对齐文本?

问题描述 投票:0回答:1

我有这个HTML代码段:

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="https://unpkg.com/onsenui/css/onsenui.css">
    <link rel="stylesheet" href="https://unpkg.com/onsenui/css/onsen-css-components.min.css">
    <script src="https://unpkg.com/onsenui/js/onsenui.min.js"></script>
    <script src="https://unpkg.com/jquery/dist/jquery.min.js"></script>
</head>
<body>
    <p>
        Label for select:&nbsp;
        <ons-select id="any_id" modifier="material">
            <option value="0">Value 0</option>
            <option value="1">Value 1</option>
            <option value="2">Value 2</option>
        </ons-select>
    </p>
</body>
</html>

哪个产生这个:

Text is not properly aligned with ons-select. How to fix this?

如您所见,文本未与ons-select正确对齐。如何使它们显示在一行上?

html onsen-ui
1个回答
0
投票
将flexbox用于此类事物。非常容易实现。
© www.soinside.com 2019 - 2024. All rights reserved.