Input icons in every input instead of amount of them [closed] - html

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
What should I change in my CSS to put every i icon to correct input box?
..
What the hell I should edit there when is already answered...
.box_main {
width: 50%;
margin: 0 auto;
}
.box_main_content {
width: 200px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
background: linear-gradient(#ffffff, #f5f5f5);
padding: 20px;
margin: 20px 10px 20px 10px;
float: left;
}
.box_main_content_data {
padding: 1em 0 0 0;
text-align: center;
}
.inputWithIcon {
position: relative;
}
.inputWithIcon i {
position: absolute;
left: 0;
top: 8px;
padding: 19px 8px;
color: #aaa;
transition: 0.3s;
}
.inputWithIcon input:focus + i {
color: rgb(0, 0, 0);
}
input {
font-family: 'Nunito', sans-serif;
width: 100%;
border: 2px solid rgb(0, 0, 0);
margin: 8px 0;
outline: none;
padding: 5px;
box-sizing: border-box;
transition: 0.3s;
padding-left: 40px;
}
input:focus {
box-shadow: 0 0 8px 0 rgb(0, 0, 0);
}
.lost_pass {
border-top: 1px solid rgb(170, 170, 170);
margin: 1em 0 1em 0;
padding-top: 1em;
}
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<div class="box_main">
<div class="box_main_content">
<div class="box_title">
<i class='material-icons'>login</i>Přihlášení
</div>
<div class="box_main_content_data inputWithIcon">
<form method="post">
<input type="text" name="name" placeholder="Přihlašovací jméno nebo E-mail" required>
<i class='material-icons'>person</i>
<input type="password" name="password" placeholder="Heslo" onkeyup="lettersOnly(this)" required>
<i class='material-icons'>lock</i>
<br>
<button name="btn_login">Přihlásit se</button>
</form>
<div class="lost_pass">
<button name="btn_login">Zapomenuté heslo?</button>
</div>
</div>
</div>
<div class="box_main_content">
<div class="box_title">
<i class='material-icons'>person_add</i>Regsitrace
</div>
<div class="box_main_content_data inputWithIcon">
<form method="post">
<input class="inputWithIcon" type="text" name="name" placeholder="Přihlašovací jméno" onkeyup="lettersOnly(this)" required>
<i class='material-icons'>person</i>
<input type="password" name="password" placeholder="Heslo" onkeyup="lettersOnly(this)" required>
<i class='material-icons'>lock</i>
<input type="password" name="password_repeat" placeholder="Heslo znovu" onkeyup="lettersOnly(this)" required>
<i class='material-icons'>lock</i>
<input type="text" name="email" placeholder="E-Mail" required>
<i class='material-icons'>email</i>
<input type="text" name="firstname" placeholder="Jméno">
<i class='material-icons'>badge</i>
<input type="text" name="surname" placeholder="Příjmení">
<i class='material-icons'>badge</i>
<input type="date" name="age">
<i class='material-icons'>badge</i>
<label class="radio-checkbox">
<input type="radio" name="sex" value="0" checked>
<i class='material-icons'>male</i>
<span class="checkmark"></span>
</label>
<label class="radio-checkbox">
<input type="radio" name="sex" value="1">
<i class='material-icons'>female</i>
<span class="checkmark"></span>
</label>
</form>
</div>
</div>
</div>

Try to wrap every input with div and add class="inputWithIcon" to div's:
.box_main {
width: 50%;
margin: 0 auto;
}
.box_main_content {
width: 200px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
background: linear-gradient(#ffffff, #f5f5f5);
padding: 20px;
margin: 20px 10px 20px 10px;
float: left;
}
.box_title {
margin-left: 1em;
}
.box_main_content_data {
padding: 1em 0 0 0;
text-align: center;
}
.inputWithIcon {
position: relative;
}
.inputWithIcon i {
position: absolute;
left: 0;
top: 1px;
padding: 9px 8px;
color: #aaa;
transition: 0.3s;
}
.inputWithIconLabel i {
position: absolute;
left: 0;
top: -2px;
padding: 0px 8px;
color: #aaa;
transition: 0.3s;
}
.inputWithIcon input:focus + i {
color: rgb(0, 0, 0);
}
input {
font-family: 'Nunito', sans-serif;
width: 100%;
border: 2px solid rgb(0, 0, 0);
margin: 8px 0;
outline: none;
padding: 5px;
box-sizing: border-box;
transition: 0.3s;
padding-left: 40px;
}
input:focus {
box-shadow: 0 0 8px 0 rgb(0, 0, 0);
}
.lost_pass {
border-top: 1px solid rgb(170, 170, 170);
margin: 1em 0 1em 0;
padding-top: 1em;
}
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet"
/>
<div class="box_main">
<div class="box_main_content inputWithIcon">
<div class="box_title"><i class="material-icons">login</i>Přihlášení</div>
<div class="box_main_content_data ">
<form method="post">
<div class="inputWithIcon">
<input
type="text"
name="name"
placeholder="Přihlašovací jméno nebo E-mail"
required
/><i class="material-icons">person</i>
</div>
<div class="inputWithIcon">
<input
type="password"
name="password"
placeholder="Heslo"
onkeyup="lettersOnly(this)"
required
/><i class="material-icons">lock</i>
</div>
<br /><button name="btn_login">Přihlásit se</button>
</form>
<div class="lost_pass">
<button name="btn_login">Zapomenuté heslo?</button>
</div>
</div>
</div>
<div class="box_main_content inputWithIcon">
<div class="box_title">
<i class="material-icons">person_add</i>Regsitrace
</div>
<div class="box_main_content_data ">
<form method="post">
<div class="inputWithIcon">
<input
type="text"
name="name"
placeholder="Přihlašovací jméno"
onkeyup="lettersOnly(this)"
required
/><i class="material-icons">person</i>
</div>
<div class="inputWithIcon">
<input
type="password"
name="password"
placeholder="Heslo"
onkeyup="lettersOnly(this)"
required
/><i class="material-icons">lock</i>
</div>
<div class="inputWithIcon">
<input
type="password"
name="password_repeat"
placeholder="Heslo znovu"
onkeyup="lettersOnly(this)"
required
/><i class="material-icons">lock</i>
</div>
<div class="inputWithIcon">
<input
class="inputWithIcon"
type="text"
name="email"
placeholder="E-Mail"
required
/><i class="material-icons">email</i>
</div>
<div class="inputWithIcon">
<input
type="text"
name="firstname"
placeholder="Jméno"
/><i class="material-icons">badge</i>
</div>
<div class="inputWithIcon">
<input type="text" name="surname" placeholder="Příjmení" /><i
class="material-icons"
>badge</i
>
</div>
<div class="inputWithIcon">
<input class="inputWithIcon" type="date" name="age" /><i
class="material-icons"
>badge</i
>
</div>
<div class="inputWithIconLabel">
<label class="radio-checkbox inputWithIcon">
<input type="radio" name="sex" value="0" checked /><i
class="material-icons"
>male</i
>
<span class="checkmark"></span>
</label>
<label class="radio-checkbox inputWithIcon">
<input type="radio" name="sex" value="1" />
<i class="material-icons">female</i>
<span class="checkmark"></span>
</label>
</div>
</form>
</div>
</div>
</div>

Related

Why doesn't appear my icon in the button using far fa-paper-plane?

currently I'm working on a css of a newsletter sign up. However I got a problem using an icon in my button ("Senden"). I won't appear and I have no clue why. I have already looked up in the net, but couldn't find a solution.
Here is my html code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link href="//cdn-images.mailchimp.com/embedcode/classic-10_7_dtp.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="index.css">
</head>
<body>
<div id="mc_embed_signup">
<form action="https://adra.us6.list-manage.com/subscribe/post?u=e2d5faa9b94a0d751d430e84b&id=28f961ba01" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div id="mc_embed_signup_scroll">
<h5>Newsletter abonnieren und
am letzten Stand der Dinge bleiben.</h5>
<!-- <div class="indicates-required"><span class="asterisk">*</span> indicates required</div>-->
<div class="mc-field-group input-group">
<ul><li><input type="checkbox" value="Herr" name="MMERGE3" id="mce-MMERGE3-0" required><label for="mce-MMERGE3-0">Herr</label></li>
<li><input type="checkbox" value="Frau" name="MMERGE3" id="mce-MMERGE3-1"><label for="mce-MMERGE3-1">Frau</label></li>
<li><input type="checkbox" value="Anders" name="MMERGE3" id="mce-MMERGE3-2"><label for="mce-MMERGE3-2">Anders</label></li>
</ul>
</div>
<div class="mc-field-group">
<input type="text" value="" name="VNAME" class="required" id="mce-VNAME" placeholder="Vorname" required>
</div>
<div class="mc-field-group">
<input type="text" value="" name="LNAME" class="required" id="mce-LNAME" placeholder="Nachname" required>
</div>
<div class="mc-field-group">
<input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL" placeholder="eMail" required>
</div>
<div id="mce-responses" class="clear foot">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div> <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_e2d5faa9b94a0d751d430e84b_28f961ba01" tabindex="-1" value=""></div>
<div class="optionalParent">
<div class="clear foot">
<button name="subscribe" id="mc-embedded-subscribe" class="button"><i class="far fa-paper-plane"></i>Senden</button>
</div>
</div>
</div>
</form>
</div>
</body>
</html>
Here is my css-code:
:root {
--primary-color: #007960;
--secondary-color: #E6B000;
--border-color: #D9D9D6;
}
body {
color: black;
display: flex;
justify-content: center;
align-items: center;
padding: 10px;
width: 100%;
}
#mc_embed_signup h5 {
font: 20px Montserrat;
color: var(--primary-color);
font-weight: 300;
margin-bottom: 10px;
text-align: center;
}
.input-group ul {
font-weight: bold;
font: 16px Zilla Slab;
display: flex;
justify-content: space-between;
width: 35%;
}
.mc-field-group input {
background: #ffffff;
padding: 4px 12px;
border-color: var(--border-color);
border-width: 1px 1px 1px 1px;
border-radius: 3px 3px 3px 3px;
margin-top: -20px;
}
.optionalParent #mc-embedded-subscribe {
background: var(--primary-color);
color: #ffffff;
width: 135%;
margin-top: -20px;
}
.optionalParent #mc-embedded-subscribe:hover {
background-color: var(--primary-color);
}
.optionalParent button {
font: 15px Zilla;
}
.btn {
background-color: light-green;
padding: 12px 16px;
font-size: 16px;
}
.btn:hover {
color: green;
font-size: 1.5em;
}
Thank you for your help!
.........................................................................................................................................................
Because you need to add the font-awesome library script src to your <head>.
:root {
--primary-color: #007960;
--secondary-color: #E6B000;
--border-color: #D9D9D6;
}
body {
color: black;
display: flex;
justify-content: center;
align-items: center;
padding: 10px;
width: 100%;
}
#mc_embed_signup h5 {
font: 20px Montserrat;
color: var(--primary-color);
font-weight: 300;
margin-bottom: 10px;
text-align: center;
}
.input-group ul {
font-weight: bold;
font: 16px Zilla Slab;
display: flex;
justify-content: space-between;
width: 35%;
}
.mc-field-group input {
background: #ffffff;
padding: 4px 12px;
border-color: var(--border-color);
border-width: 1px 1px 1px 1px;
border-radius: 3px 3px 3px 3px;
margin-top: -20px;
}
.optionalParent #mc-embedded-subscribe {
background: var(--primary-color);
color: #ffffff;
width: 135%;
margin-top: -20px;
}
.optionalParent #mc-embedded-subscribe:hover {
background-color: var(--primary-color);
}
.optionalParent button {
font: 15px Zilla;
}
.btn {
background-color: light-green;
padding: 12px 16px;
font-size: 16px;
}
.btn:hover {
color: green;
font-size: 1.5em;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link href="//cdn-images.mailchimp.com/embedcode/classic-10_7_dtp.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer"
/>
<link rel="stylesheet" href="index.css">
</head>
<body>
<div id="mc_embed_signup">
<form action="https://adra.us6.list-manage.com/subscribe/post?u=e2d5faa9b94a0d751d430e84b&id=28f961ba01" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div id="mc_embed_signup_scroll">
<h5>Newsletter abonnieren und am letzten Stand der Dinge bleiben.</h5>
<!-- <div class="indicates-required"><span class="asterisk">*</span> indicates required</div>-->
<div class="mc-field-group input-group">
<ul>
<li><input type="checkbox" value="Herr" name="MMERGE3" id="mce-MMERGE3-0" required><label for="mce-MMERGE3-0">Herr</label></li>
<li><input type="checkbox" value="Frau" name="MMERGE3" id="mce-MMERGE3-1"><label for="mce-MMERGE3-1">Frau</label></li>
<li><input type="checkbox" value="Anders" name="MMERGE3" id="mce-MMERGE3-2"><label for="mce-MMERGE3-2">Anders</label></li>
</ul>
</div>
<div class="mc-field-group">
<input type="text" value="" name="VNAME" class="required" id="mce-VNAME" placeholder="Vorname" required>
</div>
<div class="mc-field-group">
<input type="text" value="" name="LNAME" class="required" id="mce-LNAME" placeholder="Nachname" required>
</div>
<div class="mc-field-group">
<input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL" placeholder="eMail" required>
</div>
<div id="mce-responses" class="clear foot">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div>
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_e2d5faa9b94a0d751d430e84b_28f961ba01" tabindex="-1" value=""></div>
<div class="optionalParent">
<div class="clear foot">
<button name="subscribe" id="mc-embedded-subscribe" class="button"><i class="far fa-paper-plane"></i> Senden</button>
</div>
</div>
</div>
</form>
</div>
</body>
</html>

Border color is not changed when click in css pseudo class

I want to change input field border color when use click on it. I want to do it with CSS. So I use pseudo class focus for it. But here are some problem. It works only on select elements not on the element like input type text.
.input-field {
height: 3em;
width: 80%;
padding: .3rem 2rem;
font-size: 14px;
font-weight: 700;
border: 1px solid var(--input-field-color);
border-radius: 5px;
}
.input-group-append {
margin-left: -40px !important;
}
.input-group-text {
background: transparent !important;
border: 0px !important;
}
.signUpButton {
height: 3em;
width: 80%;
border-radius: 50px;
outline: none;
background: linear-gradient(90deg, #EC008C 0%, #FC6767 100%);
border: 0;
font-size: 16px;
font-weight: 600;
cursor: pointer;
}
.input-field:focus {
border-color: var(--input-field-focus-color) !important;
transition: border-color .20s ease-in;
}
.input-field:active {
border-color: var(--input-field-focus-color) !important;
transition: border-color .20s ease-in;
}
<form>
<div class="form-header">
<input type="text" class="input-field" placeholder="john">
</div>
<div class="form-header">
<input type="text" class="input-field" placeholder="abc#example.com">
</div>
<div class="form-header">
<select class="input-field" name="gender">
<option value="male"> Male</option>
<option value="female"> Female</option>
</select>
</div>
<div class="form-header">
<select name="country" class="input-field">
<option> India </option>
</select>
</div>
<div class="form-header">
<div class="input-group">
<input type="password" class="input-field" placeholder="#########" />
<div class="input-group-append">
<span class="input-group-text"> <i class="fas fa-lock"> </i> </span>
</div>
</div>
</div>
<div class="form-header">
<input type="submit" class="signUpButton" name="submit" />
</div>
</form>
Add some color to css variables
like this
--input-field-color:#ccc;
--input-field-focus-color:#00cc00;
Are you something like this.
body{
--input-field-color:#ccc;
--input-field-focus-color:#00cc00;
}
.input-field {
height: 3em;
width: 80%;
padding: .3rem 2rem;
font-size: 14px;
font-weight: 700;
border: 1px solid var(--input-field-color);
border-radius: 5px;
}
.input-group-append {
margin-left: -40px !important;
}
.input-group-text {
background: transparent !important;
border: 0px !important;
}
.signUpButton {
height: 3em;
width: 80%;
border-radius: 50px;
outline: none;
background: linear-gradient(90deg, #EC008C 0%, #FC6767 100%);
border: 0;
font-size: 16px;
font-weight: 600;
cursor: pointer;
}
.input-field:focus,.input-field:active{
border-color: var(--input-field-focus-color) !important;
transition: border-color .20s ease-in;
}
<form>
<div class="form-header">
<input type="text" class="input-field" placeholder="john">
</div>
<div class="form-header">
<input type="text" class="input-field" placeholder="abc#example.com">
</div>
<div class="form-header">
<select class="input-field" name="gender">
<option value="male"> Male</option>
<option value="female"> Female</option>
</select>
</div>
<div class="form-header">
<select name="country" class="input-field">
<option> India </option>
</select>
</div>
<div class="form-header">
<div class="input-group">
<input type="password" class="input-field" placeholder="#########" />
<div class="input-group-append">
<span class="input-group-text"> <i class="fas fa-lock"> </i> </span>
</div>
</div>
</div>
<div class="form-header">
<input type="submit" class="signUpButton" name="submit" />
</div>
</form>

Move form box to right on fullsize banner

I would like to move my form box to the right, but I tried to adjust on everything, but the result is that the box is jumping around. I tried to adjust the bootstrap col-md also.
Can anybody see how I can move the form box to the right?
[![Form box][1]][1]
<!-- Baggrundsbillede --> .fullscreen {
width: 100%;
min-height: 100%;
background-repeat: no-repeat;
background-position: 50% 50%;
background-position: 50% 50%\9 !important;
background-image: url(../../../img/landingpages/dummypictures/fullsize_bg.jpg);
}
.overlay {
background-color: rgba(0, 0, 0, 0.5);
position: relative;
width: 100%;
height: 100%;
display: block;
}
.signup-header {
margin: 150px 0 100px;
background: rgba(255, 255, 255, 0.2);
border-radius: 4px;
padding-left: 20px;
padding-right: 20px;
height: 420px;
}
.signup-header h3 {
padding: 20px 0 10px;
color: white;
font-weight: 300;
}
.form-header input {
position: relative;
padding: 5px 15px;
}
.form-header .form-control {
border-radius: 0;
border: solid 1px #dadada;
background-color: #fff;
color: #333;
height: 55px;
}
.form-header .btn {
border-radius: 0;
height: 55px;
width: 100%;
background-color: #3eb0f7;
color: white;
font-size: 17px !important;
padding: 0 33px;
border: none;
margin: 0;
-webkit-transition: all .8s ease;
transition: all .8s ease;
}
.form-header .btn:hover {
background-color: #1f96e0;
-webkit-transition: all .8s ease;
transition: all .8s ease;
}
.signup-header p {
color: white;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="fullscreen landing parallax">
<div class="overlay">
<div class="container">
<div class="row">
<div class="col-md-7">
<!-- /.logo -->
<div class="logo">
<a href="https://site.dk/">
<img src="~/img/site-logo-white-small.png" alt="logo">
</a>
</div>
<!-- Hovedoverskrift -->
<h1>
Fremtidens B2B salgsorganisation
</h1>
<!-- Underoverskrift -->
<div>
<p>Ny teknologi har for altid ændret den måde indkøbet sker på B2B markedet. Dette stiller helt store krav til den salgsansvarlige i forhold til den måde der skal sælges på. Dette inspirationssemenar giver dig indblik i hvordan fremtidens effektive
salgsorgisation ser ud</p>
</div>
</div>
<!-- Form -->
<div class="col-md-5">
<div class="signup-header">
<h3 class="form-title text-center">TILMELD GRATIS SEMINAR</h3>
<div class="sign-up">
<form id="seminarform">
<div class="form-group">
<label class="sr-only" for="name">Fornavn</label>
<input type="text" class="form-control" id="name" name="name" placeholder="Fornavn" required />
</div>
<div class="form-group">
<label class="sr-only" for="email">E-mail</label>
<input type="email" class="form-control" id="email" name="email" placeholder="E-mail" required />
</div>
<div class="form-group">
<label class="sr-only" for="phone">Telefon</label>
<input type="text" class="form-control" id="phone" name="phone" placeholder="Mobil" required />
</div>
<div class="form-group">
<label class="sr-only" for="company">Virksomheden her</label>
<input type="text" class="form-control" id="company" name="company" placeholder="Virksomhed" required />
</div>
<div class="form-group">
<label class="sr-only" for="challenges">Din største udfordring</label>
<select id="challenges" name="challenges" class="form-control" required>
<option>Arbejdsområde</option>
<option>Salg</option>
<option>Marketing</option>
<option>Ledelse</option>
<option>Konsulent</option>
<option>Andet</option>
</select>
</div>
<input type="text" id="Channel" name="Channel" style="display: none;" />
<input type="text" id="Campaign" name="Campaign" style="display: none;" />
<input type="submit" class="btn btn-default active btn-block btn-lg" value="Tilmeld">
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
Option 1:
Make a look-a-like, by giving a width to the text in the left column like so:
p { width: 90%; }
Option 2
Which is better,
adjust the columns, change col-md-7 into col-md-6 and change col-md-5 (the form) into col-md-4 col-md-push-1 this will push the form 1 column to the right.

How can I create a responsive side by side form?

I'm looking for the best way to go about a side by side form.
I've done mine in a responsive grid which apparently isn't viable as I am using two separate form tags.
Here is what I've come up with so far.
http://jsfiddle.net/pentester/aFP68/
Any Help Would be greatly appreciated.
<div class="section group">
<div class="col span_1_of_2">
<div class="formwrap">
<form method="post" action="contact.php">
<input type="text" name="name" id="name" placeholder="Name" required />
<input type="text" name="company" id="company" placeholder="Company" required />
<input type="text" name="email" id="email" placeholder="Email" required />
<input type="text" name="phone" id="phone" placeholder="Phone Number" required />
<p class="submit">
<input id="submit" name="submit" type="submit" value="Send" />
</p>
</form>
</div>
</div>
<div class="col span_1_of_2">
<div class="formwrap">
<form method="post" action="contact.php">
<select name="new_or_upgrade" id="new_or_upgrade" placeholder="Type of website">
<option value="Type">Type of website</option>
<option value="normal">Normal</option>
<option value="cms">Content Management Site</option>
<option value="upgrade">E Commerce</option>
</select>
<textarea name="message" placeholder="Tell us about your project" required /></textarea>
</form>
</div>
</div>
/*Form*/
select{
width:100%;
padding:0.5em;
border:1px solid #F2F2F2;
margin-top: 0.5em;}
.formwrap {
margin: auto;
max-width: 70em;
padding: 0 0.5em;
}
.formwrap p {
font-family: sans;
font-weight: 100;
font-size: 1em;
margin: 0;
}
form {
clear: both;
float: left;
width: 100%;
margin: 0 auto;
}
input,
textarea {
padding: 10px;
border: 1px solid #EFEFEF;
width: 100%;
color: #000;
margin-top: 0.5em;
border-radius:3px;
}
textarea {
width: 100%;
height: 150px;
line-height: 18px;
}
input:focus,
textarea:focus {
border: 1px solid #21ABD3;
transition: all 0.2s ease;
}
form label {
margin-left: 1em;
color: #000;
}
.submit input {
background-color: #1D8FBB;
width: 6em;
color: #FFF;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset;
border: none;
float: left;
transition: none;
border-radius: 3px;
font-family:opensans
}
.submit input:hover {
background-color: #34A2CD;
transition: all 0.2s ease;
}
.submit input:active {
box-shadow: 0 0 3px rgba(51, 51, 51, 0.61) inset;
}
/* SECTIONS */
.section {
clear: both;
padding: 0px;
margin: 0px;
}
/* COLUMN SETUP */
.col {
display: block;
float: left;
margin: 1% 0 1% 1%;
}
.col:first-child {
margin-left: 0;
}
/* GROUPING */
.group:before,
.group:after {
content: "";
display: table;
}
.group:after {
clear: both;
}
.group {
zoom: 1; /* For IE 6/7 */
}
/* GRID OF TWO */
.span_2_of_2 {
width: 100%;
}
.span_1_of_2 {
width: 49.5%;
}
/* GO FULL WIDTH AT LESS THAN 600 PIXELS */
#media only screen and (max-width: 800px) {
.col {
margin: 0;
}
}
#media only screen and (max-width: 800px) {
.span_2_of_2 {
width: 100%;
}
.span_1_of_2 {
width: 100%;
}
}
#media only screen and (max-width: 600px) {
.block{
padding:0.5em 1em}
}
There are a lot of way to create responsive layout. For me, I would like to use Bootstrap.
http://jsfiddle.net/wrcuv/
Here is the example,
<link rel="stylesheet" type="text/css" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" />
<div class="container">
<form method="post" action="contact.php" class="form">
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<input type="text" name="name" id="name" placeholder="Name" class="form-control" required />
</div>
<div class="form-group">
<input type="text" name="company" id="company" placeholder="Company" class="form-control" required />
</div>
<div class="form-group">
<input type="text" name="email" id="email" placeholder="Email" class="form-control" required />
</div>
<div class="form-group">
<input type="text" name="phone" id="phone" placeholder="Phone Number" class="form-control" required />
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<select name="new_or_upgrade" id="new_or_upgrade" class="form-control" placeholder="Type of website">
<option value="Type">Type of website</option>
<option value="normal">Normal</option>
<option value="cms">Content Management Site</option>
<option value="upgrade">E Commerce</option>
</select>
</div>
<div class="form-group">
<textarea name="message" placeholder="Tell us about your project" class="form-control" required /></textarea>
</div>
</div>
</div>
<div class="row text-center">
<input id="submit" name="submit" type="submit" value="Send" class="btn btn-primary" />
</div>
</form>
</div>

Input forms not aligning correctly in Safari

I am currently working on a page Here
I am trying to style the form to be aligned as it is displayed in chrome.
I am sure my way of doing this is out of the park wrong but my styling is working in everything but safari and I cannot figure out why
This is the current code I am using....
<div>
<div>
<br />
<div class="required-notice">
<span class="required-star">*</span><span> = Required Field</span>
</div>
<div class="loan-form-body">
<div>
<span>First Name:</span><span class="required-star">*</span>
</div>
<div>
<input type="text" name="FirstName" id="firstname" class="validate required" style="width: 200px;" />
</div>
<div>
<span>Email Address:</span><span class="required-star">*</span>
</div>
<div>
<input type="text" name="EmailAddress" id="emailaddress" class="validate required" style="width: 200px;" />
</div>
<div>
<span>Address:</span><span class="required-star">*</span>
</div>
<div>
<input type="text" name="HomeAddress" id="HomeAddress" class="validate required" style="width: 430px;" />
</div>
<div>
<div>
<span style="text-align: left; position: absolute; margin-left: 40%; margin-top:-21%;">
Last Name:
<span class="required-star">*</span>
</span>
</div>
<div>
<input type="text" name="LastName" id="lastname" style="width: 200px; position: absolute; margin-left: 40%; margin-top: -18%;" />
</div>
<div style="position: absolute; margin-left: 40%; margin-top: -14%;">
Work Phone:
</div>
<div>
<input type="text" name="DaytimePhone" id="daytimephone" style="width: 200px; position: absolute; margin-left: 40%; margin-top: -10.7%;" />
</div>
</div>
<div class="submit">
<input type="submit" style="width: auto; outline: none; -webkit-appearance: none;" onclick="return validate();" class="button" data-form-type="submit" value="Get An Instant Report" />
</div>
Pardon the messy code.
I fixed your code a little and made some CSS, here's a FIDDLE
<form name="loan-form" class="loan-form" action="#">
<div class="required-notice">
<span class="required-star">*</span>= Required Field
</div>
<div class="loan-form-body">
<label>First Name:<span class="required-star">*</span></label>
<input type="text" name="FirstName" id="firstname" class="validate required" />
<label>Email Address:<span class="required-star">*</span></label>
<input type="text" name="EmailAddress" id="emailaddress" class="validate required" />
<label>Address:<span class="required-star">*</span></label>
<input type="text" name="HomeAddress" id="HomeAddress" class="validate required" />
<label>Last Name:<span class="required-star">*</span></label>
<input type="text" name="LastName" id="lastname" />
<label>Work Phone:</label>
<input type="text" name="DaytimePhone" id="daytimephone" />
<input type="submit" onclick="return validate();" class="button" data-form-type="submit" value="Get An Instant Report" />
</div>
</form>
.loan-form {
width: 400px;
padding: 10px;
font-family: Sans-serif;
font-size: 16px;
border: 1px solid #ddd;
}
.loan-form label {
float: left;
clear: left;
width: 150px;
}
.loan-form input[type="text"] {
float: left;
width: 200px;
margin: 0 0 12px;
padding: 2px 4px;
border: 1px solid #ddd;
outline: none;
transition: box-shadow 0.2s ease-in-out;
-moz-transition: box-shadow 0.2s ease-in-out;
-webkit-transition: box-shadow 0.2s ease-in-out;
}
.loan-form input[type="text"]:focus {
box-shadow: 0 0 3px 0 #333;
-moz-box-shadow: 0 0 3px 0 #333;
-webkit-box-shadow: 0 0 3px 0 #333;
}
.loan-form input[type="submit"] {
display: block;
width: 160px;
height: 26px;
margin: 0 auto;
}
.required-notice {
padding: 7px;
margin: 0 0 15px;
}
.required-star {
vertical-align: top;
margin: 0 3px;
font-size: 12px;
color: red;
}
just finish styling by you wish.