SlideShare a Scribd company logo
1 of 91
Download to read offline
CSS & WEB FORM ELEMENTS
 Christopher Schmitt | http://twitter.com/teleject
http://brightbytes.com/phineasgage/index.html
(   )=
     /   (   )
FORM ELEMENTS

• Checkboxes          • Select:

• Input:                • Multiple   Items

  • File                • Single   Item

  • Radio             • Submit    Button

  • Text              • Textarea
CSS PROPERTIES

• background-color      • height
• background-image      • letter-spacing
• border                • line-height
• border-color          • margin
• border-style          • padding
• border-width          • text-align
• color                 • text-decoration
• font-family           • text-indent
• font-size             • width
• font-weight           • word-spacing
7.2    5    8.5   1.5    3   1
      5.5    9    2.0   4b
       6          3.0
       7
      8b2
7.2         9     1.5    2
                  2.0    3
                  3.0   4b
3,520
 screengrabs
RADIO BUTTONS
CSS HEIGHT
  FF 2


  FF 2


  FF 3


Chrome 1
CSS WIDTH
  FF 3

  FF 3

Safari 3

Safari 3

Safari 4b

Safari 4b
CSS TEXT INDENT
Chrome 1


Safari 4b


Safari 4b


Opera 9


Opera 9
CSS BACKGROUND COLOR
 IE 6


 IE 7


IE 8b2


Opera 9


Opera 9
CSS BACKGROUND IMG
Firefox 2

Firefox 2

  IE 6

  IE 7

 IE 8b2

Opera 9

Opera 9
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
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
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
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
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
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
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
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
Radio    Check     File     Select   Select   Input   Text
Buttons   Boxes   Uploads   (Multi)   (One)     Text   Area
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
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
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
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
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
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
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
HOW TO DESIGN FOR
SERIOUSLY MESSY FORMS
SURRENDER
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
SLOW WAY TO ZERO


<input type="submit" value="submit" class="submit" />
FASTER WAY TO ZERO
   input { /* type selector */
     border: 1px solid black;
   }
   .submit { /* class selector */
     border: 1px solid black;
   }
FASTER WAY TO ZERO
 input[type="text"] {
   border: 1px solid #177F75;
   font-family:Verdana, Arial, Helvetica, sans-serif;
 }
 input[type="submit"] {
   margin-left: 201px;
   background-color: #00CC00;
 }
 input[type="text"], select {
   display: block;
   float: left;
   margin-bottom: 7px;
 }
FASTER WAY TO ZERO


label[for="byear"], label[for="bdate"] {
  position: absolute;
  left: -999px;
  width: 990px;
}
DROP SHADOWS,
ROUNDED CORNERS,
    OH MY!
BASIC FORM
<form id="webmailForm" action="/-/">
<fieldset>
 <label for="email">Email</label>
 <input id="email" type="text" value="a.graham@example.com" />
</fieldset>
<fieldset>
 <label for="message">Message</label>
 <textarea id="comment">Mr. Watson -- come here.</textarea>
</fieldset>
</form>
BASIC FORM
<form id="webmailForm" action="/-/">
<fieldset>
 <label for="email">Email</label>
 <input id="email" type="text" value="a.graham@example.com" />
</fieldset>
<fieldset>
 <label for="message">Message</label>
 <textarea id="comment">Mr. Watson -- come here.</textarea>
</fieldset>
</form>
BASIC FORM
#webmailForm fieldset {

 margin: 0 0 15px 0;

 border: 0;
}
#webmailForm fieldset label {

 display: block;

 margin: 0 0 5px 0;

 font-weight: bold;
}
COOL FORM

#webmailForm fieldset input,
#webmailForm fieldset textarea {

 width: 550px;

 padding: 10px;

 font-size: 1.2em;

 border: none; /* zero out */

 background: #fcf;
 }
COOL FORM

#webmailForm fieldset input,
#webmailForm fieldset textarea {

 width: 550px;

 padding: 10px;

 font-size: 1.2em;

 border: none; /* zero out */

 background: #fcf;

 background-image: url(form-bkgd2.png);

 background-repeat: repeat-x;
 }
