-
-
Save graygilmore/2587904 to your computer and use it in GitHub Desktop.
Weirdness when using "size" and HTML5 number input
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Weirdness when using "size" and HTML5 number input | |
*/ | |
input { | |
display: block | |
} | |
.small { width: 30px; } | |
.medium { width: 120px; } | |
.large { width: 220px; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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? | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"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