Although forms make the Web go around, they are often ugly due to the generic way in which browsers display them, not to mention irritating to our site's users when they don't work as expected. Christopher Schmitt walks through the problem CSS properties, Web form elements and points fingers at the browsers getting it wrong. Then he shows you how to make a decent form out of Band-Aids and broken browsers.
27. CSS & TEXTAREA
20
15
10
5
0
IE6 IE7 IE8b2 Ch Mac FF3 Win FF3 Mac Op9 Win Op9 Mac S3 Win S3 Mac S4b Win S4b
Yes No Somewhat N/A
28. CSS & INPUT TEXT FIELDS
20
15
10
5
0
IE6 IE7 IE8b2 Ch Mac FF3 Win FF3 Mac Op9 Win Op9 Mac S3 Win S3 Mac S4b Win S4b
Yes No Somewhat N/A
29. CSS & SUBMIT BUTTON
20
15
10
5
0
IE6 IE7 IE8b2 Ch Mac FF3 Win FF3 Mac Op9 Win Op9 Mac S3 Win S3 Mac S4b Win S4b
Yes No Somewhat N/A
30. CSS & SELECT BOXES (ONE)
20
15
10
5
0
IE6 IE7 IE8b2 Ch Mac FF3 Win FF3 Mac Op9 Win Op9 Mac S3 Win S3 Mac S4b Win S4b
Yes No Somewhat N/A
31. CSS & SELECT BOXES (MULTI)
20
15
10
5
0
IE6 IE7 IE8b2 Ch Mac FF3 Win FF3 Mac Op9 Win Op9 Mac S3 Win S3 Mac S4b Win S4b
Yes No Somewhat N/A
32. CSS & FILE UPLOADS
20
15
10
5
0
IE6 IE7 IE8b2 Ch Mac FF3 Win FF3 Mac Op9 Win Op9 Mac S3 Win S3 Mac S4b Win S4b
Yes No Somewhat N/A
33. CSS & CHECKBOXES
20
15
10
5
0
IE6 IE7 IE8b2 Ch Mac FF3 Win FF3 Mac Op9 Win Op9 Mac S3 Win S3 Mac S4b Win S4b
Yes No Somewhat N/A
34. CSS & RADIO BUTTONS
20
15
10
5
0
IE6 IE7 IE8b2 Ch Mac FF3 Win FF3 Mac Op9 Win Op9 Mac S3 Win S3 Mac S4b Win S4b
Yes No Somewhat N/A
35. Radio Check File Select Select Input Text
Buttons Boxes Uploads (Multi) (One) Text Area
36.
37. CSS PROPERTIES
100
75
50
25
0
height letter-spacing line-height margin padding text-align text-decoration text-indent width word-spacing
Y N S N/A
38. CSS PROPERTIES
100
75
50
25
0
bkgd-color bkgd-image border border-color border-style border-width color font-family font-size font-weight
Y N S N/A
39. Text Indent Font Family Height Font Size Margin
Text Border Color Color Border Style Background
Decoration Color
Font Weight Background Letter Spacing
Image Width
Word Spacing Padding
Border
40. Radio Check File Select Select Input Text
Buttons Boxes Uploads (Multi) (One) Text Area
Text Indent Font Family Height Font Size Margin
Text Border Color Color Border Style Background
Decoration Color
Font Weight Background Letter Spacing
Image Width
Word Spacing Padding
Border
41. MacFF3
MacS4b WinOp9
WinS3 IE7 IE6 Chrome WinS4b
WinFF3 IE8b2
MacS3
Radio Check File Select Select Input Text
Buttons Boxes Uploads (Multi) (One) Text Area
Text Indent Font Family Height Font Size Margin
Text Border Color Color Border Style Background
Decoration Color
Font Weight Background Letter Spacing
Image Width
Word Spacing Padding
Border
42.
43.
44.
45.
46.
47.
48.
49. LET BROWSER VENDORS
KNOW WHAT YOU WANT
• Internet Explorer
• http://blogs.msdn.com/ie/contact.aspx
• Opera
• http://my.opera.com/community/forums/forum.dml?id=24
• http://groups.google.com/group/opera.wishlist/topics
• Safari
• http://lists.webkit.org/mailman/listinfo/webkit-dev
• Google Chrome
• http://groups.google.com/group/chromium-dev
50. LET BROWSER VENDORS
KNOW WHAT YOU WANT
• Web Form Elements Design Quiz
• Part 1: http://tr.im/lp2k
• Part 2: http://tr.im/lp2g
• http://www.WebFormElements.com/
• 3,500 form element screen captures
• HTML form element look-up tables (free):
• http://oreilly.com/catalog/9780596527419/appendixd/appd.pdf
55. ZERO OUT CSS PROPERTIES
• Zero out Borders
• Zero out Padding
• Zero Margins
• Clear out Background Images, Color, etc.
• Then
• wrap INPUT element with DIVs and bring in the control
56.
57. SLOW WAY TO ZERO
<input type="submit" value="submit" class="submit" />
58. FASTER WAY TO ZERO
input { /* type selector */
border: 1px solid black;
}
.submit { /* class selector */
border: 1px solid black;
}
87. TAKE AWAYS
• Designing for forms is hard for HTML+CSS
• Even the same browser, different platform render Web forms
differently
• To
help you discern the safety of CSS on a Web form, use
WebFormElements.com
• Reviewed which browsers are most hazardous
88. TAKE AWAYS
• Reviewed which CSS properties are supported the most.
• Reviewed what high-profile sites are doing to design for forms:
Nothing.
• Call to action!
• Letbrowser vendors hear you or they won’t care to fix the
problem.
• With HTML5 form elements, problem is going to get worse.