Form layout

by adamh

HTML

<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/normalize/2.1.0/normalize.css">
<script src="https://raw.github.com/benplum/Selecter/master/jquery.fs.selecter.min.js"></script>
<link rel="stylesheet" href="https://raw.github.com/benplum/Selecter/master/jquery.fs.selecter.css">
<div class="container">
    <div class="header">
        <h1>Get in touch with Audley</h1>
        <p class="intro">Please complete the following information and choose one of the options.</p>
    </div>
    <form>
        <div class="section">
            <h2>Your name</h2>
            <fieldset id="title-field" class="float">
                <label for="title">Title</label>
                <input type="text" id="title" />
            </fieldset>
            <fieldset id="fname-field" class="float">
                <label for="fname">First name</label>
                <input type="text" id="fname" />
            </fieldset>
            <fieldset id="lname-field">
                <label for="lname">Surname</label>
                <input type="text" id="lname" />
            </fieldset>
        </div>
        <div class="section">
            <h2>Your contact details</h2>
            <fieldset id="email-field" class="float">
                <label for="email">Email</label>
                <input type="text" id="email" />
            </fieldset>
            <fieldset id="country-field" class="float">
                <label for="country">Country</label>
                <select id="country">
                    <option>United Kingdom</option>
                    <option>United States</option>
                </select>
            </fieldset>
            <fieldset id="postcode-field">
                <label for="postcode">Postcode</label>
                <input type="text" id="postcode" />
            </fieldset>
        </div>
        <div class="actions">
            <button id="quote" class="float">
                <span>I'd like to</span>
                Plan a Vacation
       ...

CSS

body {
    font-family: Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    padding: 40px;
    font-size: 14px;
    background-color: #e4ddd3;
}

.container {
    width: 480px;
    margin: 0 auto;
    border: 1px solid #999;
    border-radius: 4px;
}

.header {
    background: #eee;
    border-bottom: 1px solid #ddd;
    padding: 20px;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

h1 {
    margin: 0;
    color: #214636;
}

h2 {
    margin: 10px 0;
    color: #214636;
}

p.intro {
    margin: 0;
}

form {
    padding: 0;
    background: white;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

.section {
    padding: 20px;
}

.section h2 {
    margin-top: 0;
    font-size: 16px;
}

.section + .section {
    border-top: 1px dotted #a5a5a5;
}

fieldset {
    margin: 0;
    padding: 0;
    border: none;
}

label {
    display: block;
    font-size: 12px;
    font-weight: bold;
    color: #666;
}

input {
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    font-size: 12px;
    padding: 2px 4px;
}

select {
    font-size: 12px;
    padding: 2px 4px;
}

input:focus {
    box-shadow: 0 0 4px rgba(96,96,96,0.4);
    outline: none;
    background: #f5fbfc;
}

.actions {
    height: 1%;
    overflow: auto;
    background-color: #eee;
    border-top: 1px solid #ddd;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    padding: 20px;
}

hr {
    border: none;
    border-top: 1px dotted #a5a5a5;
    height: 0px;
    margin: 20px 0;
}

.float {
    float: left;
    margin-right: 10px;
}

button {
    background: #57676e;
    border: none;
    border-radius: 2px;
    font-weight: bold;
    font-size: 14px;
    text-align: left;
    padding: 4px 8px;
    color: white;
    text-shadow: 0 0 1px rgba(96,96,96,0.4);
}

button span {
    display: block;
    font-size: 12px;
    text-indent: 1em;
}

fieldset#title-field input {
    width: 40px;
}

fieldset#email-field input {
   ...