How to delete empty space between form elements - html

How I can delete empty space between search input box and the go button? I've prepared jsfiddle with code sample. Link - jsFiddle
Screenshot:
HTML:
<div class="blablabla">
<form id="search_mini" action="#" method="get">
<div class="form-search">
<!--<label for="search"></label>-->
<input id="search" value="SEARCH" type="text" name="q" class="input-text" maxlength="128" autocomplete="off">
<button type="submit" title="GO" class="button"><span><span>GO</span></span>
</button>
<div id="search_autocomplete" class="search-autocomplete" style="display: none;"></div>
</div>
</form>
CSS:
#search_mini {
width: 268px;
}
.form-search input {
border-color: #7d7c7c;
height: 30px;
width: 150px;
padding:0;
}
.form-search button.button {
background: url(../images/bg.gif) 0 0 repeat-x;
font-size: 12px;
text-align: center;
padding: 0;
height: 36px;
min-width: 84px;
}
Thank you in advance.

You may try margin-left:
#search_mini {
width: 268px;
}
.form-search input {
border-color: #7d7c7c;
height: 30px;
width: 150px;
padding: 0;
}
.form-search button.button {
background: url(../images/bg.gif) 0 0 repeat-x;
font-size: 12px;
text-align: center;
padding: 0;
height: 36px;
min-width: 84px;
margin-left: -4px;/* put as your need */
}
<div class="blablabla">
<form id="search_mini" action="#" method="get">
<div class="form-search">
<!--<label for="search"></label>-->
<input id="search" value="SEARCH" type="text" name="q" class="input-text" maxlength="128" autocomplete="off">
<button type="submit" title="GO" class="button"><span><span>GO</span></span>
</button>
<div id="search_autocomplete" class="search-autocomplete" style="display: none;"></div>
</div>
</form>

add float:left to you .form-search input element
example: http://jsfiddle.net/2nwp36nj/2/
#search_mini {
width: 268px;
}
.form-search input {
border-color: #7d7c7c;
height: 30px;
width: 150px;
padding:0;
float: left;
}
.form-search button.button {
background: url(../images/bg.gif) 0 0 repeat-x;
font-size: 12px;
text-align: center;
padding: 0;
height: 36px;
min-width: 84px;
}
<div class="blablabla">
<form id="search_mini" action="#" method="get" _lpchecked="1">
<div class="form-search">
<!--<label for="search"></label>-->
<input id="search" value="SEARCH" type="text" name="q" class="input-text" maxlength="128" autocomplete="off">
<button type="submit" title="GO" class="button"><span><span>GO</span></span>
</button>
<div id="search_autocomplete" class="search-autocomplete" style="display: none;"></div>
</div>
</form>
</div>

use float left for both of the elements input and button also you need to give a width for button as well. It looks like it is working in the below code.
http://jsfiddle.net/2nwp36nj/3/
#search_mini {
width: 368px;
}
.form-search input, .form-search button {
border-color: #7d7c7c;
height: 30px;
width: 150px;
padding:0;
float: left;
}
.form-search button.button {
background: url(../images/bg.gif) 0 0 repeat-x;
font-size: 12px;
text-align: center;
padding: 0;
height: 36px;
min-width: 84px;
}

