【问题标题】:Multiple buttons in one form一种形式的多个按钮
【发布时间】:2020-02-18 07:35:02
【问题描述】:

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

我只是想自定义使用市场构建器 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>

【问题讨论】:

标签: html css sharetribe


【解决方案1】:

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

请求按钮:

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

可用性和预订按钮:

{
  position: relative;
  top: 103px;
}

或者使用弹性!

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

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

【讨论】:

  • Imo flex 解决方案效果更好。不客气!
【解决方案2】:

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

<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>

【讨论】:

  • 您好,应该可以,可惜在这个编辑器中,我无法访问代码,所以只能添加自定义脚本
  • 哦,我认为这个解决方案会有所帮助stackoverflow.com/questions/34685316/…
猜你喜欢
  • 1970-01-01
  • 2015-04-17
  • 1970-01-01
  • 1970-01-01
  • 2017-02-21
  • 2019-01-16
  • 1970-01-01
  • 2015-10-02
相关资源
最近更新 更多