Markup Tutorials
Use a Submit Button Outside of a Form!
Have you ever felt like you've been a professional developer or designer forever, and somehow not known something basic, and borderline hate yourself? That's me with a trick that was introduced to me by Miguel Piedrafita:🔥 You can submit forms from a button outside of...
How to Prevent Pasting into an Input
Every once in a while I get to a website that doesn't allow me to paste into a form input. In most cases it's something to do with login credentials (username and or password) and auth codes. So how are they preventing me from...
How to Detect When a Sticky Element Gets Pinned
The need for
position: sticky
was around for years before it was implemented natively, and I can boast that I implemented it with JavaScript andscroll
events for ages. Eventually we gotposition: sticky
, and it works well from a visual perspective, but I wondered how...Remove the Search Input Clear(x) Icon
I really appreciate the amount of different
<input>
elements we've received over the past decade. These elements don't just bring a new semantic advantage, but also provide UI helpers, which in many cases are useful. In a recent case, I found a UI element...Lazy Load IFRAMEs
We've known for a decade that lazy loading resources like JavaScript, CSS, and especially images is a massive performance win for web pages. At first we used tricks and JavaScript to do the lazy loading, but more recently native image lazy loading has debuted...
Offscreen Text for Copy & Paste
The relationship between HTML and CSS is special: mixing content via HTML with presentation from CSS to make an awesome presentation. Sometimes, however, you need to employ CSS tricks solely to enhance functionality. This could be one of those cases.When browsing through the Firefox...
designMode
Every once in a while I stumble upon an API or browser setting that I can't believe ever existed. Such examples can be seen in the numerous
String.prototype
properties such asbold
,italics
, and evenblink
, which wrap given string text in their representative HTML...Data URIs
We're all familiar with traditional URI protocols like https, http, ftp, and file, but data URIs have become a large part of our online strategy. We can use them to display images, the Mac camera and webcams, and more. But what if we simply...
Detect if Element is a Web Component
I've advocated for web components since before they became a spec, mostly inspired by the Dojo Toolkit's dijit framework. Empowering first class JavaScript widgets, as opposed to a mess of DIVs and templates, always made the most sense. Now that web components exist, and awesome...
Responsive IFRAMEs
Responsive web design revolutionized the web and spurred a movement away from native apps to web apps easily customizable for a mobile environment. We use media queries and non-pixel-based dimensions to make responsive design easier; in fact,
img { max-width: 100% }
is one of my favorite...