COOL FORM
#webmailForm fieldset input,
#webmailForm fieldset textarea {

 width: 550px;

 padding: 10px;

 font-size: 1.2em;

 border: none; /* zero out */

 background: #fcf;

 background-image: url(form-bkgd2.png);

 background-repeat: repeat-x;

 border-bottom: 1px solid #fff;

 border-right: 1px solid #fff;
 }
COOL FORM
#webmailForm fieldset input,
#webmailForm fieldset textarea {

 width: 550px;

 padding: 10px;

 font-size: 1.2em;

 border: none; /* zero out */

 background: #fcf;

 background-image: url(form-bkgd2.png);

 background-repeat: repeat-x;

 border-bottom: 1px solid #fff;

 border-right: 1px solid #fff;

 border-radius: 7px;

 -webkit-border-radius: 7px;

 -moz-border-radius: 7px;
 }
OTHER CSS3 PROPERTIES
ENABLED & DISABLED
  FORM ELEMENTS

<div>Enabled:<br />
<input name="enabled" type="text" value="Hello,
world!" />
</div>

<div>Disabled:<br />
<input name="disabled" type="text" value="Hello,
world!" disabled="disabled" />
</div>
ENABLED & DISABLED
  FORM ELEMENTS
ENABLED & DISABLED
  FORM ELEMENTS


input[type="text"]:disabled{
  opacity: .7;
  filter: alpha(opacity=70); /* cough */
}
ENABLED & DISABLED
  FORM ELEMENTS


input[type="text"]:disabled:after {
  content: "(disabled - do not use)";
  font-size: .9em;
  color: #CCCCCC;
  display: block;
}
ENABLED & DISABLED
  FORM ELEMENTS
ENABLED & DISABLED
  FORM ELEMENTS

   option:enabled{
     color: #9F393F;
   }

   input:enabled{
     background: #21B6A8;
     color:#9F393F;
   }
ENABLED & DISABLED
  FORM ELEMENTS
CHECKED RADIO
FORM ELEMENTS


input[type="radio"]:checked{
  background: #9F393F;
}
CHECKED RADIO
FORM ELEMENTS
THAT’S IT...
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
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.
...AND STOP ADAPTING.
THANK YOU!
  Christopher Schmitt
schmitt@heatvision.com
  @teleject on twitter
CREATIVE COMMONS CITATIONS
   http://www.flickr.com/photos/lanuiop/2234239588/
 http://www.flickr.com/photos/gaetanlee/1947424580/
    http://www.flickr.com/photos/evapro/312900784/
     http://www.flickr.com/photos/kekka/799060449/
http://www.flickr.com/photos/hiddedevries/2594048276/
  http://www.flickr.com/photos/tomsaint/2992217972/

More Related Content

Similar to The CSS Summit: CSS & Form Elements

Similar to The CSS Summit: CSS & Form Elements (20)

Web Form Elements
Web Form ElementsWeb Form Elements
Web Form Elements
 
[heweb11] CSS3 Makeover
[heweb11] CSS3 Makeover[heweb11] CSS3 Makeover
[heweb11] CSS3 Makeover
 
Type is Beautiful
Type is BeautifulType is Beautiful
Type is Beautiful
 
CSS3 3D Workshop
CSS3 3D WorkshopCSS3 3D Workshop
CSS3 3D Workshop
 
Why CSS Was Invented (Håkon Wium Lie)
Why CSS Was Invented (Håkon Wium Lie)Why CSS Was Invented (Håkon Wium Lie)
Why CSS Was Invented (Håkon Wium Lie)
 
(Web ) Typography
(Web ) Typography(Web ) Typography
(Web ) Typography
 
[WebVisions 2010] CSS3 Workshop (Afternoon)
[WebVisions 2010] CSS3 Workshop (Afternoon)[WebVisions 2010] CSS3 Workshop (Afternoon)
[WebVisions 2010] CSS3 Workshop (Afternoon)
 
[Worskhop Summits] CSS3 Workshop
[Worskhop Summits] CSS3 Workshop[Worskhop Summits] CSS3 Workshop
[Worskhop Summits] CSS3 Workshop
 
Css3 101
Css3 101Css3 101
Css3 101
 
CSS tutorial chapter 2
CSS tutorial chapter 2CSS tutorial chapter 2
CSS tutorial chapter 2
 
