There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Solved: creating css forms


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
aconite's Avatar
Senior Member with 171 posts.
 
Join Date: Feb 2006
Experience: Intermediate
06-Jul-2007, 12:51 PM #1
Solved: creating css forms
hi,

I have never created forms using css and need some help, how can I move the word 'your message ' to the top of the textarea box. Attached is a picture of the page, as yet I do not have hosting so can't upload the url

CSS
h3 {
font-family:"Century Gothic";
font-size:1.4em;
color:#818d99;
font-weight:normal;
margin-left:6%;
}

#form {
width:4em;
text-align:right;
float:left;
display:block;
font-size:1.2em;
line-height:260%;
margin-right:6em;
}

.submit input {
margin-left:7.5em;
background:#cbd7e6;
border:2px outset #96adbf;
}

input {
color:#000000;
background:#ffffff;
border:1px solid #000000;
}

textarea.white {
background-color:#FFFFFF;
color:#000000;
border:1px solid #000000;
}

p {
margin-left:6%;
}

HTML
<h3>CONTACT PHOTO RESTORATION EXPERT</h3>
&nbsp;
<form action="" method="post">
<p>Your Name: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <input type="text" size="45" /></p>
<p>Your Email: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <input type="text" size="45" /></p>
<p>Subject: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <input type="text" size="45" /></p>
<p>Your Message: &nbsp; &nbsp; <textarea class="white" cols="45" rows="20"></textarea></p>
<p class="submit"><input type="submit" value="Submit" /></p>
</form></div>

thanks
Attached Thumbnails
solved-creating-css-forms-contact-photo-restoration-expert-page.png  
jaymanson's Avatar
Computer Specs
Senior Member with 213 posts.
 
Join Date: Mar 2007
Location: Christchurch, New Zealand
Experience: Advanced Design/HTML/CSS - Intermediate PHP
07-Jul-2007, 12:05 AM #2
Hi,

The main problem is that the input areas are inside <p> tags. You should avoid putting anything other than text inside a <p> tag. Also worth a mention, the #form element in the CSS will have no effect as there is nothing with an id of 'form' in the HTML. Here's the form with a few adjustments and a little code tidy

CSS
Code:
h3 {
font-family:"Century Gothic";
font-size:1.4em;
color:#818d99;
font-weight:normal;
margin-left:6%;
}

#form {
width:500px;
}

#form p {
float: left;
width: 20%;
padding: 0;
margin: 0;
}

.input {
float: right;
width: 79%;
border:1px solid #000000;
}

.submit {
float: left;
margin-left: 102px;
background: #cbd7e6;
border: 2px outset #96adbf;
}

br {
clear: both;
}
HTML
Code:
<h3>CONTACT PHOTO RESTORATION EXPERT</h3>
<form id="form" action="" method="post">
<p>Your Name:</p><input class="input" type="text" /><br /><br />
<p>Your Email:</p><input class="input" type="text" /><br /><br />
<p>Subject:</p><input class="input" type="text" /><br /><br />
<p>Your Message:</p><textarea class="input" rows="20"></textarea><br /><br />
<input class="submit" type="submit" value="Submit" />
</form>
You can obviously style this further, but hopefully you can see what I've done there

Jay

Last edited by jaymanson : 07-Jul-2007 02:41 AM.
aconite's Avatar
Senior Member with 171 posts.
 
Join Date: Feb 2006
Experience: Intermediate
10-Jul-2007, 06:15 AM #3
thank you once again jay
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 01:56 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.