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 / 18
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

TOOLS YOU CAN USE

advertisement
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

- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5
- BBC Adopts HTML 5, Mozilla Addresses Issues
- Advanced Sticky Footers in HTML and CSS
- HTML and CSS Sticky Footers
- Strategy Analytics Predicts HTML5 Phones to ...
- HTML5 Guidelines for Web Developers
- Learning HTML5 Game Programming
- More Engaging CSS3 and HTML Background Effec...
- Engaging HTML and CSS3 Background Effects
- More Web Columns with CSS3 and HTML
- Columns with CSS3 and HTML
- Creating Inline-Block HTML Elements with CSS
- Drag and Drop in HTML5: Parsing Local Files

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



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