The State of Web Type
The State of Web TypeThe State of Web Type
The State of Web Type
 
Web Fonts: Why Bother?
Web Fonts: Why Bother?Web Fonts: Why Bother?
Web Fonts: Why Bother?
 
01 Introduction To CSS
01 Introduction To CSS01 Introduction To CSS
01 Introduction To CSS
 
New Web Typography
New Web TypographyNew Web Typography
New Web Typography
 
Omeka css
Omeka cssOmeka css
Omeka css
 
Le Wagon Tokyo | Build your Landing Page in 2 hours
Le Wagon Tokyo | Build your Landing Page in 2 hoursLe Wagon Tokyo | Build your Landing Page in 2 hours
Le Wagon Tokyo | Build your Landing Page in 2 hours
 
Big Design Conference: CSS3
Big Design Conference: CSS3 Big Design Conference: CSS3
Big Design Conference: CSS3
 
The Trouble With Type
The Trouble With TypeThe Trouble With Type
The Trouble With Type
 
2h landing page
2h landing page 2h landing page
2h landing page
 
CSS 3
CSS 3CSS 3
CSS 3
 

More from Christopher Schmitt

Keeping Colors from Killing Your Product
Keeping Colors from Killing Your ProductKeeping Colors from Killing Your Product
Keeping Colors from Killing Your ProductChristopher Schmitt
 
[funka] Adaptive Images in Responsive Web Design
[funka] Adaptive Images in Responsive Web Design[funka] Adaptive Images in Responsive Web Design
[funka] Adaptive Images in Responsive Web DesignChristopher Schmitt
 
[Austin WordPress Meetup] Adaptive Images in Responsive Web Design
[Austin WordPress Meetup] Adaptive Images in Responsive Web Design[Austin WordPress Meetup] Adaptive Images in Responsive Web Design
[Austin WordPress Meetup] Adaptive Images in Responsive Web DesignChristopher Schmitt
 
[CSSDevConf] Adaptive Images in Responsive Web Design 2014
[CSSDevConf] Adaptive Images in Responsive Web Design 2014[CSSDevConf] Adaptive Images in Responsive Web Design 2014
[CSSDevConf] Adaptive Images in Responsive Web Design 2014Christopher Schmitt
 
[rwdsummit] Adaptive Images in Responsive Web Design
[rwdsummit] Adaptive Images in Responsive Web Design[rwdsummit] Adaptive Images in Responsive Web Design
[rwdsummit] Adaptive Images in Responsive Web DesignChristopher Schmitt
 
[artifactconf] Github for People Who Don't Code
[artifactconf] Github for People Who Don't Code[artifactconf] Github for People Who Don't Code
[artifactconf] Github for People Who Don't CodeChristopher Schmitt
 
[cssdevconf] Adaptive Images in Responsive Web Design
[cssdevconf] Adaptive Images in Responsive Web Design[cssdevconf] Adaptive Images in Responsive Web Design
[cssdevconf] Adaptive Images in Responsive Web DesignChristopher Schmitt
 
[parisweb] Adaptive Images in Responsive Web Design
[parisweb] Adaptive Images in Responsive Web Design[parisweb] Adaptive Images in Responsive Web Design
[parisweb] Adaptive Images in Responsive Web DesignChristopher Schmitt
 
[peachpit] Adaptive Images in Responsive Web Design
[peachpit] Adaptive Images in Responsive Web Design[peachpit] Adaptive Images in Responsive Web Design
[peachpit] Adaptive Images in Responsive Web DesignChristopher Schmitt
 
[jqconatx] Adaptive Images for Responsive Web Design
[jqconatx] Adaptive Images for Responsive Web Design[jqconatx] Adaptive Images for Responsive Web Design
[jqconatx] Adaptive Images for Responsive Web DesignChristopher Schmitt
 
[wvbcn] Adaptive Images in Responsive Web Design
[wvbcn] Adaptive Images in Responsive Web Design[wvbcn] Adaptive Images in Responsive Web Design
[wvbcn] Adaptive Images in Responsive Web DesignChristopher Schmitt
 