are suggested just such a button then she together with the form DEMO
<form class="form-wrapper cf">
<input type="text" placeholder="search" required>
<button type="submit">GO</button>
</form>
.cf:before, .cf:after{
content:"";
display:table;
}
.cf:after{
clear:both;
}
.cf{
zoom:1;
}
.form-wrapper {
width: 450px;
padding: 15px;
margin: 150px auto 50px auto;
background: #444;
background: rgba(0,0,0,.2);
border-radius: 10px;
box-shadow: 0 1px 1px rgba(0,0,0,.4) inset, 0 1px 0 rgba(255,255,255,.2);
}
.form-wrapper input {
width: 330px;
height: 20px;
padding: 10px 5px;
float: left;
font: bold 15px 'lucida sans', 'trebuchet MS', 'Tahoma';
border: 0;
background: #eee;
border-radius: 3px 0 0 3px;
}
.form-wrapper input:focus {
outline: 0;
background: #fff;
box-shadow: 0 0 2px rgba(0,0,0,.8) inset;
}
.form-wrapper input::-webkit-input-placeholder {
color: #999;
font-weight: normal;
font-style: italic;
}
.form-wrapper input:-moz-placeholder {
color: #999;
font-weight: normal;
font-style: italic;
}
.form-wrapper input:-ms-input-placeholder {
color: #999;
font-weight: normal;
font-style: italic;
}
.form-wrapper button {
overflow: visible;
position: relative;
float: right;
border: 0;
padding: 0;
cursor: pointer;
height: 40px;
width: 110px;
font: bold 15px/40px 'lucida sans', 'trebuchet MS', 'Tahoma';
color: #fff;
text-transform: uppercase;
background: #d83c3c;
border-radius: 0 3px 3px 0;
text-shadow: 0 -1px 0 rgba(0, 0 ,0, .3);
}
.form-wrapper button:hover{
background: #e54040;
}
.form-wrapper button:active,
.form-wrapper button:focus{
background: #c42f2f;
outline: 0;
}
.form-wrapper button:before {
content: '';
position: absolute;
border-width: 8px 8px 8px 0;
border-style: solid solid solid none;
border-color: transparent #d83c3c transparent;
top: 12px;
left: -6px;
}
.form-wrapper button:hover:before{
border-right-color: #e54040;
}
.form-wrapper button:focus:before,
.form-wrapper button:active:before{
border-right-color: #c42f2f;
}
.form-wrapper button::-moz-focus-inner {
border: 0;
padding: 0;
}

Simply add this to your elements :
.form-search input,
.form-search button.button
{
display: block;
float: left;
}
Your space is actually due to a whitespace.

Another working solution: you must insert comment between input tag and button tag. Like this:
<input id="search" value="SEARCH" type="text" name="q" class="input-text" maxlength="128" autocomplete="off"><!--
--><button type="submit" title="GO" class="button"><span><span>GO</span></span>

Related

How to arrange a Three radio buttons on a same line along with label?

