I have a form I'm looking to place an image behind, like in this example:
The code is as follows:
#minicontact{width:25%;float:right;margin:-525px 155px -5px 0;}
#miniformtitle{margin:0 auto; text-align:center;}
#buttonmini{cursor:pointer;width:150px !important;height:60px !important;font-size:120% !important;text-align:center !important;background-color:#6db9fa !important;color:#ffffff !important;border-radius:20px !important; margin-top:20px; display:block; padding:0px;
margin:0 auto;}
<div id="minicontact">
<h3 id="miniformtitle">Get Started</h3>
<form class="contact" action="<?=$_SERVER['REQUEST_URI'];?>#cform1" method="post" name="simp_cont">
<p><br /> <input id="captcha" class="input" style="position: absolute; left: -9999px;" name="captcha" type="text" /><br /> <input id="name" name="fname" type="text" placeholder="NAME" /><br /> <input id="phone" name="phone" type="text" placeholder="PHONE NUMBER"
/><br /> <input id="email" name="email" type="text" placeholder="EMAIL ADDRESS" /><br /> <input id="footage" name="footage" type="text" placeholder="ESTIMATED SQUARE FOOTAGE" /><br /> <textarea class="textarea" name="message" placeholder="COMMENTS"></textarea><input name="form_name" type="hidden" value="contact_form" />
<button type="submit" id="buttonmini" name='submit'>SEND MESSAGE</button></p>
</form>
</div>
The image I'm trying to use as the background is:
Google probably won't allow you to see the image in run script, but the CSS is there for you to achieve it :)
#minicontact {
width:400px;
height:500px;
float:left;
border:1px solid #ebebeb;
background:url('https://cdn.pixabay.com/photo/2016/10/27/22/53/heart-1776746_1280.jpg');
background-size:cover;
background-position:center;
}
<div id="minicontact">
<h3 id="miniformtitle">Get Started</h3>
<form class="contact" action="<?=$_SERVER['REQUEST_URI'];?>#cform1" method="post" name="simp_cont">
<p><br /> <input id="captcha" class="input" style="position: absolute; left: -9999px;" name="captcha" type="text" /><br /> <input id="name" name="fname" type="text" placeholder="NAME" /><br /> <input id="phone" name="phone" type="text" placeholder="PHONE NUMBER"
/><br /> <input id="email" name="email" type="text" placeholder="EMAIL ADDRESS" /><br /> <input id="footage" name="footage" type="text" placeholder="ESTIMATED SQUARE FOOTAGE" /><br /> <textarea class="textarea" name="message" placeholder="COMMENTS"></textarea><input name="form_name" type="hidden" value="contact_form" />
<button type="submit" id="buttonmini" name='submit'>SEND MESSAGE</button></p>
</form>
</div>
Just set a background image via css, and you're good to go.
https://developer.mozilla.org/en-US/docs/Web/CSS/background-image
Related
I have a honeypot ('Work Phone') field in a simple contact form. I am hiding (hacking) the element by positioning it fixed and -1000% off the screen.
The form HTML:
<aside class="enquiry-form">
<h3 class="heading">Enquire Now</h3>
<form id="EnquiryForm_EnquiryForm" action="/products/filtered-water-taps/EnquiryForm" method="post" enctype="application/x-www-form-urlencoded">
<div class="inputs">
<input type="text" name="Name" class="text" id="EnquiryForm_EnquiryForm_Name" required="required" aria-required="true" placeholder="Name" />
<input type="email" name="Email" class="email text" id="EnquiryForm_EnquiryForm_Email" required="required" aria-required="true" placeholder="Email" />
<input type="text" name="Work Phone" class="text" id="EnquiryForm_EnquiryForm_Work-Phone" style="position: fixed; left: -1000%;" tabIndex="-1" />
<input type="text" name="Phone" class="text" id="EnquiryForm_EnquiryForm_Phone" required="required" aria-required="true" placeholder="Phone" />
<input type="text" name="Product" value="Filtered Water Taps" class="product" id="EnquiryForm_EnquiryForm_Product" placeholder="Product" />
</div>
<div class="message">
<textarea name="Message" class="textarea" id="EnquiryForm_EnquiryForm_Message" required="required" aria-required="true" placeholder="Message" rows="5" cols="20"></textarea>
</div>
<input class="button dark" type="submit" value="Send" />
</form>
</aside>
The problem is, in ie8 the whole page breaks and I get a white screen, I cannot inspect the element using dev tools which makes debugging very dfficult.
My gut feel is that it has something to do with html5shiv.
Any help is appreciated.
I would suggest this method:
#EnquiryForm_EnquiryForm_Work-Phone {
position: absolute;
top: -9999px;
left: -9999px;
}
By the way, I think its better to use a "website" as honeypot field. This is something a spambot allways want's to fill out.
So I'm trying to make a form with a message box, but it won't align correctly; it keeps pushing the text to the bottom of the area it takes up..
I've accepted putting in a break between the text field and the message field for a long time, but there's a break, so it isn't aligned there either...
JSFiddle: http://jsfiddle.net/2U2PJ/
<form action="sending.php" method="post" name="Contact Form" id="form1" onsubmit="MM_validateForm('Name','','R','E-mail','','R','Device','','R','Message','','R')return document.MM_returnValue" encytype="text/plain">
<p>
<label><font size="3">Name: </font>
<input name="Name" type="text" id="Name" size="25" /><font size="2"> <font color="red"><span id="req_3" class="req">*</span></font></font></label>
</p>
<p>
<label><font size="3">Email:</font>
<input name="E-mail" type="text" id="E-mail" size="25" /> <font size="2"><font color="red"><span id="req_3" class="req">*</span></font></font></label>
</p>
<p>
<label><font size="3">Review:</font>
<textarea name="Message" cols="35" rows="7" id="Message" placeholder="Y U SO BROKE MR. THINGY D;"></textarea>
</p>
</label>
<label>
<input name="Submit" type="submit" id="Submit" value="Submit" />
</label>
</form>
As per my comment. Use CSS. This should get you on the correct path:
http://jsfiddle.net/2U2PJ/3/
css:
.contact-form .field label { width: 100px; display:inline-block; vertical-align: top; }
.contact-form .req { color: red; }
.contact-form .field .textbox { width: 180px; }
html:
<div class="contact-form">
<form action="sending.php" method="post" name="Contact Form" id="form1" onsubmit="MM_validateForm('Name','','R','Email','','R','Device','','R','Message','','R')return document.MM_returnValue" encytype="text/plain">
<div class="field">
<label for="Name">Name:</label>
<input name="Name" type="text" id="Name" class="textbox" />
<span id="req_3" class="req">*</span>
</div>
<div class="field">
<label for="Email">Email:</label>
<input name="Email" type="text" id="Email" class="textbox" />
<span id="req_3" class="req">*</span>
</div>
<div class="field">
<label for="Message">Review:</label>
<textarea name="Message" cols="35" rows="7" id="Message" placeholder="Y U SO BROKE MR. THINGY D;"></textarea>
</div>
<div>
<input name="Submit" type="submit" id="Submit" value="Submit" />
</div>
</form>
</div>
Full Code to simplify your issue!
http://jsfiddle.net/SinisterSystems/jLXsV/2/
HTML:
<form action="sending.php" method="post" name="Contact Form" id="form1" onsubmit="MM_validateForm('Name','','R','E-mail','','R','Device','','R','Message','','R')return document.MM_returnValue" encytype="text/plain">
<p>
<label>Name:</label>
<input type="text" />
</p>
<p>
<label>Email:</label>
<input type="text" />
</p>
<p>
<label>Review:</label>
<textarea rows="7" cols="35"></textarea>
</p>
<p>
<input name="Submit" type="submit" id="Submit" value="Submit" />
</p>
CSS:
input, textarea {
width:200px;
margin-left:15px;
}
label {
float:left;
min-width:100px;
}
With your IDs
Fiddle: http://jsfiddle.net/SinisterSystems/jLXsV/3/
i am using this CSS Code to display 2 divs side by side:
#contactus-menu {
width:20%;
float:left;
display:inline;
}
#contactus-main {
width:75%;
float:right;
display:inline;
}
and then my HTML:
<div id="contactus-menu"><?php include 'contact-us/locations.php'; ?></div>
<div id="contactus-main">
<div id="contactus-title">Leigh-on-Sea, Essex</div>
<div id="contactus-bar">Sales</div>
<div id="contactus-bar-sub">
<strong>Telephone: </strong><?php echo $main_phone_number; ?> (Option 1)
</div>
<div id="contactus-bar-sub">
<strong>Email: </strong>sales#domain.co.uk
<p> </p><p> </p>
<form method="post" action="main.php">
<input name="name" type="text" id="name" onFocus="if(this.value=='Full Name'){this.value=''}" onBlur="if(this.value==''){this.value='Full Name'}" value="Full Name" size="30" />
<br /><br />
<input name="email" type="text" id="email" onFocus="if(this.value=='Email Address'){this.value=''}" onBlur="if(this.value==''){this.value='Email Address'}" value="Email Address" size="30" />
<br /><br />
<input name="phone" type="text" id="phone" onFocus="if(this.value=='Phone Number'){this.value=''}" onBlur="if(this.value==''){this.value='Phone Number'}" value="Phone Number" size="30" />
<br /><br />
<textarea name="message" cols="30" rows="6" id="message" onFocus="if(this.value=='Message'){this.value=''}" onBlur="if(this.value==''){this.value='Message'}">Message</textarea>
<br /><br />
<input type="submit" name="submit" id="submit" value="Send Message" /><br />
</form>
</div>
<div id="contactus-bar-sub">
<strong>Postal Address</strong>
<p> </p>
<?php
if($main_address1 > '') { echo $main_address1.'<br>'; }
if($main_town > '') { echo $main_town.'<br>'; }
if($main_county > '') { echo $main_county.'<br>'; }
if($main_postcode > '') { echo $main_postcode; }
?>
</div>
</div>
but the #contactus-main DIV is displaying under my footer for some reason, any ideas what i have done wrong. there is nothing wrong with the footer as it is working fine on all other pages, its just this page that has a few extra divs.
You should use display:block on your divs, because display:inline has no effect on floating elements. Also, you probably need an element with style="clear:both" before the footer.
I'm having a problem here. My first two heading doesn't have a problem. But when I insert my 3rd heading the form is screwed. Here is the code. Yes, i'm quite new.
![enter image description here][1]
<html>
<head>
<link rel="stylesheet" href="form.css" type="text/css">
</head>
<body>
<div id="stylized" class="assestment-form">
<form id="form" name="form" method="post" action="assesment-form-handler.php">
<h1>Application Information</h1>
<p> </p>
<label>Name</label>
<input type="text" name="client_name" id="client_name" />
<label>Date of Birth</label>
<input type="text" name="client_dob" id="client_dob" />
<label>Gender</label>
<input type="text" name="client_gender" id="client_gender" />
<label>Address</label>
<textarea name="client_address" rows=5 cols=40 id="client_address"></textarea>
<label>Contact No.</label>
<input type="text" name="client_contact" id="client_contact" />
<label>Email Address</label>
<input type="text" name="client_dob" id="client_dob" />
<label>Marital Status</label>
<input type="text" name="client_status" id="client_status" />
<label>Citizenship</label>
<input type="text" name="client_citizen" id="client_citizen" />
<h1>Formal Training</h1>
<p> </p>
<label>DIPLOMA 1 </label>
<input type="text" name="client_dip1" id="client_dip1" />
<label>Field of Training </label>
<input type="text" name="client_field1" id="client_field1" />
<label>Educational Institution</label>
<input type="text" name="client_edu1" id="client_edu1" />
<label>Began Studies on</label>
<input type="text" name="client_stud1" id="client_stud1" />
<label>Obtained Diploma on</label>
<input type="text" name="client_obtaindip1" id="client_obtaindip1" />
<label>DIPLOMA 2 </label>
<input type="text" name="client_dip2" id="client_dip2" />
<label>Field of Training </label>
<input type="text" name="client_field2" id="client_field2" />
<label>Educational Institution</label>
<input type="text" name="client_edu2" id="client_edu2" />
<label>Began Studies on</label>
<input type="text" name="client_stud2" id="client_stud2" />
<label>Obtained Diploma on</label>
<input type="text" name="client_obtaindip2" id="client_obtaindip2" />
<label>DIPLOMA 3 </label>
<input type="text" name="client_dip3" id="client_dip3" />
<label>Field of Training </label>
<input type="text" name="client_field3" id="client_field3" />
<label>Educational Institution</label>
<input type="text" name="client_edu3" id="client_edu3" />
<label>Began Studies on</label>
<input type="text" name="client_stud3" id="client_stud3" />
<label>Obtained Diploma on</label>
<input type="text" name="client_obtaindip3" id="client_obtaindip3" />
<h1>Work Experience</h1>
<p> </p>
<label>JOB 1</label>
<input type="text" name="client_job1" id="client_job1" />
<label>Company</label>
<input type="text" name="client_company1" id="client_company1" />
<label>Date of Beginning</label>
<input type="text" name="client_begin1" id="client_begin1" />
<label>Date of End</label>
<input type="text" name="client_end1" id="client_end1" />
<label>Job Duties and Responsibilities</label>
<textarea name="client_jobduties1" rows=5 cols=40 id="client_jobduties3"></textarea>
<label>Resume with job details</label>
<input type="file" name="client_uploadjob1">
<label>JOB 2</label>
<input type="text" name="client_job2" id="client_job2" />
<label>Company</label>
<input type="text" name="client_company2" id="client_company2" />
<label>Date of Beginning</label>
<input type="text" name="client_begin2" id="client_begin2" />
<label>Date of End</label>
<input type="text" name="client_end2" id="client_end2" />
<label>Job Duties and Responsibilities</label>
<textarea name="client_jobduties3" rows=5 cols=40 id="client_jobduties3"></textarea>
<label>Resume with job details</label>
<input type="file" name="client_uploadjob2">
<label>JOB 3</label>
<input type="text" name="client_job3" id="client_job3" />
<label>Company</label>
<input type="text" name="client_company3" id="client_company3" />
<label>Date of Beginning</label>
<input type="text" name="client_begin3" id="client_begin3" />
<label>Date of End</label>
<input type="text" name="client_end3" id="client_end3" />
<label>Job Duties and Responsibilities</label>
<textarea name="client_jobduties3" rows=5 cols=40 id="client_jobduties3"></textarea>
<label>Resume with job details</label>
<input type="file" name="client_uploadjob3">
<h1>Language Skills</h1>
<p>(Please specify level: beginner, intermediate or advance) </p>
<h2>Reading</h2>
<label>French</label>
<input type="text" name="client_readfrench1" id="client_readfrench1" />
<label>English</label>
<input type="text" name="client_readenglish1" id="client_readenglish1" />
<label>Have you passed the test?</label>
<input type="text" name="client_langtest1" id="client_langtest1"
value="Please put Yes or No"/>
<label>If yes, please specify test</label>
<textarea name="client_specify1" id="client_specify1" rows=5 cols=40></textarea>
<label>Date Passed</label>
<input type="text" name="client_datepassed1" id="client_datepassed1" />
<h2>Writing</h2>
<label>French</label>
<input type="text" name="client_readfrench2" id="client_readfrench2" />
<label>English</label>
<input type="text" name="client_readenglish2" id="client_readenglish2" />
<label>Have you passed the test?</label>
<input type="text" name="client_langtest2" id="client_langtest2"
value="Please put Yes or No"/>
<label>If yes, please specify test</label>
<textarea name="client_specify2" id="client_specify2" rows=5 cols=40></textarea>
<label>Date Passed</label>
<input type="text" name="client_datepassed2" id="client_datepassed2" />
<h2>Oral Expression</h2>
<label>French</label>
<input type="text" name="client_readfrench2" id="client_readfrench2" />
<button type="submit">Submit</button>
<div class="spacer"></div>
</form>
</div>
<body>
</html>
css code
body{
font-family:"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif;
font-size:11px;
}
p, h1, form, button{border:0; margin:0; padding:0;}
.spacer{clear:both; height:1px;}
/* ----------- My Form ----------- */
.assestment-form{
margin:0 auto;
width:400px;
padding:14px;
}
/* ----------- stylized ----------- */
#stylized{
border:solid 2px #b7ddf2;
background:#ebf4fb;
}
#stylized h1 {
font-size:20px;
font-weight:bold;
margin-bottom:8px;
}
#stylized h2 {
font-family:"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif;
font-size:18px;
font-weight:bold;
margin-bottom:8px;
}
#stylized p{
font-size:11px;
color:#666666;
margin-bottom:20px;
border-bottom:solid 1px #b7ddf2;
padding-bottom:10px;
}
#stylized label{
display:block;
font-weight:bold;
text-align:left;
width:140px;
float:left;
}
#stylized .small{
color:#666666;
display:block;
font-size:11px;
font-weight:normal;
text-align:left;
width:140px;
}
#stylized input{
float:left;
font-size:12px;
padding:4px 2px;
border:solid 1px #aacfe4;
width:200px;
margin:2px 0 20px 10px;
}
#stylized button{
clear:both;
margin-left:150px;
width:125px;
height:31px;
background:#666666 url(img/button.png) no-repeat;
text-align:center;
line-height:31px;
color:#FFFFFF;
font-size:11px;
font-weight:bold;
}
#stylized textarea {
loat:left;
font-size:12px;
padding:4px 2px;
border:solid 1px #aacfe4;
width:200px;
margin:2px 0 20px 10px;
}
Remember input elements are inline elements, so the headings will appear after the input element if there is enough space for it to do so. The Oral in the heading Oral Expression is wide enough to fit after the input element and that is why it is behaving that way.
Try changing the width of .assestment-form from 400px to 375px and the heading will appear in the next line.
Live demo....................................................................
Hi now define your #stylized h2 to clear both
as like this
#stylized h2{
clear:both;
}
Live demo
This is happening because there is enough space to hold part of text from the h2 tag
so in your h2 css add
clear:left;
The answer is here: http://jsfiddle.net/2dcPE/5/
Please check. Please keep in mind:
Add float: left; for h1 and h2 in Css
Add to Css
br{
clear: left;
}
Add <br /> in HTML to make new line
UPDATE:
HTML
<html>
<head>
<link rel="stylesheet" href="form.css" type="text/css">
</head>
<body>
<div id="stylized" class="assestment-form">
<form id="form" name="form" method="post" action="assesment-form-handler.php">
<h1>Application Information</h1><br/>
<p> </p>
<label>Name</label>
<input type="text" name="client_name" id="client_name" />
<label>Date of Birth</label>
<input type="text" name="client_dob" id="client_dob" />
<label>Gender</label>
<input type="text" name="client_gender" id="client_gender" />
<label>Address</label>
<textarea name="client_address" rows=5 cols=40 id="client_address"></textarea>
<label>Contact No.</label>
<input type="text" name="client_contact" id="client_contact" />
<label>Email Address</label>
<input type="text" name="client_dob" id="client_dob" />
<label>Marital Status</label>
<input type="text" name="client_status" id="client_status" />
<label>Citizenship</label>
<input type="text" name="client_citizen" id="client_citizen" />
<h1>Formal Training</h1><br/>
<p> </p>
<label>DIPLOMA 1 </label>
<input type="text" name="client_dip1" id="client_dip1" />
<label>Field of Training </label>
<input type="text" name="client_field1" id="client_field1" />
<label>Educational Institution</label>
<input type="text" name="client_edu1" id="client_edu1" />
<label>Began Studies on</label>
<input type="text" name="client_stud1" id="client_stud1" />
<label>Obtained Diploma on</label>
<input type="text" name="client_obtaindip1" id="client_obtaindip1" />
<label>DIPLOMA 2 </label>
<input type="text" name="client_dip2" id="client_dip2" />
<label>Field of Training </label>
<input type="text" name="client_field2" id="client_field2" />
<label>Educational Institution</label>
<input type="text" name="client_edu2" id="client_edu2" />
<label>Began Studies on</label>
<input type="text" name="client_stud2" id="client_stud2" />
<label>Obtained Diploma on</label>
<input type="text" name="client_obtaindip2" id="client_obtaindip2" />
<label>DIPLOMA 3 </label>
<input type="text" name="client_dip3" id="client_dip3" />
<label>Field of Training </label>
<input type="text" name="client_field3" id="client_field3" />
<label>Educational Institution</label>
<input type="text" name="client_edu3" id="client_edu3" />
<label>Began Studies on</label>
<input type="text" name="client_stud3" id="client_stud3" />
<label>Obtained Diploma on</label>
<input type="text" name="client_obtaindip3" id="client_obtaindip3" />
<h1>Work Experience</h1><br/>
<p> </p>
<label>JOB 1</label>
<input type="text" name="client_job1" id="client_job1" />
<label>Company</label>
<input type="text" name="client_company1" id="client_company1" />
<label>Date of Beginning</label>
<input type="text" name="client_begin1" id="client_begin1" />
<label>Date of End</label>
<input type="text" name="client_end1" id="client_end1" />
<label>Job Duties and Responsibilities</label>
<textarea name="client_jobduties1" rows=5 cols=40 id="client_jobduties3"></textarea>
<label>Resume with job details</label>
<input type="file" name="client_uploadjob1">
<label>JOB 2</label>
<input type="text" name="client_job2" id="client_job2" />
<label>Company</label>
<input type="text" name="client_company2" id="client_company2" />
<label>Date of Beginning</label>
<input type="text" name="client_begin2" id="client_begin2" />
<label>Date of End</label>
<input type="text" name="client_end2" id="client_end2" />
<label>Job Duties and Responsibilities</label>
<textarea name="client_jobduties3" rows=5 cols=40 id="client_jobduties3"></textarea>
<label>Resume with job details</label>
<input type="file" name="client_uploadjob2">
<label>JOB 3</label>
<input type="text" name="client_job3" id="client_job3" />
<label>Company</label>
<input type="text" name="client_company3" id="client_company3" />
<label>Date of Beginning</label>
<input type="text" name="client_begin3" id="client_begin3" />
<label>Date of End</label>
<input type="text" name="client_end3" id="client_end3" />
<label>Job Duties and Responsibilities</label>
<textarea name="client_jobduties3" rows=5 cols=40 id="client_jobduties3"></textarea>
<label>Resume with job details</label>
<input type="file" name="client_uploadjob3">
<h1>Language Skills</h1><br/>
<p>(Please specify level: beginner, intermediate or advance) </p>
<h2>Reading</h2><br/>
<label>French</label>
<input type="text" name="client_readfrench1" id="client_readfrench1" />
<label>English</label>
<input type="text" name="client_readenglish1" id="client_readenglish1" />
<label>Have you passed the test?</label>
<input type="text" name="client_langtest1" id="client_langtest1"
value="Please put Yes or No"/>
<label>If yes, please specify test</label>
<textarea name="client_specify1" id="client_specify1" rows=5 cols=40></textarea>
<label>Date Passed</label>
<input type="text" name="client_datepassed1" id="client_datepassed1" />
<h2>Writing</h2><br/>
<label>French</label>
<input type="text" name="client_readfrench2" id="client_readfrench2" />
<label>English</label>
<input type="text" name="client_readenglish2" id="client_readenglish2" />
<label>Have you passed the test?</label>
<input type="text" name="client_langtest2" id="client_langtest2"
value="Please put Yes or No"/>
<label>If yes, please specify test</label>
<textarea name="client_specify2" id="client_specify2" rows=5 cols=40></textarea>
<label>Date Passed</label>
<input type="text" name="client_datepassed2" id="client_datepassed2" />
<div>
<h2>Oral Expression</h2><br/>
<label>French</label>
<input type="text" name="client_readfrench2" id="client_readfrench2" />
<button type="submit">Submit</button>
<div class="spacer"></div>
</form>
</div>
<body>
</html>
CSS
body{
font-family:"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif;
font-size:11px;
}
p, h1, form, button{border:0; margin:0; padding:0;}
.spacer{clear:both; height:1px;}
/* ----------- My Form ----------- */
.assestment-form{
margin:0 auto;
width:400px;
padding:14px;
}
/* ----------- stylized ----------- */
#stylized{
border:solid 2px #b7ddf2;
background:#ebf4fb;
}
#stylized h1 {
font-size:20px;
font-weight:bold;
margin-bottom:8px;
float: left;
}
#stylized h2 {
font-family:"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif;
font-size:18px;
font-weight:bold;
margin-bottom:8px;
float: left;
}
#stylized p{
font-size:11px;
color:#666666;
margin-bottom:20px;
border-bottom:solid 1px #b7ddf2;
padding-bottom:10px;
}
#stylized label{
display:block;
font-weight:bold;
text-align:left;
width:140px;
float:left;
}
#stylized .small{
color:#666666;
display:block;
font-size:11px;
font-weight:normal;
text-align:left;
width:140px;
}
#stylized input{
float:left;
font-size:12px;
padding:4px 2px;
border:solid 1px #aacfe4;
width:200px;
margin:2px 0 20px 10px;
}
#stylized button{
clear:both;
margin-left:150px;
width:125px;
height:31px;
background:#666666 url(img/button.png) no-repeat;
text-align:center;
line-height:31px;
color:#FFFFFF;
font-size:11px;
font-weight:bold;
}
#stylized textarea {
loat:left;
font-size:12px;
padding:4px 2px;
border:solid 1px #aacfe4;
width:200px;
margin:2px 0 20px 10px;
}
br{
clear: left;
}
This is the mark-up I have to work with, The form is created via a wordpress plugin so I do not have control over the HTML,
<div class="wpcf7" id="wpcf7-f1-p214-o1">
<form action="/testing/contact-us/#wpcf7-f1-p214-o1" method="post" class="wpcf7-form">
<div style="display: none;">
<input type="hidden" name="_wpcf7" value="1" />
<input type="hidden" name="_wpcf7_version" value="2.4.1" />
<input type="hidden" name="_wpcf7_unit_tag" value="wpcf7-f1-p214-o1" />
</div>
<fieldset>
<span class="wpcf7-form-control-wrap Name"><input type="text" name="Name" value="Name" class="wpcf7-text wpcf7-validates-as-required" size="40" /></span><br />
<span class="wpcf7-form-control-wrap your-email"><input type="text" name="your-email" value="Email Address" class="wpcf7-text wpcf7-validates-as-email wpcf7-validates-as-required" size="40" /></span><br />
<span class="wpcf7-form-control-wrap telephone"><input type="text" name="telephone" value="Telephone" class="wpcf7-text wpcf7-validates-as-required" size="40" /></span><br />
<span class="wpcf7-form-control-wrap company"><input type="text" name="company" value="Company" class="wpcf7-text wpcf7-validates-as-required" size="40" /></span><br />
<input type="submit" value="Send" class="wpcf7-submit" /><br />
</fieldset>
<fieldset>
<span class="wpcf7-form-control-wrap town-city"><textarea name="town-city" class="wpcf7-validates-as-required" cols="40" rows="10">Atleast town/city</textarea></span><br />
</fieldset>
<fieldset>
<span class="wpcf7-form-control-wrap your-enquiry"><textarea name="your-enquiry" class="wpcf7-validates-as-required" cols="40" rows="10">Enter your enquiry</textarea></span><br />
</fieldset>
<div class="wpcf7-response-output wpcf7-display-none"></div>
</form>
And this is my current CSS,
.page-id-214 input{
margin:0px 0px 10px 0px;
width:231px;
border:1px solid #aaaaaa;
float:left;
clear:left;
}
I am trying to make it look like this,
Currently I can only get all the elements sitting on top of each other
.page-id-214 textarea {
width:206px;
height:109px;
float:left;
}
try putting
float:left;border:0;margin:0 5px;padding:0;width:206px;
height:109px;
on the fieldset elements, rather than the input. Oh, and make the selector this:
body #wpcf7-f1-p214-o1 to increase selectivity and override any other fieldset styles set on the theme:
so that's:
body #wpcf7-f1-p214-o1 {
float:left;
border:0;
margin:0 5px;
padding:0;
width:206px;
height:109px;
}