<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tutorials Palace &#187; CSS From</title>
	<atom:link href="http://www.tutorialspalace.com/tag/css-from/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tutorialspalace.com</link>
	<description></description>
	<lastBuildDate>Mon, 06 Sep 2010 15:53:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Designing of Beautiful Contact Form</title>
		<link>http://www.tutorialspalace.com/2010/01/designing-of-beautiful-contact-form/</link>
		<comments>http://www.tutorialspalace.com/2010/01/designing-of-beautiful-contact-form/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 16:56:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS/HTML]]></category>
		<category><![CDATA[CSS Form Tutorial]]></category>
		<category><![CDATA[CSS From]]></category>
		<category><![CDATA[Nice Form Tutorial]]></category>

		<guid isPermaLink="false">http://www.tutorialspalace.com/?p=1134</guid>
		<description><![CDATA[I hope that this will be an interesting tutorial for you. I want to demonstrate that how I style my form input fields that is cross browser compatible all with just CSS. This is totally a new layout. All of us creates forms on websites, it may be a blog, e-commerce or even a personal [...]]]></description>
			<content:encoded><![CDATA[<p>I hope that this will be an interesting tutorial for you. I want to demonstrate that how I style my form input fields that is cross browser compatible all with just CSS. This is totally a new layout.<br />
<span id="more-1134"></span><br />
All of us creates forms on websites, it may be a blog, e-commerce or even a personal site. The way I did it in the past was declared a background image on the input element which I soon found will not work correctly. Instead I needed to put the background image on a hook like a paragraph tag and absolutely position the input element within the background image thus allowing full control of the position of the text input. Lets checkout first that what we will achieve.</p>
<p>I took the liberty of commenting anything that is not immediately clear in the CSS.</p>
<p>Now let’s take a look at the code.</p>
<p><strong>HTML</strong></p>
<pre class="codetype">
&lt;form id="nice-form" method="post"&gt; &lt;fieldset&gt;
&lt;legend&gt;Nice Contact Form&lt;/legend&gt;
&lt;label for="name"&gt;Name:&lt;/label&gt;
&lt;input name="name" type="text" /&gt;&lt;label for="email"&gt;Email:&lt;/label&gt;
&lt;input name="email" type="email" /&gt;&lt;label for="message"&gt;Message:&lt;/label&gt;
&lt;textarea cols="40" rows="10" name="message"&gt;&lt;/textarea&gt;
&lt;/fieldset&gt;
&lt;input name="submit" type="submit" value="Submit" /&gt; &lt;/form&gt;
</pre>
<p><strong>CSS</strong></p>
<pre class="codetype">
html, body {
margin:0;
padding:0;
}
#wrapper {
margin:0 auto;
width:960px;
}
fieldset {
border:none;
}
legend {
font-size:30px;
color:#BD2B7B;
font-family:Georgia, "Times New Roman", Times, serif;
}
#nice-form {
float:right;
margin:20px auto;
width:470px;
}
#nice-form label {
text-indent:-9999px; /*  Move the text off the screen while still keeping accessibility */
display:inline-block;
}
#nice-form p.name {
background:url(../images/nameinput.png) no-repeat scroll top left;
width:446px;
height:62px;
position:relative; /* To allow child containers to be positioned absolutely */
clear:both;
display:block;
}
#nice-form p.name input {
position:absolute; /* To position this container absolutely inside of #nice-form p.name parent container */
top:10px;
left:130px;
border:none; /* By default, the input field will show a border/box, this sets it to not display anything */
font-size:30px;
width:300px; /* This keeps the text within the background image so the text will not type outside of that area */
background:none; /* This sets the background color to none so you will not see a default white */
font-family:Georgia, "Times New Roman", Times, serif;
color:#999;
display:block;
}
#nice-form p.email {
background:url(../images/emailinput.png) no-repeat scroll top left;
width:446px;
height:62px;
position:relative;
clear:both;
display:block;
}
#nice-form p.email input {
position:absolute; /* To position this container absolutely inside of #nice-form p.name parent container */
top:10px;
left:130px;
border:none; /* By default, the input field will show a border/box, this sets it to not display anything */
font-size:30px;
width:300px; /* This keeps the text within the background image so the text will not type outside of that area */
background:none; /* This sets the background color to none so you will not see a default white */
font-family:Georgia, "Times New Roman", Times, serif;
color:#999;
display:block;
}
#nice-form p.textarea {
background:url(../images/textinput.png) no-repeat scroll top left;
width:446px;
height:302px;
position:relative;
}
#nice-form p.textarea textarea {
position:absolute; /* To position this container absolutely inside of #nice-form p.name parent container */
top:20px;
left:140px;
border:none; /* By default, the input field will show a border/box, this sets it to not display anything */
font-size:20px;
width:290px; /* This keeps the text within the background image so the text will not type outside of that area */
background:none; /* This sets the background color to none so you will not see a default white */
font-family:Georgia, "Times New Roman", Times, serif;
color:#999;
overflow:auto; /* This ensures that there should be any text overflow, it would automatically determine to use vertical and horizontal scrollbars */
display:block;
}
#nice-form .button {
background:url(../images/button.png) no-repeat top left;
width:121px;
height:57px;
text-indent:-9999px;  /*  Move the text off the screen while still keeping accessibility */
border:none; /* This sets the background color to none so you will not see a default white */
cursor:pointer; /*Since we are using a background image, this will set the mouse cursor to change when hovering over so you know it is a clickable button */
overflow:hidden; /* hides any graphic/image element if it overflows */
display:block;
line-height:0; /* this is really a hack for IE6 and IE7 because text-indent will not work here unless the line-height is set to zero */
}
</pre>
<p>This technique has been tested on IE6,IE7,IE8,FF (latest), Opera (latest), Safari (latest), and Chrome (latest).</p>
<p>Although I know this wasn’t a step by step tutorial but I figure the comments on the stylesheet should explain most of whats going on. But if for some reason you think this does not suffice, please let me know and I will write this out in a tutorial step by step style. Enjoy and have fun!</p>
<img src="http://www.tutorialspalace.com/?ak_action=api_record_view&id=1134&type=feed" alt="" /><h3  class="related_post_title">Random Posts</h3><ul class="related_post"><li>February 6, 2010 -- <a href="http://www.tutorialspalace.com/2010/02/microsoft-word-2007-tips-tricks-and-tutorials/" title="Microsoft Word 2007 Tips, Tricks, and Tutorials">Microsoft Word 2007 Tips, Tricks, and Tutorials</a> (5)</li><li>November 16, 2009 -- <a href="http://www.tutorialspalace.com/2009/11/fire-text-tutorial/" title="Fire Text Tutorial">Fire Text Tutorial</a> (1)</li><li>July 28, 2009 -- <a href="http://www.tutorialspalace.com/2009/07/how-to-make-backgrounds-and-wallpaper/" title="How to make Backgrounds and Wallpaper">How to make Backgrounds and Wallpaper</a> (3)</li><li>August 7, 2010 -- <a href="http://www.tutorialspalace.com/2010/08/how-to-make-hitman-in-adobe-illustrator/" title="How to Make Hitman in Adobe Illustrator">How to Make Hitman in Adobe Illustrator</a> (24)</li><li>May 11, 2010 -- <a href="http://www.tutorialspalace.com/2010/05/40-outstanding-css3-tutorials-for-web-development/" title="40+ Outstanding CSS3 Tutorials for Web Development">40+ Outstanding CSS3 Tutorials for Web Development</a> (16)</li><li>August 19, 2010 -- <a href="http://www.tutorialspalace.com/2010/08/40-excellent-photoshop-photo-manipulation-tutorial/" title="40+ Excellent Photoshop Photo Manipulation Tutorial">40+ Excellent Photoshop Photo Manipulation Tutorial</a> (9)</li><li>July 30, 2010 -- <a href="http://www.tutorialspalace.com/2010/07/php-login-script-tutorial/" title="PHP Login Script Tutorial">PHP Login Script Tutorial</a> (13)</li><li>December 4, 2009 -- <a href="http://www.tutorialspalace.com/2009/12/folding-paper-effect/" title="Folding Paper Effect">Folding Paper Effect</a> (18)</li><li>August 3, 2009 -- <a href="http://www.tutorialspalace.com/2009/08/fun-with-facial-hair/" title="Fun With Facial Hair">Fun With Facial Hair</a> (2)</li><li>July 9, 2009 -- <a href="http://www.tutorialspalace.com/2009/07/turn-a-photo-into-a-sketch-for-making-coloring-books/" title="Turn A Photo Into A Sketch For Making Coloring Books">Turn A Photo Into A Sketch For Making Coloring Books</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.tutorialspalace.com/2010/01/designing-of-beautiful-contact-form/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