I am developing one page which is responsible for displaying cart items inside that i developed one more form called Customer details it contains three radio buttons , I want those three radio buttons and labels on a same line like this i need , How to place my three radio buttons and along with their label names on a same line .like this i am getting please help me to fix this issue
Cart.vue
<template>
<div class="second -section">
<div class="details-box">
<input type="text" v-if="hide==true" class="initial-btn" placeholder="Customer Details" />
</div>
<div v-if="hide==false" class="fill-details">
<form class="address" >
<h4 class="heading">Customer Details</h4>
<div class="name">
<input type="name" required pattern="[A-Za-z]{3,10}">
<label>Name</label>
</div>
<div class="name">
<input type="text" required >
<label>Phone Number</label>
</div>
<div class="pin">
<input type="text" required >
<label>PinCode</label>
</div>
<div class="pin">
<input type="text" required>
<label>Locality</label>
</div>
<div class="address-block">
<input class="address" type="text" required>
<label>Address</label>
</div>
<div class="city-landMark">
<input type="text" required >
<label>City/Town</label>
</div>
<div class="city-landMark">
<input type="text" required>
<label>LandMark</label>
</div>
<div class="Radio-Buttons">
<p>Type</p>
<div class="radio-btns">
<input type="radio" id="Home" value="Home" name="Type" v-model="role">
<label for="Home" class="home-label">Home</label>
<input type="radio" id="Work" value="Work" name="Type" v-model="role">
<label for="Work" class="work-label">Work</label>
<input type="radio" id="Other" value="Other" name="Type" v-model="role">
<label for="Other" class="other-label">Other</label>
</div>
<div class="btn-continue">
<button type="submit" class="continue" >continue</button>
</div>
</div>
</form>
</div>
</div>
</template>
<style>
#import "colors";
.container{
// background:#FFFFFF;
margin-top:25px;
margin-left:177px;
width:774px;
height:241px;
// border:1px solid #707070;
// border-radius:1px;
}
.content{
margin-left:177px;
width: 155px;
height: 22px;
text-align: left;
font: normal normal medium 18px/22px Lato;
letter-spacing: 0px;
color: $light_black;
opacity: 1;
}
.mid-section{
display:flex;
}
.mid-section img{
width: 105px;
height: 85px;
margin-top:40px;
padding-left:36px;
opacity: 1;
}
.title-section {
margin-top:40px;
padding-left:38px;
font: normal normal normal 14px/17px Lato;
letter-spacing: 0px;
color: $light_black;
opacity: 1;
width: 180px;
height: 17px;
font-weight:300;
}
.author-section {
font: normal normal normal 12px/12px Lato;
letter-spacing: 0px;
color: #9D9D9D;
opacity: 1;
width: 63px;
height: 12px;
margin-left:141px;
margin-top:-58px;
}
.price-section{
margin-left:141px;
font: normal normal bold 15px/18px Lato;
letter-spacing: 0px;
color: $light_black;
opacity: 1;
margin-top:10px;
}
.price-section h6{
font-weight:600;
}
.plus-btn{
border-radius:45%;
width: 24px;
height: 24px;
margin-left:141px;
}
.btn{
position:absolute;
width: 151px;
height: 35px;
background: #3371B5 0% 0% no-repeat padding-box;
border-radius: 2px;
opacity: 1;
margin-top:-50px;
margin-left:800px;
font: normal normal medium 14px/17px Lato;
letter-spacing: 0px;
color: $pale_white;
text-transform: uppercase;
opacity: 1;
}
.close-btn{
background:none;
border:none;
margin-top:30px;
margin-left:650px;
}
.fa-minus-circle{
font-size: larger;
background:none;
border: 1px solid $grey_white;
opacity: 1;
margin-left:141px;
}
.fa-plus-circle{
font-size: larger;
background: none;
border: 1px solid $grey_white;
opacity: 1;
}
.icons .rectangle{
width: 41px;
height: 24px;
}
.initial-btn{
width: 774px;
height: 60px;
border: 1px solid #DCDCDC;
border-radius: 1px;
font: normal normal normal 15px/18px Lato;
letter-spacing: 0px;
color: #333232;
opacity: 1;
margin-left:177px;
margin-top:5px;
}
.fill-details{
width: 774px;
height: 450px;
background: #FFFFFF 0% 0% no-repeat padding-box;
border: 1px solid #DCDCDC;
border-radius: 1px;
opacity: 1;
margin-left:177px;
border: 1px solid #DCDCDC;
}
.form{
position: absolute;
transform: translate(-50%, -50%);
border-radius: 10px;
width: 800px;
padding: 25px;
margin-left:177px;
}
.heading{
width: 185px;
height: 18px;
text-align: left;
font: normal normal normal 19px/18px Lato;
letter-spacing: 0px;
color: #333232;
opacity: 1;
padding-left:36px;
}
.address h4 {
font-weight: 300;
}
.name {
display: inline-block;
padding-left:36px;
}
input[type="name"] {
display: block;
margin: 30px 0 0 10px;
width: 251px;
}
.name input[type="text"]{
display: block;
margin: 30px 0 0 10px;
width: 251px;
}
.pin input[type="text"]{
display: block;
margin: 30px 0 0 10px;
width: 251px;
}
.pin{
padding-left:36px;
margin-top:-35px;
display: inline-block;
}
.city-landMark{
display: inline-block;
padding-left:36px;
margin-top:-35px;
}
.city-landMark input[type="text"]{
display: block;
margin: 30px 0 0 10px;
width: 251px;
}
.address-block input[type="text"]{
display: block;
margin: 30px 0 0 10px;
width: 550px;
height:50px;
}
.address-block{
padding-left:36px;
margin-top:-35px;
display: inline-block;
}
.Radio-Buttons p{
padding-left: 50px;
}
#home-label{
padding-top:50px;
}
.btn-continue{
padding-left:550px;
}
.continue{
width: 160px;
height: 35px;
background: #3371B5 0% 0% no-repeat padding-box;
border-radius: 3px;
opacity: 1;
font: normal normal medium 14px/17px Lato;
letter-spacing: 0px;
color: #FFFFFF;
text-transform: uppercase;
opacity: 1;
}
.home-label{
padding-left: 25px;
}
form input {
outline: none;
border: 1px solid #9c9c9c;
border-radius: 5px;
padding: 0 10px;
height: 35px;
font-size: 15px;
margin-left:177px;
}
input:focus {
border: 1.5px solid #1f52f9;
}
form label {
position: relative;
font-family: roboto;
color: #555;
font-size: 15px;
pointer-events: none;
left: 20px;
top: -28px;
transition: .2s all;
}
input:focus~label,
input:valid~label {
top: -49px;
left: 15px;
background: #fff;
padding: 0 5px;
font-size: 10px;
color: #1f52f9;
}
</style>
You have directly use the element selector by tag name instead by class or ID. So, other label element are also affected by that styling.
Please review your CSS code and give property to specific element by using class or ID or other selector instead of directly selecting by tag name.
I wrapped each radio buttons in a div and made those div a flexbox and gave them a gap to space out.
.radio-btns{
display: flex;
gap: 3rem;
}
<div class="radio-btns">
<div>
<input type="radio" id="Home" value="Home" name="Type" v-model="role">
<label for="Home">Home</label>
</div>
<div>
<input type="radio" id="Work" value="Work" name="Type" v-model="role">
<label for="Work" class="work-label">Work</label>
</div>
<div>
<input type="radio" id="Other" value="Other" name="Type" v-model="role">
<label for="Other">Other</label>
</div>
</div>

