Skip navigation.

Forestgan

CSS layout in China

一个遵照 WCAG 指导原则设计的表单

, , ,

表单是网页中一个不可缺少的部分,如何使表单更具有亲和力了?这是一个遵照 WCAG 指导原则设计的表单,许多地方都努力去做了。

fieldset标签
fieldset标签会在包含的文本和input等表单元素外面形成一个方框,legend元素作为标题。

Label标签
Label 用于表单元素 (input, textarea or select),配于 for 将值传递给相应的表单元素。

tabindex
用于 input, textarea......,给其一个编号,使用键盘上的TAB(制表键),就很容易地进入输入框中。

背景和前景色
背景: #FFFFF,前景:#333333,色彩差异: 612 > 500,亮度差异: 204 > 125 ,符合要求。

代码:

<form action="index.html">
<fieldset>
<legend>Contact Form</legend>
<div>
<label for="name">Name : </label>
<input name="name" type="text" id="name" value="Enter your name here *" maxlength="30" tabindex="1" />
</div>
<div>
<label for="email">E-mail : </label>
<input name="email" type="text" id="email" value="Enter your E-mail here *" maxlength="35" tabindex="2" />
</div>
<div>
<label for="title">Title : </label>
<input name="title" type="text" id="title" value="Enter title here *" maxlength="30" tabindex="3" />
</div>
<div>
<label for="introduce">Comments : </label>
<textarea name="introduce" cols="50" rows="8" id="introduce" tabindex="4">Enter comments here *</textarea>
</div>
</fieldset>
<div class="center">
<input name="cmdOk" type="submit" class="button" value="Send" tabindex="5" />
<input name="cmdReset" type="reset" class="button" value="Reset" tabindex="6" />
</div>
</form>


演示地址

利用CSS 的 Clip 属性来创造 多彩文字(Multi Colored Text)让More和更多链接具有亲和力和无障碍化

Comments

Anonymous 11. October 2006, 03:37

renx writes:

这个表单很棒~~
:)

Anonymous 2. April 2007, 08:21

Anonymous writes:

IE 7 下直接点击RESET,哦,看到了什么?

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

If you can't read the words, press the small reload icon.


Smilies

December 2009
S M T W T F S
November 2009January 2010
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31