File Input accept Attribute
The HTML5 revolution provided us several simple but important attributes like
placeholder. There's another one you may want to know about:
accept attribute is useful for
input[type=file] elements. Let's have a look at it!
I'll use Twitter's upload button to illustrate a good usage of the
<input type="file" name="media_empty" accept="image/gif,image/jpeg,image/jpg,image/png,">
accept attribute gets a comma-separated list of mime types for files desired file types. In this case, Twitter is allowing the user to upload common image formats.
When you say or read "HTML5", you half expect exotic dancers and unicorns to walk into the room to the tune of "I'm Sexy and I Know It." Can you blame us though? We watched the fundamental APIs stagnate for so long that a basic feature...
When you want to keep an element in the same spot in the viewport no matter where on the page the user is, CSS's fixed-positioning functionality is what you need.
Above we set our element 2% from both the top and right hand side of the...
CSS is becoming more and more powerful but in the sense that it allows us to do the little things easily. There have been larger features added like transitions, animations, and transforms, but one feature that goes under the radar is generated content. You saw a...