customizing a file button using css

I tried customizing a file upload button using css.
<label class="custom-file-input">
<input type="file" name="file" id="videofile" /> <!--class="dropzone"-->
</label>
Full Code in jsfiddle. https://jsfiddle.net/2e7dLvoy/
How can i show the file name that is choosen just like a normal file upload button?
Use this
HTML:
<div class="form-group upload_btn">
<div class="fileUpload pull-left">
<span>Browse</span>
<input type="file" class="upload " id="uploadBtn">
</div>
<input disabled="disabled" class="input pull-left" placeholder="Upload your resume" id="uploadFile">
</div>
Css:
.form-group.upload_btn {
overflow: hidden;
margin-bottom: 20px;
}
.fileUpload {
background: #e1e1e1 none repeat scroll 0 0;
color: #626262;
display: inline-block;
font-size: 18px;
font-weight: 300;
overflow: hidden;
padding: 5.5px 10px;
position: relative;
}
.pull-left {
float: left;
}
.fileUpload input.upload {
cursor: pointer;
font-size: 20px;
left: 0;
margin: 0;
opacity: 0;
padding: 0;
position: absolute;
top: 0;
}
.upload_btn .input {
width: 79%;
}
.input {
border: 0px;
padding: 8px;
box-shadow: none;
background-color: #fff;
}
Js:
document.getElementById("uploadBtn").onchange = function () {
document.getElementById("uploadFile").value = this.value;
};
Here is the jsfiddle link
try this:
fiddle with jquery: https://jsfiddle.net/2e7dLvoy/4/
HTML
<label class="custom-file-input">
<input type="file" name="file" id="videofile" /> <!--class="dropzone"-->
<p id="selectedFile"></p>
</label>
CSS
.custom-file-input {
display: inline-block;
position: relative;
color: #533e00;
}
.custom-file-input input {
visibility: hidden;
width: 100px
}
.custom-file-input:before {
content: 'Drag & Drop';
display: block;
background: -webkit-linear-gradient( -180deg, #ffdc73, #febf01);
background: -o-linear-gradient( -180deg, #ffdc73, #febf01);
background: -moz-linear-gradient( -180deg, #ffdc73, #febf01);
background: linear-gradient( -180deg, #ffdc73, #febf01);
border: 3px solid #dca602;
border-radius: 10px;
padding: 5px 0px;
outline: none;
white-space: nowrap;
cursor: pointer;
text-shadow: 1px 1px rgba(255,255,255,0.7);
font-weight: bold;
text-align: center;
font-size: 10pt;
position: absolute;
left: 0;
font-size: 12px;
}
.custom-file-input:hover:before {
border-color: #febf01;
}
.custom-file-input:active:before {
background: #febf01;
}
p {
float: left;
margin: -5% 14% 0% 32%;
}
jQuery
$('input[type=file]').change(function(e){
$in=$(this);
$('#selectedFile').html($in.val());
});

Have the submit button uncentered

I'm trying to create a login "panel" kindof.
I just want the submit button right next to the password field but without it centering with the password field.
I have tried to uncenter the Submit button but it doesn't work.
.login input:focus {
border-color: #419ebf;
outline-width: 0;
}
.login {
cursor: default;
margin-top: 100px;
text-align: center;
}
.login .fields {
background-color: rgba(0, 0, 0, 0.18);
border-color: #b8bfb7;
width: 325px;
height: 50px;
font-family:'Exo', sans-serif;
font-size: 30px;
color: White;
border-radius: 7px;
padding-left: 4px;
padding-right: 4px;
margin: 5px auto;
}
.login .submit {
width: 150px;
height: 50px;
background-color: rgba(0, 0, 0, 0.18);
border-color: #b8bfb7;
font-family:'Exo', sans-serif;
font-size: 30px;
color: White;
border-radius: 7px;
}
<form method="post" action="login.php" class="login">
<input class="fields" type="text" name="username" placeholder="Username" />
<br/>
<input class="fields" type="password" name="password" placeholder="Password" />
<input class="submit" type="submit" value="Login">
</form>
Thanks for the help
You could consider two things:
If your application is always displayed on fixed width, you might like to try use position: fixed; instead of centering all items and using newline.
If you'd like to be more flexible, find an anchestor or container element and use position: absolute;.
More information on positioning elements through CSS can be found here.
Try to delete
text-align: center;
in
.login{
cursor: default;
margin-top: 100px;
text-align: center;
}
I have removed text-align: center; from .login, added width: 500px; and changed margins to margin: 100px auto 0 auto;
.login {
cursor: default;
margin: 100px auto 0 auto;
width: 500px;
}
.login input:focus {
border-color: #419ebf;
outline-width: 0;
}
.login .fields {
background-color: rgba(0, 0, 0, 0.18);
border-color: #b8bfb7;
width: 325px;
height: 50px;
font-family:'Exo', sans-serif;
font-size: 30px;
color: White;
border-radius: 7px;
padding-left: 4px;
padding-right: 4px;
margin: 5px auto;
}
.login .submit {
width: 150px;
height: 50px;
background-color: rgba(0, 0, 0, 0.18);
border-color: #b8bfb7;
font-family:'Exo', sans-serif;
font-size: 30px;
color: White;
border-radius: 7px;
}
<form method="post" action="login.php" class="login">
<input class="fields" type="text" name="username" placeholder="Username" />
<br/>
<input class="fields" type="password" name="password" placeholder="Password" />
<input class="submit" type="submit" value="Login">
</form>

How to insert an icon inside HTML `<input>` tag

Im not having sucess put my icon font inside my search input.
I already try with margin, padding, but nothing is working!
Can you give me a little help?
The fiddle with the problem:
http://jsfiddle.net/Tj7nJ/1/
My Html:
<li id="sb-search" style="float:right; list-style:none; height:20px; bottom:3px; ">
<form id="search">
<input name="q" type="text" size="40" placeholder="Pesquisar..." />
<button type="submit"><i class="fa fa-search"></i></button>
</form>
</li>
My css:
#search {
outline:none ;
border:none ;
}
#search button[type="submit"] {
width: 20px;
background:none;
cursor:pointer;
height:20px;
}
button[type="submit"]>i:hover
{
color: #fff;
}
button[type="submit"]>i
{
background:none;
color:#ccc;
font-size:1.1em;
}
#search input[type="text"]
{
border: 0 none;
background: #141d22;
text-indent: 0;
width:110px;
padding: 6px 15px 6px 35px;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
}
You can't put an image inside an <input type='text'> element.
However, you can remove the borders of the input with:
input[type='text'] {
background-color:transparent;
border: 0px solid;
}
and then wrap it with the icon inside a div and re-style.
Example code:
Here is a jsFiddle for you: http://jsfiddle.net/hxjY7/
Here is the code:
<style type="text/css">
#textBoxWrapper{
border: 1px solid black;
width: 172px;
height: 20px;
}
#textBox {
background-color:transparent;
border: 0px solid;
width: 150px;
height: 20px;
float:left;
}
#icon{
width: 20px;
height: 20px;
background-color: grey;
float:left;
}
</style>
<div id="textBoxWrapper">
<div id="icon"></div>
<input type="text" id="textBox" />
</div>
If you are trying to move the button inside the input field, you could set the button to position absolute (and the search wrapper to relative):
http://jsfiddle.net/Tj7nJ/3/
#search {
outline: none;
border: none;
}
#search {
position: relative;
z-index: 1;
}
#search button[type="submit"] {
width: 20px;
background: none;
cursor: pointer;
height: 20px;
z-index: 2;
position: absolute;
top: 3px;
right: 10px;
}
button[type="submit"]>i:hover {
color: #fff;
}
button[type="submit"]>i {
background: none;
color: #ccc;
font-size: 1.1em;
}
#search input[type="text"] {
border: 0 none;
background: #141d22;
text-indent: 0;
width: 110px;
padding: 6px 15px 6px 35px;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
}
I think this is what you are trying to do. jsFilddle
HTML:
<form id="search" action="#" method="post">
<fieldset>
<input type="text" id="q" name="q" size="40" placeholder="Search..." />
<button type="submit"><i class="fa fa-search"></i>
</button>
</fieldset>
</form>
CSS:
form#search fieldset {
position: relative;
border: none;
}
form#search input[type='text'] {
padding: 4px;
}
form#search button {
position: absolute;
top: 9px;
left: 262px;
}

