一种形式的多个按钮

Multiple buttons in one form

我在一个 form 中有 3 个 buttons,我想更改 button 的顺序 - 将最后一个显示为第一个。

我只是想自定义使用市场构建器 Sharetribe 创建的网站的外观。自定义选项有限,我只能添加自定义脚本。

这是列表页面上的网站和按钮。 https://rentim.sharetribe.com/en/listings/841589-karl-plumber

<form id="booking-dates" action="/en/transactions/new?listing_id=841589" accept-charset="UTF-8" method="get" novalidate="novalidate">
  <input name="utf8" type="hidden" value="✓">
  <div class="quantity-wrapper input-group clearfix">
    <div class="quantity-label-wrapper">
      <label class="quantity-label" for="quantity">Number of hours:</label>
      <input type="hidden" name="listing_id" id="listing_id" value="841589">
      <button class="enabled-book-button">
          <div class="content">Avaliablity and reservation</div>        </button>
      <button class="enabled-book-button">
          <div class="content">Buy hourly work</div>
       </button>
      <button class="enabled-book-button">
        <div class="content">Request</div></button>
</form>

简单地重新排序元素会有帮助。

<button class="enabled-book-button">
<div class="content">Request</div></button>
<input type="hidden" name="listing_id" id="listing_id" value="841589">
<button class="enabled-book-button">
<div class="content">Avaliablity and reservation</div></button>
<button class="enabled-book-button">
<div class="content">Buy hourly work</div></button>

您可以尝试将两个按钮的位置设置为相对位置,然后移动元素:

请求按钮:

{
  position: relative;
  top: -132px;
}

可用性和预订按钮:

{
  position: relative;
  top: 103px;
}

或者使用 flex!

#booking-dates { // form element
  display: flex;
  flex-direction: column;
}

.enabled-book-button { // request button
  order: -1;
}