April 19, 201412 yr If someone could have a look at this and try and make it work then show me the code and explain it then that would be much apperciated, thanks. If you guys are gonna do this in CodePen this is the CSS just so you can see it properly. .form-control { font-size: 14px; font-weight: normal; line-height: 1; color: #555; background-color: #eee; border: 1px solid #ccc; border-radius: 4px; padding-top: 6px; padding-right: 12px; padding-bottom: 6px; padding-left: 12px;}.form-inline { width: 100%;}.form-group { display: inline-block; margin-bottom: 0; vertical-align: middle; padding-left: 1%; padding-right: 1%; }.sr-only { display: block; padding: .2em .6em .3em; font-size: 75%; line-height: 1; white-space: nowrap; vertical-align: baseline; border-radius: .25em;} More of the HTML below: <div class="div-box-5"> <div class="bottom-centre-text"><h2>Kjøp bilforsikring i to enkle trinn</h2><form class="form-inline"> <div class="form-group"> <label class="sr-only" for="registration">Registreringsnummer</label> <input type="text" class="form-control"> </div> <div class="form-group"> <label class="sr-only" for="dittpersonnummer">Ditt personnummer (11 siffer)</label> <input type="password" class="form-control" placeholder="DDMMAAnnnnn"> </div> <div class="form-group"> <select class="form-control"> <option>Velg</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option></select></div><div class="form-group"><button type="submit" class="button-2">Neste</button></div></form> </div> </div>
April 19, 201412 yr I'm not 100% sure what you are asking here. If you mean you want the form inputs, select box and button to line up horizontally change : .form-group { display: inline-block; margin-bottom: 0; vertical-align: middle; padding-left: 1%; padding-right: 1%; } to .form-group { display: inline-block; margin-bottom: 0; vertical-align: baseline; padding-left: 1%; padding-right: 1%; } That should work in most browsers and IE9 up. In IE8 and below the select and button will be a shade higher. Unless you mean how to set validation. That can be done using HTML5 validation, javascript validation or validating in the submission script. Or do you want a submission script?
April 19, 201412 yr I notice your <form> tag has no method="post" action="filename.ext" in it. Are you struggling to make the form pass you the information? If so this might be of use to you - php form tutorial on HTML form guide, it is only the basics but is a good starting point.
Create an account or sign in to comment