I have simple form, it is styled in css. JSfiddle link : here
<form action="" method="post" class="basic-grey">
<h1>Report a problem
</h1>
<label>
<span>Your Name :</span>
<input id="name" type="text" name="name" placeholder="Your Name" />
</label>
<label>
<span>Your Email :</span>
<input id="email" type="email" name="email" placeholder="Valid Email Address" />
</label>
<label>
<span>Message :</span>
<textarea id="message" name="message" placeholder="Specify The Problem"></textarea>
</label>
<label>
<span>Subject :</span><select name="selection">
<option value="Job Inquiry">Job Inquiry</option>
<option value="General Question">General Question</option>
</select>
</label>
<label>
<span> </span>
<input type="submit" name="submit" value="Submit" class="button">
</label>
</form>
Here is css style. Problem is that button have big hover area (on left side). I upload example on webhosting. here you can see what i think I tried position:absolute for button but i can not change position. Position:relative does not work too.
.basic-grey {
margin-left:auto;
margin-right:auto;
max-width: 500px;
padding: 25px 15px 25px 10px;
font: 12px Georgia, "Times New Roman", Times, serif;
color: #000;
text-shadow: 1px 1px 1px #FFF;
}
.basic-grey h1 {
font-size: 25px;
padding: 0px 0px 10px 40px;
display: block;
border-bottom:1px solid #C9C9C9;
margin: -10px -15px 30px -10px;;
color: #000;
}
.basic-grey h1>span {
display: block;
font-size: 11px;
}
.basic-grey label {
margin: 0px;
}
.basic-grey label>span {
float: left;
width: 20%;
text-align: right;
padding-right: 10px;
margin-top: 10px;
color: #000;
}
.basic-grey input[type="text"], .basic-grey input[type="email"], .basic-grey textarea, .basic-grey select {
border: 1px solid #DADADA;
color: #000;
height: 30px;
margin-bottom: 16px;
margin-right: 6px;
margin-top: 2px;
outline: 0 none;
padding: 3px 3px 3px 5px;
width: 70%;
font-size: 12px;
line-height:15px;
box-shadow: inset 0px 1px 4px #ECECEC;
-moz-box-shadow: inset 0px 1px 4px #ECECEC;
-webkit-box-shadow: inset 0px 1px 4px #ECECEC;
}
.basic-grey textarea{
padding: 5px 3px 3px 5px;
}
.basic-grey select {
appearance:none;
-webkit-appearance:none;
-moz-appearance: none;
text-indent: 0.01px;
text-overflow: '';
width: 70%;
height: 35px;
line-height: 25px;
}
.basic-grey textarea{
height:100px;
}
.basic-grey.button {
opacity:0.7;
background: #55596C;
padding: 10px 15px 10px 15px;
color: #FFF;
box-shadow: 1px 1px 5px #B6B6B6;
border-radius: 3px;
text-shadow: 1px 1px 1px #000;
cursor: pointer;
}
.basic-grey.button:hover {
opacity:0.7;
background: #373E4D;
}
It's caused by the <label></label> that your button is enclosed in. Just enclose it in a div instead:
<div>
<span> </span>
<input type="submit" name="submit" value="Submit" class="button">
</div>
If you want this div to look the same as the label, you can give it a css class, e.g. class="label" and assign the same CSS properties to "div.label" and "label".
Remove span before input and set margin-left for input. jsfiddle
<label>
<input style="margin-left: 110px" type="submit" name="submit" value="Submit" class="button">
</label>
Related
I'm trying to left align labels keeping input-fields right-aligned without success!
I was able to align labels or input-fields but not both of them! I've tried a lot of things but nothing worked
html:
<body style="background-color:lightgray;">
<center> <div class="form-style-2">
<div class="form-style-2-heading">Info</div>
<form action="" method="POST">
<label for="cod"><span>Cod <span class="required">*</span></span><input type="text" class="input-field" name="cod" value="" /></label>
<label for="name" ><span>Name <span class="required">*</span></span><input type="text" class="input-field" name="name" value="" /></label>
<label for="phone"><span>Phone <span class="required">*</span></span><input type="text" class="input-field" name="phone" value="" /></label>
<label for="address"><span>Address <span class="required">*</span></span><input type="text" class="input-field" name="address" value="" /></label>
<label><span> </span><input type="submit" value="Submit" /></label>
</form></center>
</div>
</body>
css
.form-style-2{
max-width: 500px;
padding: 20px 12px 10px 20px;
font: 13px Arial, Helvetica, sans-serif;
}
.form-style-2-heading{
font-weight: bold;
font-style: italic;
border-bottom: 2px solid #000;
margin-bottom: 20px;
font-size: 15px;
padding-bottom: 3px;
}
.form-style-2 label{
display: block;
margin: 0px 0px 15px 0px;
}
.form-style-2 label > span{
width: 100px;
font-weight: bold;
float: left;
padding-top: 8px;
padding-right: 5px;
}
.form-style-2 span.required{
color:red;
}
.form-style-2 input.input-field{
width: 48%;
}
.form-style-2 input.input-field,
.form-style-2 .textarea-field{
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
border: 1px solid #C2C2C2;
box-shadow: 1px 1px 4px #EBEBEB;
-moz-box-shadow: 1px 1px 4px #EBEBEB;
-webkit-box-shadow: 1px 1px 4px #EBEBEB;
border-radius: 3px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
padding: 7px;
outline: none;
}
.form-style-2 .input-field:focus,
.form-style-2 .textarea-field:focus{
border: 1px solid #0C0;
}
.form-style-2 .textarea-field{
height:100px;
width: 55%;
}
.form-style-2 input[type=submit],
.form-style-2 input[type=button]{
border: none;
padding: 8px 15px 8px 15px;
background: #4CAF50;
color: #fff;
box-shadow: 1px 1px 4px #DADADA;
-moz-box-shadow: 1px 1px 4px #DADADA;
-webkit-box-shadow: 1px 1px 4px #DADADA;
border-radius: 3px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
}
.form-style-2 input[type=submit]:hover,
.form-style-2 input[type=button]:hover{
background: #EA7B00;
color: #fff;
}
jfiddle: https://jsfiddle.net/uv21fc5o/
You don't want to use the <center> tag. Try using auto margins as I've done here:
https://jsfiddle.net/uv21fc5o/1/
.form-style-2{
max-width: 500px;
padding: 20px 12px 10px 20px;
font: 13px Arial, Helvetica, sans-serif;
margin: 0 auto;
}
Align the text left like so:
CSS
.form-style-2 label > span {
text-align: left;
}
<div class="Login">
<input type="text" placeholder="Full Name" id="Full Name">
<input type="password" placeholder="Password" id="Password">
forgot password?
<input type="submit" value="Sign In">
</div>
That's my code above but boxes are too far apart. I want them within a few px of each other. I have tried changing the margin and padding on my .css file with no luck. Here is my css below;
.Login {
background: #eceeee;
border: 1px solid #42464b;
border-radius: 6px;
height: 242px;
margin: 15px auto 0;
margin-top: 6px;
width: 288px;
padding-top: 6px;
padding-bottom: 1px;
padding-right: 10px;
}
.Login h1 {
background-image: linear-gradient(top, #f1f3f3, #d4dae0);
border-bottom: 1px solid #a6abaf;
border-radius: 6px 6px 0 0;
box-sizing: border-box;
color: #727678;
display: block;
height: 43px;
font: 600 14px/1 'Open Sans', sans-serif;
padding-top: 6px;
padding-bottom: 1px;
margin: 0px;
text-align: center;
text-shadow: 0 -1px 0 rgba(0,0,0,0.2), 0 1px 0 #fff;
what do I code do I need to change or add to make them closer?
Thanks :)
If you want the input boxes to be closer, you just have to add a negative margin.
.Login > input {
margin-right: -3px;
}
https://jsfiddle.net/do6qhg74/
Or you use float to position the elements next to each other:
.Login > input {
float: left;
}
https://jsfiddle.net/3eq7jwwk/
I changed your code a little bit
.Login {
background: #eceeee;
border: 1px solid #42464b;
border-radius: 6px;
height: 242px;
margin: 15px auto 0;
margin-top: 6px;
width: 500px;
padding-top: 6px;
padding-bottom: 1px;
padding-right: 10px;
text-align:center;
}
.Login h1 {
background-image: linear-gradient(top, #f1f3f3, #d4dae0);
border-bottom: 1px solid #a6abaf;
border-radius: 6px 6px 0 0;
box-sizing: border-box;
color: #727678;
display: block;
height: 43px;
font: 600 14px/1 'Open Sans', sans-serif;
padding-top: 6px;
padding-bottom: 1px;
margin: 0px;
text-align: center;
text-shadow: 0 -1px 0 rgba(0,0,0,0.2), 0 1px 0 #fff; }
.submit, .password {
margin-left:-3px;
}
<div class="Login">
<input type="text" placeholder="Full Name" id="Full Name">
<input class="password" type="password" placeholder="Password" id="Password">
<input class="submit" type="submit" value="Sign In"><br><br>
forgot password?
</div>
(Just press Run snippet)
I've got a simple problem that I swear I've done a hundred times but I guess I need another pair of eyes.
I have a table, enter email text field and an add-email button all in a box. When I add more emails to the table it pushes out the text field and button outside of the box. The text field and button need to be side by side.
<div class="cc_halfblock">
<div class="dropshadow">
<div class="dropshadow-heading">
Heading
</div>
<form id="emailform" name="emailform" method="POST">
<table class="cc_table">
<tbody>
<tr>
<td>
foo#bar.com
</td>
<td>
<button class="deletebutton cc_icon_button" name="delete_email"
value="Delete" title="Delete this email"
</button>
<input type="hidden" name="email_address" value="" />
</td>
</tr>
...
</tbody>
</table>
</form>
<div class="cc_margintop">
<form id="addemailform" name="addemailform" method="POST">
<div class="cc_separator">
<input type="text" size="24" maxlength="64" name="add_email" placeholder="Enter email" id="add_email" />
</div>
<div class="cc_separator">
<button class="addbutton cc_button_enable pull-right" name="submitemail">Add Email</button>
</div>
<div id="cc_emailerrors"></div>
</form>
</div>
</div>
</div>
CSS:
.cc_button_enable {
margin-bottom: 5px;
float: left;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
border-top-right-radius: 4px;
border-top-left-radius: 4px;
border: 1px solid #999;
cursor: pointer;
display: inline-block;
line-height: normal;
margin-right: 0.1em;
overflow: visible;
padding: 0;
position: relative;
text-align: center;
vertical-align: middle;
padding: 0.4em 1em;
font-family: Lucida Grande,Lucida Sans Unicode,Arial,Verdana,sans-serif;
font-size: 1.1em;
}
.dropshadow-heading {
background-color: #cccccc;
color: #28292A;
font-size: 22px;
padding: 10px 15px;
text-transform: uppercase;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
font-family: 'Open Sans', sans-serif;
}
.dropshadow-body {
padding: 1px 15px 15px 15px;
font-family: 'Open Sans', sans-serif;
}
.dropshadow {
font-family: 'Open Sans', sans-serif;
-moz-border-radius: 5px;
border-radius: 5px;
-moz-box-shadow: 5px 5px 5px #ccc;
-webkit-box-shadow: 5px 5px 5px #ccc;
box-shadow: 5px 5px 5px #ccc;
min-height: 200px;
margin-left:15px;
margin-bottom:15px;
background-color:#ffffff;
border: 1px solid #CCCCCC;
}
.cc_table {
border-collapse: collapse;
font-family: 'Open Sans', sans-serif;
font-size: 12px;
table-layout: auto;
text-align: left;
white-space: nowrap;
/* display:inline-block; */
width: 100%;
}
.cc_table th
{
background: none repeat scroll 0 0 rgb(230, 230, 230);
border-bottom: 1px solid #2B3D61;
border-top: 2px solid white;
color: rgb(165, 165, 165);
font-size: 14px;
font-weight: normal;
padding: 8px;
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}
.cc_table td {
background: none repeat scroll 0 0 #ffffff;
border-bottom: 1px solid #2B3D61;
border-top: 1px solid transparent;
color: #333333;
padding: 8px;
}
.cc_table tr:hover td {
background: none repeat scroll 0 0 #a8cb17;
color: #333399;
}
/* Used for spacing between form fields and buttons */
.cc_separator {
float: left;
margin-left: 10px;
}
/* generic spacing for divs on top */
.cc_margintop {
margin-top: 25px;
}
#addemailform label.error {
color: red;
display: block;
}
/* generic float left */
.cc_floatleft {
float: left;
}
/* blocks used for main content */
.cc_halfblock {
width:45%;
float: left;
margin-left: 20px;
min-height: 1px;
}
Fiddle to play with: http://jsfiddle.net/rkkw6uvg/1/
You have some floating elements inside .cc_margintop, so they'll break their parents bouds and cause a mess.
You need to clear those floats, so here are some possible solutions depending on your requirements:
add a overflow:hidden rule on .cc_margintop
use a good old clearfix method on .cc_margintop like so:
Check out the solution and the clearfix bellow:
.cc_margintop:after{
content: '';
display: table;
clear: both;
}
.cc_button_enable {
margin-bottom: 5px;
float: left;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
border-top-right-radius: 4px;
border-top-left-radius: 4px;
border: 1px solid #999;
cursor: pointer;
display: inline-block;
line-height: normal;
margin-right: 0.1em;
overflow: visible;
padding: 0;
position: relative;
text-align: center;
vertical-align: middle;
padding: 0.4em 1em;
font-family: Lucida Grande,Lucida Sans Unicode,Arial,Verdana,sans-serif;
font-size: 1.1em;
}
.dropshadow-heading {
background-color: #cccccc;
color: #28292A;
font-size: 22px;
padding: 10px 15px;
text-transform: uppercase;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
font-family: 'Open Sans', sans-serif;
}
.dropshadow-body {
padding: 1px 15px 15px 15px;
font-family: 'Open Sans', sans-serif;
}
.dropshadow {
font-family: 'Open Sans', sans-serif;
-moz-border-radius: 5px;
border-radius: 5px;
-moz-box-shadow: 5px 5px 5px #ccc;
-webkit-box-shadow: 5px 5px 5px #ccc;
box-shadow: 5px 5px 5px #ccc;
min-height: 200px;
margin-left:15px;
margin-bottom:15px;
background-color:#ffffff;
border: 1px solid #CCCCCC;
}
.cc_table {
border-collapse: collapse;
font-family: 'Open Sans', sans-serif;
font-size: 12px;
table-layout: auto;
text-align: left;
white-space: nowrap;
/* display:inline-block; */
width: 100%;
}
.cc_table th
{
background: none repeat scroll 0 0 rgb(230, 230, 230);
border-bottom: 1px solid #2B3D61;
border-top: 2px solid white;
color: rgb(165, 165, 165);
font-size: 14px;
font-weight: normal;
padding: 8px;
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}
.cc_table td {
background: none repeat scroll 0 0 #ffffff;
border-bottom: 1px solid #2B3D61;
border-top: 1px solid transparent;
color: #333333;
padding: 8px;
}
.cc_table tr:hover td {
background: none repeat scroll 0 0 #a8cb17;
color: #333399;
}
/* Used for spacing between form fields and buttons */
.cc_separator {
float: left;
margin-left: 10px;
}
/* generic spacing for divs on top */
.cc_margintop {
margin-top: 25px;
overflow: hidden;/*clear those pesky floats*/
}
#addemailform label.error {
color: red;
display: block;
}
/* generic float left */
.cc_floatleft {
float: left;
}
/* blocks used for main content */
.cc_halfblock {
width:45%;
float: left;
margin-left: 20px;
min-height: 1px;
}
<div class="cc_halfblock">
<div class="dropshadow">
<div class="dropshadow-heading">
Heading
</div>
<form id="emailform" name="emailform" method="POST">
<table class="cc_table">
<tbody>
<tr>
<td>
foo#bar.com
</td>
<td>
<button class="deletebutton cc_icon_button" name="delete_email"
value="Delete" title="Delete this email"
</button>
<input type="hidden" name="email_address" value="" />
</td>
</tr>
<tr>
<td>
foo1#bar.com
</td>
<td>
<button class="deletebutton cc_icon_button" name="delete_email"
value="Delete" title="Delete this email"
</button>
<input type="hidden" name="email_address" value="" />
</td>
</tr>
<tr>
<td>
foo2#bar.com
</td>
<td>
<button class="deletebutton cc_icon_button" name="delete_email"
value="Delete" title="Delete this email"
</button>
<input type="hidden" name="email_address" value="" />
</td>
</tr>
<tr>
<td>
foo3#bar.com
</td>
<td>
<button class="deletebutton cc_icon_button" name="delete_email"
value="Delete" title="Delete this email"
</button>
<input type="hidden" name="email_address" value="" />
</td>
</tr>
<tr>
<td>
foo4#bar.com
</td>
<td>
<button class="deletebutton cc_icon_button" name="delete_email"
value="Delete" title="Delete this email"
</button>
<input type="hidden" name="email_address" value="" />
</td>
</tr>
</tbody>
</table>
</form>
<div class="cc_margintop">
<form id="addemailform" name="addemailform" method="POST">
<div class="cc_separator">
<input type="text" size="24" maxlength="64" name="add_email" placeholder="Enter email" id="add_email" />
</div>
<div class="cc_separator">
<button class="addbutton cc_button_enable pull-right" name="submitemail">Add Email</button>
</div>
<div id="cc_emailerrors"></div>
</form>
</div>
</div>
</div>
Your Answer: http://jsfiddle.net/rkkw6uvg/2/
I took out two floats and didn't even need to clear anything.
First float I took out was in this class: .cc_button_enable
Second: In the class: .cc_separator
See the below code.
Tag <input type='button' /> is self closing, don't use <button></button>
Pay attention on the class dropshadow. I added clear: both; and display: inline-block; to solve your specific problem.
.cc_button_enable {
margin-bottom: 5px;
float: left;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
border-top-right-radius: 4px;
border-top-left-radius: 4px;
border: 1px solid #999;
cursor: pointer;
display: inline-block;
line-height: normal;
margin-right: 0.1em;
overflow: visible;
padding: 0;
position: relative;
text-align: center;
vertical-align: middle;
padding: 0.4em 1em;
font-family: Lucida Grande,Lucida Sans Unicode,Arial,Verdana,sans-serif;
font-size: 1.1em;
}
.dropshadow-heading {
background-color: #cccccc;
color: #28292A;
font-size: 22px;
padding: 10px 15px;
text-transform: uppercase;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
font-family: 'Open Sans', sans-serif;
}
.dropshadow-body {
padding: 1px 15px 15px 15px;
font-family: 'Open Sans', sans-serif;
}
.dropshadow {
clear: both;
display: inline-block;
font-family: 'Open Sans', sans-serif;
-moz-border-radius: 5px;
border-radius: 5px;
-moz-box-shadow: 5px 5px 5px #ccc;
-webkit-box-shadow: 5px 5px 5px #ccc;
box-shadow: 5px 5px 5px #ccc;
/* min-height: 290px; */
margin-left:15px;
margin-bottom:15px;
background-color:#ffffff;
border: 1px solid #CCCCCC;
}
.cc_table {
border-collapse: collapse;
font-family: 'Open Sans', sans-serif;
font-size: 12px;
table-layout: auto;
text-align: left;
white-space: nowrap;
/* display:inline-block; */
width: 100%;
}
.cc_table th
{
background: none repeat scroll 0 0 rgb(230, 230, 230);
border-bottom: 1px solid #2B3D61;
border-top: 2px solid white;
color: rgb(165, 165, 165);
font-size: 14px;
font-weight: normal;
padding: 8px;
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}
.cc_table td {
background: none repeat scroll 0 0 #ffffff;
border-bottom: 1px solid #2B3D61;
border-top: 1px solid transparent;
color: #333333;
padding: 8px;
}
.cc_table tr:hover td {
background: none repeat scroll 0 0 #a8cb17;
color: #333399;
}
/* Used for spacing between form fields and buttons */
.cc_separator {
float: left;
margin-left: 10px;
}
/* generic spacing for divs on top */
.cc_margintop {
margin-top: 25px;
}
#addemailform label.error {
color: red;
display: block;
}
/* generic float left */
.cc_floatleft {
float: left;
}
/* blocks used for main content */
.cc_halfblock {
width:45%;
float: left;
margin-left: 20px;
min-height: 1px;
}
<div class="cc_halfblock">
<div class="dropshadow">
<div class="dropshadow-heading">
Heading
</div>
<form id="emailform" name="emailform" method="POST">
<table class="cc_table">
<tr>
<td>foo#bar.com</td>
<td>
<button class="deletebutton cc_icon_button" name="delete_email" value="Delete" title="Delete this email" />
<input type="hidden" name="email_address" value="" />
</td>
</tr>
<tr>
<td>foo1#bar.com</td>
<td>
<button class="deletebutton cc_icon_button" name="delete_email" value="Delete" title="Delete this email" />
<input type="hidden" name="email_address" value="" />
</td>
</tr>
<tr>
<td>foo2#bar.com</td>
<td>
<button class="deletebutton cc_icon_button" name="delete_email" value="Delete" title="Delete this email" />
<input type="hidden" name="email_address" value="" />
</td>
</tr>
<tr>
<td>foo3#bar.com</td>
<td>
<button class="deletebutton cc_icon_button" name="delete_email" value="Delete" title="Delete this email" />
<input type="hidden" name="email_address" value="" />
</td>
</tr>
<tr>
<td>foo4#bar.com</td>
<td>
<button class="deletebutton cc_icon_button" name="delete_email" value="Delete" title="Delete this email" />
<input type="hidden" name="email_address" value="" />
</td>
</tr>
</table>
</form>
<div class="cc_margintop">
<form id="addemailform" name="addemailform" method="POST">
<div class="cc_separator">
<input type="text" size="24" maxlength="64" name="add_email" placeholder="Enter email" id="add_email" />
</div>
<div class="cc_separator">
<div class="addbutton cc_button_enable pull-right" name="submitemail">Add Email</div>
</div>
<div id="cc_emailerrors"></div>
</form>
</div>
</div>
</div>
I am trying to align 2 inputs on top of eachover next to another 2 inputs on top of each other. Here is what it keeps giving me:
http://prntscr.com/33k6bq
It seems to have no problems with 2 of them, but with another 2 next to them it just doesn't want to work.
Here is the style for them:
CSS:
.loginbutton {
font-family: 'Nunito';
color: #fff;
font-size: 16px;
background-image: url(../images/gradient.png);
background-position: 0, center;
display: inline-block;
background-color: #81bb0f;
height: 71px;
width: 100px;
margin-left: 10px;
box-shadow:0 0 0 1px rgba(0,0,0,.25) inset,0 0 0 2px rgba(255,255,255,.25) inset;
border: 1px solid #919191;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 2px;
padding: 10px
}
HTML:
<form method="post" id="phase-0-form">
<input type="text" id="habbo-name" placeHolder="Username" size="35" value="<?php echo $template->form->reg_username; ?>" name="reg_username" class="logintext" maxlength="32">
<input type="text" id="email" size="35" placeHolder="Email" name="reg_email" value="<?php echo $template->form->reg_email; ?>" class="logintext" maxlength="48"><br>
<input type="password" id="password" placeHolder="Password" size="35" name="reg_password" value="" class="logintext" maxlength="32" style="float: left;">
<input type="password" id="password2" placeHolder="Confirm Password" size="35" name="reg_rep_password" value="" class="logintext" maxlength="32">
<input type="password" id="seckey" size="35" placeHolder="Security Key" name="reg_seckey" value="1111" hidden="yes" class="text-field" maxlength="4" >
<button type="submit" name="register" class="loginbutton" style="float: right">Register NOW</button>
</form>
There are many ways to fix this. With the lack of information you provided, I can suggest you two things:
simply add a line break (<br>) after the second input
put the inputs inside a container and make sure the container's width allow two input fields to fit in, but not three
Updated JSFiddle here
You had a float: right in your CSS (in input.logintext) - this is what was messing it up.
I also removed style="float: left;" from the password input as this is not required
Update: I've re-ordered the fields and added buttons to the divs
HTML:
<div id="logincontainer">
<form method="post" id="phase-0-form">
<div style="float:left;">
<div class="regbutton">Go back to Index</div>
</div>
<div style="float:left;">
<input type="text" id="habbo-name" placeHolder="Username" size="35" value="<?php echo $template->form->reg_username; ?>" name="reg_username" class="logintext" maxlength="32" /><br />
<input type="password" id="password" placeHolder="Password" size="35" name="reg_password" value="" class="logintext" maxlength="32" />
</div>
<div style="float:left;">
<input type="text" id="email" size="35" placeHolder="Email" name="reg_email" value="<?php echo $template->form->reg_email; ?>" class="logintext" maxlength="48" /><br />
<input type="password" id="password2" placeHolder="Confirm Password" size="35" name="reg_rep_password" value="" class="logintext" maxlength="32" />
<input type="password" id="seckey" size="35" placeHolder="Security Key" name="reg_seckey" value="1111" hidden="yes" class="text-field" maxlength="4" />
</div>
<div style="float:left;">
<button type="submit" name="register" class="loginbutton">Register NOW</button>
</div>
</form>
</div>
<div id="container">
<div class="image"></div>
</div>
CSS:
#import url(http://fonts.googleapis.com/css?family=Lato);
#import url(http://fonts.googleapis.com/css?family=Ubuntu);
#import url(http://fonts.googleapis.com/css?family=Nunito);
body {
background: url(../images/bg2.png) repeat-x bottom fixed;
background-color: #3aa4e2;
font-family:'Lato';
margin-top: 70px;
}
#container {
display: block;
top: 0;
left: 0;
bottom: 0;
right: 0;
margin: auto;
height: 371px;
width: 780px;
border: 1px solid #919191;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
background-color: #fff;
padding: 10px;
margin-top: 10px
}
input.logintext {
width: 180px;
height: 12px;
padding: 10px;
border: 1px solid #919191;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 2px;
}
.loginbutton {
font-family:'Nunito';
color: #fff;
font-size: 16px;
background-image: url(../images/gradient.png);
background-position: 0, center;
display: inline-block;
background-color: #81bb0f;
height: 71px;
width: 100px;
margin-left: 10px;
box-shadow:0 0 0 1px rgba(0, 0, 0, .25) inset, 0 0 0 2px rgba(255, 255, 255, .25) inset;
border: 1px solid #919191;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 2px;
padding: 10px
}
.regbutton {
text-align: center;
font-family:'Nunito';
color: #fff;
font-size: 16px;
background-image: url(../images/gradient.png);
background-position: 0, center;
float: left;
display: inline-block;
background-color: #e70505;
height: 37px;
margin-right: 21px;
width: 100px;
box-shadow:0 0 0 1px rgba(0, 0, 0, .25) inset, 0 0 0 2px rgba(255, 255, 255, .25) inset;
border: 1px solid #919191;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 2px;
padding: 16px
}
.fbbutton {
text-align: center;
font-family:'Nunito';
color: #fff;
font-size: 16px;
background-image: url(../images/gradient.png);
background-position: 0, center;
float: left;
display: inline-block;
background-color: #3b5998;
height: 37px;
width: 100px;
box-shadow:0 0 0 1px rgba(0, 0, 0, .25) inset, 0 0 0 2px rgba(255, 255, 255, .25) inset;
border: 1px solid #919191;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 2px;
padding: 16px;
margin-right: 10px
}
.usersonline {
text-align: center;
font-family:'Nunito';
color: #919191;
font-size: 16px;
background-image: url(../images/gradient.png);
background-position: 0, center;
float: left;
display: inline-block;
background-color: #e6e6e6;
height: 37px;
margin-right: 21px;
width: 100px;
box-shadow:0 0 0 1px rgba(0, 0, 0, .25) inset, 0 0 0 2px rgba(255, 255, 255, .25) inset;
border: 1px solid #919191;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 2px;
padding: 16px
}
.loginbutton:hover, .regbutton:hover, .fbbutton:hover, .usersonline:hover {
opacity: 0.8;
}
#logincontainer {
top: 0;
left: 0;
bottom: 0;
right: 0;
margin: auto;
border: 1px solid #919191;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
background-color: #fff;
padding: 10px;
height: 70px;
width: 780px;
}
.image {
background: url(../images/mainimg2.png);
height: 371px;
width: 780px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
Its hard to tell from just css and screenshot, but my guess would be to warp them in div like this:
<div>
<input />
<input />
</div>
<div>
<input />
<input />
</div>
And arrange them later with css
when i try to focus on the form input fields as soon as i release the mouse it is not active..
i am trying a three column web page in which the form is in right panel..
the html code for form-
<div>
<div class="container">
<div class="login">
<h3>Login Window</h3>
<form method="post" action=" ">
<p><input type="text" name="login" value="" placeholder="Username" class="logininput"></p>
<p><input type="password" name="password" value="" placeholder="Password" class="logininput"></p>
<p class="submit"><input type="submit" name="commit" value="Login" class="loginsubmit"></p>
</form>
</div>
<div class="login-help">
<p>Forgot your password</p>
</div>
</div>
</div>
and the css i am using is-
.container {margin:0;
width: 100%;
height:180px;}
.login{position:relative;
margin: 0 auto;
padding:0;
width:100%;
background: white;
border-radius: 3px;
}
.login h3{margin:0;
font-size: 15px;
font-weight: bold;
color: #555;
text-align: center;
text-shadow: 0 2px white;
background: #f3f3f3;
border-bottom: 1px solid #cfcfcf;border-radius: 3px 3px 0 0;
}
.logininput{width: 90%;
height: 30px;
margin: 4px 1px 4px 1px;
padding:0 10px;
color: #404040;
background: white;
border:1px solid #0076a3;
border-top-left-radius: 5px 5px;
border-bottom-left-radius: 5px 5px;
font-family: 'Lucida Grande', Tahoma, Verdana, sans-serif;
font-size: 14px;
}
.logininput:focus, .logininput:focus {border-color: #7dc9e2; outline-color: #dceefc; outline-offset: 0;}
.login p.submit {text-align: center;}
.login-help
{margin: 20px 0px;
font-size: 11px;
font-weight:bold;
color: blue;
text-align:center;}
.login-help a{color: #515c64;text-decoration: none;}
.login-help a:hover{text-decoration: underline;}:-moz-placeholder {color: #c9c9c9 !important;font-size: 13px;}::-webkit-input-placeholder {color: #ccc;font-size: 13px;}
.loginsubmit{cursor:pointer;padding: 0 18px;
height: 29px;
font-size: 12px;
font-weight: bold;
color: #527881;
text-shadow: 0 1px #e3f1f1;
background: #cde5ef;
border: 1px solid;
border-color: #b4ccce #b3c0c8 #9eb9c2;
border-radius: 16px;
background-image: -webkit-linear-gradient(top, #edf5f8, #cde5ef);
background-image: -moz-linear-gradient(top, #edf5f8, #cde5ef);
background-image: -o-linear-gradient(top, #edf5f8, #cde5ef);
background-image: linear-gradient(to bottom, #edf5f8, #cde5ef);
}
.loginsubmit:active {cursor:pointer;
background: #cde5ef;
border-color: #9eb9c2 #b3c0c8 #b4ccce;
}
I tried your code on IE,Mozilla and chrome, And it's working fine for me.When i focused and released mouse on your input fields ,the input fields are active.I didn't know where you are facing the problem.