Indent in form field won't go away

I have a contact form on this page: http://thehummingbirdplace.com/contact.html
The form's "comments" section has a large indent in the field when you click it to type. The indent can be deleted when typing, but I can't figure out how to get rid of it from the get go.
Here's the code for the form:
<div id="contactForm">
<form class="group" method="post" action="contact1.php">
<label for="text1">Name: </label>
<input name="name" type="text" id="text1" required>
<label for="text2">E-Mail: </label>
<input name="email" type="email" id="text2" required>
<label for="commentsfield" class="commentbox">Comments: </label>
<textarea name="comments" id="commentsfield"
cols=30 rows=9>
</textarea>
<input type="submit" value="submit"/>
</form>
</div>
Here's all the css I'm using on it:
#contactForm {
margin-left: auto;
margin-right: auto;
width: 520px;
height: 500px;
}
form {
padding-right: 15px;
padding-bottom: 0px;
padding-left: 15px;
position: absolute;
z-index: 1;
}
label {
display: block;
width: 270px;
padding-top: 15px;
margin-top: 0;
margin-bottom: 0;
margin-left: 15px;
}
label.commentbox {
width: 501px;
}
form * {
background: transparent;
behavior: url(../_assets/PIE.htc);
}
input {
-webkit-appearance: none;
-moz-appearance: none;
border: none;
background: none;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
padding: 0;
margin: 0;
}
.group:before, .group:after {
content: "\0020";
display: block;
height: 0;
overflow; hidden;
}
.group:after {
clear: both;
}
.group {
zoom: 1;
}
input[type=text], input[type=email] {
width: 270px;
}
textarea {
width: 500px;
}
input[type=text], input[type=email] {
padding: 5px;
}
input[type=text], input[type=email], textarea {
display: block;
border: 1px solid #EAEAEA;
font-size: 16px;
background-color: #fff;
color: #666;
box-shadow: 0px 2px 3px rgba(255,255,255,0.5);
}
input:focus, textarea:focus {
}
input[type=email] {
padding-right: 10px;
}
input[type=submit] {
padding: 5px;
background: #666;
color: white;
border: none;
margin-top: 15px;
font-size: 100%;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
input[type=text].required {
padding-left: 10px;
}
input.required {
background: webkit-linear-gradient(#FFF, #DDD);
background: moz-linear-gradient(#FFF, #DDD);
background: ms-linear-gradient(#FFF, #DDD);
background: o-linear-gradient(#FFF, #DDD);
background: linear-gradient(#FFF, #DDD);
-pie-background: linear-gradient(#FFF, #DDD);
}
::-webkit-scrollbar {
width: 12px;
}
::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
border-radius: 10px;
}
::-webkit-scrollbar-thumb {
border-radius: 10px;
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5);
}
I haven't seen this happen before, and nothing stands out to me as causing the intent in the form. Any help would be greatly appreciated!
You need to get rid of the white space between your textarea tag
<textarea name="comments" id="commentsfield" cols=30 rows=9></textarea>
Buggy Demo
Fixed Demo
You have a big gap between your <textarea> </textarea>
Replace this:-
<textarea name="comments" id="commentsfield" cols="30" rows="9"> </textarea>
With this one :-
<textarea name="comments" id="commentsfield" cols="30" rows="9"></textarea>