[drupalcampatx] Adaptive Images in Responsive Web Design
[drupalcampatx] Adaptive Images in Responsive Web Design[drupalcampatx] Adaptive Images in Responsive Web Design
[drupalcampatx] Adaptive Images in Responsive Web DesignChristopher Schmitt
 
[refreshpitt] Adaptive Images in Responsive Web Design
[refreshpitt] Adaptive Images in Responsive Web Design[refreshpitt] Adaptive Images in Responsive Web Design
[refreshpitt] Adaptive Images in Responsive Web DesignChristopher Schmitt
 
[psuweb] Adaptive Images in Responsive Web Design
[psuweb] Adaptive Images in Responsive Web Design[psuweb] Adaptive Images in Responsive Web Design
[psuweb] Adaptive Images in Responsive Web DesignChristopher Schmitt
 
GitHub for People Who Don't Code
GitHub for People Who Don't CodeGitHub for People Who Don't Code
GitHub for People Who Don't CodeChristopher Schmitt
 
[wcatx] Adaptive Images in Responsive Web Design
[wcatx] Adaptive Images in Responsive Web Design[wcatx] Adaptive Images in Responsive Web Design
[wcatx] Adaptive Images in Responsive Web DesignChristopher Schmitt
 
[HEWEBFL] Adaptive Images in Responsive Web Design
[HEWEBFL] Adaptive Images in Responsive Web Design[HEWEBFL] Adaptive Images in Responsive Web Design
[HEWEBFL] Adaptive Images in Responsive Web DesignChristopher Schmitt
 
[refreshaustin] Adaptive Images in Responsive Web Design
[refreshaustin] Adaptive Images in Responsive Web Design[refreshaustin] Adaptive Images in Responsive Web Design
[refreshaustin] Adaptive Images in Responsive Web DesignChristopher Schmitt
 
[sxsw2013] Extremely Compressed JPEGs
[sxsw2013] Extremely Compressed JPEGs[sxsw2013] Extremely Compressed JPEGs
[sxsw2013] Extremely Compressed JPEGsChristopher Schmitt
 

More from Christopher Schmitt (20)

Keeping Colors from Killing Your Product
Keeping Colors from Killing Your ProductKeeping Colors from Killing Your Product
Keeping Colors from Killing Your Product
 
[funka] Adaptive Images in Responsive Web Design
[funka] Adaptive Images in Responsive Web Design[funka] Adaptive Images in Responsive Web Design
[funka] Adaptive Images in Responsive Web Design
 
[Austin WordPress Meetup] Adaptive Images in Responsive Web Design
[Austin WordPress Meetup] Adaptive Images in Responsive Web Design[Austin WordPress Meetup] Adaptive Images in Responsive Web Design
[Austin WordPress Meetup] Adaptive Images in Responsive Web Design
 
[CSSDevConf] Adaptive Images in Responsive Web Design 2014
[CSSDevConf] Adaptive Images in Responsive Web Design 2014[CSSDevConf] Adaptive Images in Responsive Web Design 2014
[CSSDevConf] Adaptive Images in Responsive Web Design 2014
 
[rwdsummit] Adaptive Images in Responsive Web Design
[rwdsummit] Adaptive Images in Responsive Web Design[rwdsummit] Adaptive Images in Responsive Web Design
[rwdsummit] Adaptive Images in Responsive Web Design
 
[artifactconf] Github for People Who Don't Code
[artifactconf] Github for People Who Don't Code[artifactconf] Github for People Who Don't Code
[artifactconf] Github for People Who Don't Code
 
[cssdevconf] Adaptive Images in Responsive Web Design
[cssdevconf] Adaptive Images in Responsive Web Design[cssdevconf] Adaptive Images in Responsive Web Design
[cssdevconf] Adaptive Images in Responsive Web Design
 
[parisweb] Adaptive Images in Responsive Web Design
[parisweb] Adaptive Images in Responsive Web Design[parisweb] Adaptive Images in Responsive Web Design
[parisweb] Adaptive Images in Responsive Web Design
 
[peachpit] Adaptive Images in Responsive Web Design
[peachpit] Adaptive Images in Responsive Web Design[peachpit] Adaptive Images in Responsive Web Design
[peachpit] Adaptive Images in Responsive Web Design
 
