gpt4 book ai didi

html, css, bootstrap, 如何对元素进行aline

转载 作者:行者123 更新时间:2023-11-28 06:45:41 25 4
gpt4 key购买 nike

我正在使用 thymeleaf、bootstap、css 作为 View 。如图所示,我无法对齐按钮和级别:-

enter image description here

更新:

这是源代码:-

        <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorator="shared-fragments/page"
th:inline="text">
<head lang="en">
<link th:href="@{/datepicker/css/datepicker3.css}" rel="stylesheet"/>
</head>
<body>
<div layout:fragment="content" class="container">

<th:block th:include="fragments/common :: top"/>

<!-- ** This is code shows the green button ** -->
<div class="pull-right"
th:with="hasKeyField=${!process.rowView.getAllFields().?[systemName==T(com.ahkgroup.projectmanagement.domain.definition.Field).KEY_FIELD].isEmpty()}">
<a class="btn btn-success navbar-btn"
th:if="${hasKeyField}"
th:href="${#mvc.url('VC#newRow').arg(0, project.id).arg(1, process.id).build()}">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
<span th:text="#{view.common.new}">New</span>
</a>
</div>

<form class="form-horizontal" th:action="${kf}
? ${#mvc.url('VC#save').arg(0, project.id).arg(1, process.id).arg(2, kf).build()}
: ${#mvc.url('VC#saveNewRow').arg(0, project.id).arg(1, process.id).build()}" method="post">
<th:block th:each="field : ${uniqueEditFields}">
<th:block th:switch="${field.projectField.type.actualType}">
<th:block th:case="${T(com.ahkgroup.projectmanagement.domain.definition.FieldType).STRING}"
th:with="readOnly=${kf} and ${#strings.equals(field.projectField.systemName, T(com.ahkgroup.projectmanagement.domain.definition.Field).KEY_FIELD)}">
<div th:replace="fragments/components :: text-field (${field}, ${data}, ${readOnly}, ${errors})"></div>
</th:block>
<th:block th:case="${T(com.ahkgroup.projectmanagement.domain.definition.FieldType).TIME}">
<div th:replace="fragments/components :: time-field (${field}, ${data}, false, ${errors})"></div>
</th:block>
<th:block th:case="${T(com.ahkgroup.projectmanagement.domain.definition.FieldType).DATE}">
<div th:replace="fragments/components :: date-field (${field}, ${data}, false, ${errors})"></div>
</th:block>
<th:block th:case="${T(com.ahkgroup.projectmanagement.domain.definition.FieldType).BOOLEAN}">
<div th:replace="fragments/components :: boolean-field (${field}, ${data}, false, ${errors})"></div>
</th:block>
<th:block th:case="${T(com.ahkgroup.projectmanagement.domain.definition.FieldType).LIST}">
<div th:replace="fragments/components :: list-field (${field}, ${data}, false, ${errors})"></div>
</th:block>
<th:block th:case="${T(com.ahkgroup.projectmanagement.domain.definition.FieldType).DECIMAL}">
<div th:replace="fragments/components :: text-field (${field}, ${data}, false, ${errors})"></div>
</th:block>
<th:block th:case="${T(com.ahkgroup.projectmanagement.domain.definition.FieldType).NUMBER}">
<div th:replace="fragments/components :: number-field (${field}, ${data}, false, ${errors})"></div>
</th:block>
<th:block th:case="${T(com.ahkgroup.projectmanagement.domain.definition.FieldType).PHOTOSET}">
<div>{PHOTOS HIDDEN}</div>
</th:block>
<th:block th:case="${T(com.ahkgroup.projectmanagement.domain.definition.FieldType).FILE}">
<div>{PHOTO HIDDEN}</div>
</th:block>
<th:block th:case="*">
<div th:if="${!field.projectField.type.isCalculation()}"
th:replace="fragments/components :: text-field (${field}, ${data}, false, ${errors})"></div>
</th:block>
</th:block>
</th:block>
<div class="form-group">
<input type="hidden" th:id="${T(com.ahkgroup.projectmanagement.domain.definition.Field).KEY_FIELD}"
th:name="${T(com.ahkgroup.projectmanagement.domain.definition.Field).KEY_FIELD}" th:value="${kf}"/>
<input class="btn btn-default btn-success" type="submit"/>
</div>
</form>
</div>
</body>
<th:block layout:fragment="scripts">
<script type="text/javascript" th:src="@{/datepicker/js/bootstrap-datepicker.js}"></script>
<script type="text/javascript" th:src="@{/datepicker/js/locales/bootstrap-datepicker.es.js}"></script>
<script type="text/javascript" th:src="@{/datepicker/js/locales/bootstrap-datepicker.ru.js}"></script>
<script type="text/javascript" th:inline="javascript">
$(function () {
$('.date-picker').datepicker({
language: [[${#ctx.locale}]],
format: [[#{data.format.date.js}]]
});
});
</script>
</th:block>
</html>

如何将按钮与 from 对齐并从 Key 字段中删除多余的空间。这样它看起来与元素的其余部分一致。请给我建议。谢谢!

最佳答案

查看 Bootstrap 类:pull-left 和 pull-right

关于html, css, bootstrap, 如何对元素进行aline,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34062528/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com