首页 > 解决方案 > 复选框未左对齐

问题描述

在我的 spring 应用程序中,我使用 thymeleaf 并希望复选框左对齐。在我的模板中:

<div class="container">
    <h3 th:text="*{title}"/>
    <form method="post" action="#" th:object="${user}" th:action="@{/user}">
        <table cellspacing="10">               
            <tr align="left">
                <td align="right"><label for="active">Active</label></td>
                <td align="left"><input type="checkbox" align="left" placeholder="active" id="active"
                                        th:field="*{active}"
                                        th:readonly="${isView}"/></td>
            </tr>                
            <tr>
                <td><input type="hidden" id="created" th:field="*{created}"/></td>
            </tr>
        </table>
        <input th:type="${isView} ? hidden : submit" value="Submit"/>
    </form>
</div>

如您所见,我使用align=left但没有帮助。

在此处输入图像描述

标签: htmlthymeleaf

解决方案


尝试这个:

 input:not([type="checkbox"]) {
    width: 300;
}

推荐阅读