Become a webdsign master


stylish and accessible form using CSS

Stylish  and  accessible  forms  in  CSSIf you look through the code you will see
some tags which you may deem as unnecessary
The majority of sites designed these days(i.etags after the radio button). These are
have at least one form. If you're a webto enable a cross browser compatible layout.
designer then you'll know that creating aWithin the CSS code you will notice at the
template is essential if you are to bebeginning that all the margins and padding
efficient in your work. Many times I'veare set to zero. Alternatively you could
compromised on a form's design due to timeplace the form in a div with zero margins and
restrictions. Below is a template that I usepadding  but  it  is  entirely  up  to  you.
and that is quite flexible in its design.
This form allows for any type of input fieldCSS  Code
from a simple textfield to a group of radio
buttons. If your quite comfortable with CSS* { margin: 0; padding: 0; }
then please feel free to adapt this code.form.cssform { width: 430px;
The fun you can have with this form canfont-size: 0.8em;
really change the way your forms look andline-height: 20px;
make a great deal of difference to yourfont-family: Tahoma, Verdana; } fieldset {
overall  web  site  design.margin-bottom: 10px; border: none; }
label { line-height: 1.8; vertical-align:
XHTML  CODEtop; float: left; text-align: right;
margin-right: 1em; width: 120px;
Below is a basic form structure. I've usedfont-weight: bold; } fieldset ol, li {
ordered  lists to  segment  the  form  andmargin: 0px; padding: 5px;
list-style: none; } fieldset fieldset {
1. tags for each row of the form just as Iborder: none; margin: 3px 0 0; } fieldset
find this easily breaks up the code for usefieldset legend { padding: 0 0 5px;
by  novice  CSS  users.color: #000000; } legend { padding: 0
10px 0 10px; font-weight: bold; }
fieldset fieldset label { font-weight:
normal; width: 170px; margin-left: 123px;
2. *  Surname:text-align: left; } form em {
font-style: normal; font-weight: bold;
3. *  Forename:color: #FF0000; } input.newfield {
background: url(../images/newfield.gif)
4. Company:repeat-x 0 100%; border: none;
font-weight: bold; } textarea { float:
5. *  Post  Code:left; background: none; border: 1px solid
#999999; width: 100%; font-weight: bold;
6. Gender *font-size: 1em; } .submitbutton { width:
Male10em; height: 1.6em; font-weight: bold;
color: #FFFFFF; background-color: #99ccff;
Femalebackground-position:  center; }
7. Additional  informationBrowser  Compatibility
Additional  TagsCurrently this form has been tested and works
in IE5.5, IE6.0 and IE7 and Firefox.



1 A B C D E 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128