Skip to content

Instantly share code, notes, and snippets.

@graygilmore
Forked from anonymous/dabblet.css
Created May 3, 2012 18:25
Show Gist options
  • Save graygilmore/2587904 to your computer and use it in GitHub Desktop.
Save graygilmore/2587904 to your computer and use it in GitHub Desktop.
Weirdness when using "size" and HTML5 number input
/**
* Weirdness when using "size" and HTML5 number input
*/
input {
display: block
}
.small { width: 30px; }
.medium { width: 120px; }
.large { width: 220px; }
<h1>input type=text</h1>
<input type=text size=2>
<input type=text size=20>
<input type=text size=40>
<p>Notice how the "size" attribute works?
<hr>
<h1>input type=number</h1>
<input type=number class="small">
<input type=number class="medium">
<input type=number class="large">
<p>Notice how the "size" attribute is now ignored?
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment