Contact Form 7 - 同一行上的多个文本字段

Contact Form 7 - Multiple text fields on the same line

我正在使用 Contact Form 7 设计酒店预订表。

http://istanabalian.com/book/

我不知道如何自定义布局。我希望某些文本字段显示在同一行上,但我找不到 and/or 元素的正确标识,而 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>

我想在一行中显示 form-row 元素的 p 个元素。我试过这个 CSS 行:

.form_row p{
display: inline-block
}

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

非常感谢,

本杰明

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

为什么不使用<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>

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

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

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

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

试一试,告诉我你的想法。

Hope this video instruction will help you

这是我的联系表 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;
}

你的代码对我来说运行良好,只是你的 CSS 中有一个语法错误。 HTML 中的元素名称是 form-row,但在 CSS 中你写的是 form_row。我刚刚将 CSS 选择器更改为 form-row 并且一切正常。

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

你可以简单地使用HTMLtable结构!!!

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