联系表格 7 - 同一行上的多个文本字段



我正在使用联系表格 7 为酒店设计预订表格。

http://istanabalian.com/book/

我不知道如何自定义布局。我希望某些文本字段显示在同一行上,但我找不到元素的正确标识和/或使用哪种 CSS 样式来实现这个非常简单的目标。

这是代码:

<div id="responsive-form" class="clearfix">
<label> Your Name (required)
    [text* your-name] </label>
<label> Your Email (required)
    [email* your-email] </label>
<label> Arrival date
[date date-79 id:Arrivaldate date-format:mm/dd/yy] </label>
<label> Departure date
[date date-80 id:Departuredate date-format:mm/dd/yy] </label>
<label> How many guests?
    [text your-guests] </label>
<div class="form-row">
       <p>Number of adults [text your-adults]</p>
       <p>Number of children under 6 years old [text your-little-children]</p>
       <p>Number of children under 12 years old [text your-big-children]</p>
</div>
Select your preferred accomodation
    [checkbox your-accomodation use_label_element "Wayan (Two-story villa)" "Kadek (Two-story villa)" "Nyoman (Garden bungalow)" "Kehut (Garden bungalow)" "Pasca (Garden bungalow)"]
Do you need transportation to the hotel ? 
[radio your-pickup default:1 use_label_element exclusive "No transport needed" "Transport from Denpasar airport" "Transsport from Gilimanuk Ferry"]
<label> Do you want us to arrange motorbike rental for you ? 
    [text your-motorbikes] </label>
<label> Tell us more about what brings you to Balian
    [textarea your-message] </label>
[submit "Send"]
</div>

我想在一行上显示表单行元素的 p 元素。我试过这个CSS行:

.form_row p{
display: inline-block
}

但它什么也没做。我觉得我错过了什么,有人可以帮忙吗?

提前非常感谢,

本杰明

您可能有一个使<p>元素全角的 CSS 规则。

为什么不使用<div>并使用主题的类?

<div class="form-row">
   <div class="grid-33">Number of adults [text your-adults]</div>
   <div class="grid-33">Number of children under 6 years old [text your-little-children]</div >
   <div class="grid-33">Number of children under 12 years old [text your-big-children]</div>
</div>
您可以

简单地使用 HTML 表格结构!!

<table>
  <tr>
    <td colspan="2">[text* Name placeholder "Your Name"]</td>
  </tr>
  <tr>
    <td>[text* Class placeholder "Enter Class"]
    </td>
    <td>
      [text* Medium placeholder "Enter Medium"]
    </td>
  </tr>
</table>
[submit "Submit"]

您可以使用主题网格将其分为两列。 见下面的代码片段

<div id="responsive-form" class="clearfix">
<div class="vc_row ">
  <div class="vc_col-sm-6">
    <label> Your Name (required)
        [text* your-name] </label>
  </div>
  
  <div class="vc_col-sm-6">
    <label> Your Email (required)
        [email* your-email] </label>
  </div>
</div>
<label> Arrival date
[date date-79 id:Arrivaldate date-format:mm/dd/yy] </label>
<label> Departure date
[date date-80 id:Departuredate date-format:mm/dd/yy] </label>
<label> How many guests?
    [text your-guests] </label>
<div class="form-row">
       <p>Number of adults [text your-adults]</p>
       <p>Number of children under 6 years old [text your-little-children]</p>
       <p>Number of children under 12 years old [text your-big-children]</p>
</div>
Select your preferred accomodation
    [checkbox your-accomodation use_label_element "Wayan (Two-story villa)" "Kadek (Two-story villa)" "Nyoman (Garden bungalow)" "Kehut (Garden bungalow)" "Pasca (Garden bungalow)"]
Do you need transportation to the hotel ? 
[radio your-pickup default:1 use_label_element exclusive "No transport needed" "Transport from Denpasar airport" "Transsport from Gilimanuk Ferry"]
<label> Do you want us to arrange motorbike rental for you ? 
    [text your-motorbikes] </label>
<label> Tell us more about what brings you to Balian
    [textarea your-message] </label>
[submit "Send"]
</div>

您可以按如下方式使用 HTML 表:

<table>
    <tr>
        <td>Number of adults [text your-adults]</td>
        <td>Number of children under 6 years old [text your-little-children]</td>
        <td>Number of children under 12 years old [text your-big-children]</td>
    </tr>
</table>

我对联系表格 7 缺乏设计解决方案感到非常沮丧。一年前,我的任务是在 cf7 中创建多个表单,具有复杂的布局要求。 为了解决这个问题,我着手创建一个插件,该插件允许响应式网格布局设计以及采用模块化方法来构建表单的能力,即能够将现有表单重用到更大的表单结构中。我刚刚发布了 CF7 的智能网格布局设计,它在仪表板中提供了一个网格 UI 编辑器,允许您在一行中构建 3 列布局。 你不需要弄乱css,布局将呈现在你的页面上。 它也是响应式的,在手机上默认为 3 行。

一试,让我知道你的想法。

你的代码对我来说很好用,你只是在你的 CSS 中有一个语法错误。您的元素在 HTML 中的名称是form-row但在 CSS 中您编写了form_row 。我刚刚将CSS选择器更改为form-row,一切都按预期工作。

.form-row p {
  display: inline-block;
}

希望这个视频说明能帮助你

这是我的联系表格 7 的 CSS 代码:

/* Create two equal columns that floats next to each other */
.column {
    float: left;
    width: 50%;
    padding: 10px;
}
/* Clear floats after the columns */
.row:after {
    display: table;
    clear: both;
}
#knopka
{
    color: #fffff;
    background: #8F8CA0;
    width: 90%;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
}

相关内容

  • 没有找到相关文章

最新更新