[jqconatx] Adaptive Images for Responsive Web Design
[jqconatx] Adaptive Images for Responsive Web Design[jqconatx] Adaptive Images for Responsive Web Design
[jqconatx] Adaptive Images for Responsive Web Design
 
[wvbcn] Adaptive Images in Responsive Web Design
[wvbcn] Adaptive Images in Responsive Web Design[wvbcn] Adaptive Images in Responsive Web Design
[wvbcn] Adaptive Images in Responsive Web Design
 
[drupalcampatx] Adaptive Images in Responsive Web Design
[drupalcampatx] Adaptive Images in Responsive Web Design[drupalcampatx] Adaptive Images in Responsive Web Design
[drupalcampatx] Adaptive Images in Responsive Web Design
 
[refreshpitt] Adaptive Images in Responsive Web Design
[refreshpitt] Adaptive Images in Responsive Web Design[refreshpitt] Adaptive Images in Responsive Web Design
[refreshpitt] Adaptive Images in Responsive Web Design
 
[psuweb] Adaptive Images in Responsive Web Design
[psuweb] Adaptive Images in Responsive Web Design[psuweb] Adaptive Images in Responsive Web Design
[psuweb] Adaptive Images in Responsive Web Design
 
GitHub for People Who Don't Code
GitHub for People Who Don't CodeGitHub for People Who Don't Code
GitHub for People Who Don't Code
 
[wcatx] Adaptive Images in Responsive Web Design
[wcatx] Adaptive Images in Responsive Web Design[wcatx] Adaptive Images in Responsive Web Design
[wcatx] Adaptive Images in Responsive Web Design
 
[HEWEBFL] Adaptive Images in Responsive Web Design
[HEWEBFL] Adaptive Images in Responsive Web Design[HEWEBFL] Adaptive Images in Responsive Web Design
[HEWEBFL] Adaptive Images in Responsive Web Design
 
[refreshaustin] Adaptive Images in Responsive Web Design
[refreshaustin] Adaptive Images in Responsive Web Design[refreshaustin] Adaptive Images in Responsive Web Design
[refreshaustin] Adaptive Images in Responsive Web Design
 
[sxsw2013] Extremely Compressed JPEGs
[sxsw2013] Extremely Compressed JPEGs[sxsw2013] Extremely Compressed JPEGs
[sxsw2013] Extremely Compressed JPEGs
 
[amigos] HTML5 and CSS3
[amigos] HTML5 and CSS3[amigos] HTML5 and CSS3
[amigos] HTML5 and CSS3
 

Recently uploaded

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 

Recently uploaded (20)

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

