Viewing 7 replies - 1 through 7 (of 7 total)
  • <label > Your Name (required)
    [text* your-name] </label><label> Your Email (required)
    [email* your-email] </label>

    Thread Starter HannaWP

    (@hannawp)

    Thanks but are you sure with the code? I get the exact same thing: Email field below Name field

    Ok, you’ll need some css also. Try this

    <style type=”text/css”>
    .wpcf7-form label{display:inline-block;}
    </style>

    <label > Your Name (required)
    [text* your-name] </label><label> Your Email (required)
    [email* your-email] </label>

    note that they will be in one line only if browser width allows it. On mobile phone, they will be one above another

    Thread Starter HannaWP

    (@hannawp)

    Sorry, but where do I put this html? If I type everything in the contact form 7 window, it doesn’t work. The CSS .wpcf7-form label{display:inline-block;} goes to my style sheet, that I understand. But where does the style type=”text/css”> </style> go?

    @hannawp, just remove those.
    It’s a HTML way to embed css without css file.
    It’s better to move .wpcf7-form label{display:inline-block;} to your css file of course

    Thread Starter HannaWP

    (@hannawp)

    I pasted the whole thing now to the form but the two lines are still one after the other. I guess it just doesn’t work ??

    @hannawp, I don’t know your setup, but it produces two fields in one line for me https://jsfiddle.net/vasili4/3kcLw7ua/
    Some of your theme CSS can break it of course

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Name and email field in one line’ is closed to new replies.