Search code examples
csswordpresscontact-form-7form-layout

Contact Form 7 - Multiple text fields on the same line


I am using Contact Form 7 to design a booking form for a hotel.

http://istanabalian.com/book/

I can't figure out how to customize the layout. I'd like some of the text fields to be displayed on the same line but I don't find the correct identification for the elements and/or which CSS styling to use to achieve this very simple goal.

Here is the code :

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

I want to display the p elements of the form-row elements on a single line. I have tried this CSS line :

.form_row p{
display: inline-block
}

But it does not do anything. I feel I am missing something, can anybody help ?

Many thanks in advance,

Benjamin


Solution

  • You probably have a CSS rule that makes the <p> element full-width.

    Why not use <div> and use the theme's classes?

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