The CSS Summit: CSS & Form Elements

  • 1. CSS & WEB FORM ELEMENTS Christopher Schmitt | http://twitter.com/teleject
  • 2.
  • 3.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9. ( )= / ( )
  • 10.
  • 11.
  • 12. FORM ELEMENTS • Checkboxes • Select: • Input: • Multiple Items • File • Single Item • Radio • Submit Button • Text • Textarea
  • 13. CSS PROPERTIES • background-color • height • background-image • letter-spacing • border • line-height • border-color • margin • border-style • padding • border-width • text-align • color • text-decoration • font-family • text-indent • font-size • width • font-weight • word-spacing
  • 14. 7.2 5 8.5 1.5 3 1 5.5 9 2.0 4b 6 3.0 7 8b2 7.2 9 1.5 2 2.0 3 3.0 4b
  • 16.
  • 17.
  • 18.
  • 19.
  • 21. CSS HEIGHT FF 2 FF 2 FF 3 Chrome 1
  • 22. CSS WIDTH FF 3 FF 3 Safari 3 Safari 3 Safari 4b Safari 4b
  • 23. CSS TEXT INDENT Chrome 1 Safari 4b Safari 4b Opera 9 Opera 9
  • 24. CSS BACKGROUND COLOR IE 6 IE 7 IE 8b2 Opera 9 Opera 9
  • 25. CSS BACKGROUND IMG Firefox 2 Firefox 2 IE 6 IE 7 IE 8b2 Opera 9 Opera 9
  • 26.
  • 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
  • 51.
  • 52. HOW TO DESIGN FOR SERIOUSLY MESSY FORMS
  • 54.
  • 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; }
  • 59. FASTER WAY TO ZERO input[type="text"] { border: 1px solid #177F75; font-family:Verdana, Arial, Helvetica, sans-serif; } input[type="submit"] { margin-left: 201px; background-color: #00CC00; } input[type="text"], select { display: block; float: left; margin-bottom: 7px; }
  • 60. FASTER WAY TO ZERO label[for="byear"], label[for="bdate"] { position: absolute; left: -999px; width: 990px; }
  • 62. BASIC FORM <form id="webmailForm" action="/-/"> <fieldset> <label for="email">Email</label> <input id="email" type="text" value="a.graham@example.com" /> </fieldset> <fieldset> <label for="message">Message</label> <textarea id="comment">Mr. Watson -- come here.</textarea> </fieldset> </form>
  • 63.
  • 64. BASIC FORM <form id="webmailForm" action="/-/"> <fieldset> <label for="email">Email</label> <input id="email" type="text" value="a.graham@example.com" /> </fieldset> <fieldset> <label for="message">Message</label> <textarea id="comment">Mr. Watson -- come here.</textarea> </fieldset> </form>
  • 65.
  • 66. BASIC FORM #webmailForm fieldset { margin: 0 0 15px 0; border: 0; } #webmailForm fieldset label { display: block; margin: 0 0 5px 0; font-weight: bold; }
  • 67.
  • 68. COOL FORM #webmailForm fieldset input, #webmailForm fieldset textarea { width: 550px; padding: 10px; font-size: 1.2em; border: none; /* zero out */ background: #fcf; }
  • 69.
  • 70. COOL FORM #webmailForm fieldset input, #webmailForm fieldset textarea { width: 550px; padding: 10px; font-size: 1.2em; border: none; /* zero out */ background: #fcf; background-image: url(form-bkgd2.png); background-repeat: repeat-x; }
  • 71.
  • 72. COOL FORM #webmailForm fieldset input, #webmailForm fieldset textarea { width: 550px; padding: 10px; font-size: 1.2em; border: none; /* zero out */ background: #fcf; background-image: url(form-bkgd2.png); background-repeat: repeat-x; border-bottom: 1px solid #fff; border-right: 1px solid #fff; }
  • 73.
  • 74. COOL FORM #webmailForm fieldset input, #webmailForm fieldset textarea { width: 550px; padding: 10px; font-size: 1.2em; border: none; /* zero out */ background: #fcf; background-image: url(form-bkgd2.png); background-repeat: repeat-x; border-bottom: 1px solid #fff; border-right: 1px solid #fff; border-radius: 7px; -webkit-border-radius: 7px; -moz-border-radius: 7px; }
  • 75.
  • 77. ENABLED & DISABLED FORM ELEMENTS <div>Enabled:<br /> <input name="enabled" type="text" value="Hello, world!" /> </div> <div>Disabled:<br /> <input name="disabled" type="text" value="Hello, world!" disabled="disabled" /> </div>
  • 78. ENABLED & DISABLED FORM ELEMENTS
  • 79. ENABLED & DISABLED FORM ELEMENTS input[type="text"]:disabled{ opacity: .7; filter: alpha(opacity=70); /* cough */ }
  • 80. ENABLED & DISABLED FORM ELEMENTS input[type="text"]:disabled:after { content: "(disabled - do not use)"; font-size: .9em; color: #CCCCCC; display: block; }
  • 81. ENABLED & DISABLED FORM ELEMENTS
  • 82. ENABLED & DISABLED FORM ELEMENTS option:enabled{ color: #9F393F; } input:enabled{ background: #21B6A8; color:#9F393F; }
  • 83. ENABLED & DISABLED FORM ELEMENTS
  • 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.
  • 90. THANK YOU! Christopher Schmitt schmitt@heatvision.com @teleject on twitter
  • 91. CREATIVE COMMONS CITATIONS http://www.flickr.com/photos/lanuiop/2234239588/ http://www.flickr.com/photos/gaetanlee/1947424580/ http://www.flickr.com/photos/evapro/312900784/ http://www.flickr.com/photos/kekka/799060449/ http://www.flickr.com/photos/hiddedevries/2594048276/ http://www.flickr.com/photos/tomsaint/2992217972/