Home arrow HTML arrow Page 2 - Good Form, Jack
HTML

Good Form, Jack


The face of the web is changing, but are we keeping up with it? Forms are the basic unit of functionality, turning simple-looking web pages into feature-packed applications. But are we making full use of forms, pulling their full potential for making our users happy? This article describes a number of ways to customize web forms, to the ultimate goal of making users forget that they're using a form!

Author Info:
By: Justin Cook
Rating: 4 stars4 stars4 stars4 stars4 stars / 20
May 12, 2004
TABLE OF CONTENTS:
  1. · Good Form, Jack
  2. · You Gotta Have Class
  3. · Getting a Little Fancy
  4. · Prevent Annoying Error Messages
  5. · Give Them a True GUI

print this article
SEARCH DEVARTICLES

Good Form, Jack - You Gotta Have Class
(Page 2 of 5 )

Humans have a funny tendency to enjoy an aesthetically pleasing environment. We acknowledge this when we put a great deal of effort into designing a fancy Flash splash intro for our web site and spend hours tweaking the global style sheet. So then how could we forget about forms, leaving them to their default, boring look? Yes, if we type in <input type=”text” />, we should get something that looks like this:

HTML Forms

Now, I say 'should', because the rendering depends entirely on the client at this point. Yes, different browsers and even different operating systems will render the default input field how they see fit, or at least how their designers see fit. That's no good.

So when you're defining your global style sheets, don't leave out your input tags. You can create one style by defining the input tag style, but what I prefer to do is divide them out by type. I might create a class called input.textbox, and for text fields set the class=”textbox”. Generally I would redefine the default border and text family. Try this style on for size:

input.textbox {
font-family: Verdana, Geneva;
font-size: 8pt;
color:#333333;
border: 1px solid #666666;
height: 18px;
}

You'll find that this renders a much more crisp input box, that is consistent across your website. By the way, don't leave the size of the field up to the browser to determine. It is always a good idea to set the size attribute of an input field, but an even better idea to hard-code the width in pixels.


blog comments powered by Disqus
HTML ARTICLES

- Does HTML5 Need a Main Element?
- Revisiting the HTML5 vs. Native Debate
- HTML5: Not for Phone Apps?
- HTML5 or Native?
- Job Hunting? Freelancer.com Lists This Quart...
- HTML5 in the News
- Report: HTML5 Mobile Performance Lags
- The Top HTML5 Audio Players
- Top HTML5 Video Tutorials
- HTML5: Reasons to Learn and Use It
- More of the Top Tutorials for HTML5 Forms
- MobileAppWizard Releases HTML5 App Builder
- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials