Search
Weekly Platform News: Web Apps in Galaxy Store, Tappable Stories, CSS Subgrid
8.11.2019
In this week's roundup: Firefox gains locksmith-like powers, Samsung's Galaxy Store starts supporting Progressive Web Apps, CSS Subgrid is shipping in Firefox 70, and a new study confirms that users prefer to tap into content rather than scroll through it.
Let's get into the news.
Securely...
The `hidden` Attribute is Visibly Weak
16.10.2019
There is an HTML attribute that does exactly what you think it should do:
<div>I'm visible</div>
<div hidden>I'm hidden</div>
It even has great browser support. Is it useful? Uhm. Maybe. Not really.
Adam Laki likes the semantics of it:
If we use the hidden...
Wufoo Cracks the Code for Forms So You Don’t Have To
8.10.2019
There was a lot of buzz about forms last week when Jason Grisby pointed to a missing pattern attribute on Chipotle's order form that could have been used to help-through millions of dollars in orders. Adrian Roselli followed that up with the common mistake of forgetting for and id attributes...
Multi-Million Dollar HTML
30.9.2019
Two stories:
Jason Grigsby finds Chipotle's online ordering form makes use of an input-masking technique that chops up a credit card expiration year making it invalid and thus denying the order. If pattern="\d\d" maxlength="2" was used instead (native browser feature), the browser is smart enough...
Weekly Platform News: Improving UX on Slow Connections, a Tip for Writing Alt Text and a Polyfill for the HTML loading attribute
23.8.2019
In this week's roundup, how to determine a slow connection, what we should put into alt text for images, and a new polyfill for the HTML loading attribute, plus more.
Detecting users on slow connections
Algolia is using the Network Information API (see the API’s Chrome status page) to detect users...
Weekly Platform News: HTML Loading Attribute, the Main ARIA Specifications, and Moving from iFrame to Shadow DOM
15.8.2019
In this week's roundup of platform news, Chrome introduces a new attribute for loading, accessibility specifications for web developers, and the BBC moves visualizations to the Shadow DOM.
Chrome ships the loading attribute
The HTML loading attribute for lazy-loading images and iframes is...
WDRL — Edition 271: TTFB, the loading-attribute, tiny houses and work ethics.
9.8.2019
Hey,
The web is quite differently to when I started the newsletter in 2013 with the first edition. Back then, it was all about new features, new clever hacks and techniques how to build better websites. It was crazy at what speed we got new CSS features, and JavaScript evolved. Nowadays, it’s...
The Browser Can Remember Edited Content
22.5.2019
You can make the text inside any HTML element editable by adding the contenteditable attribute.
<div contenteditable>
Hey, I'm like a textarea kinda now!
</div>
I wouldn't say there are wheelbarrows full of use-cases for that, but it's neat. One possible use might be...
Everything You Ever Wanted to Know About inputmode
17.5.2019
The inputmode global attribute provides a hint to browsers for devices with onscreen keyboards to help them decide which keyboard to display when a user has selected any input or textarea element.
<input type="text" inputmode="" />
<textarea inputmode="" />
Unlike changing the type...
SVG Properties and CSS
13.5.2019
There are many Scalable Vector Graphics (SVG), but only certain attributes can be applied as CSS to SVG. Presentation attributes are used to style SVG elements and can be used as CSS properties. Some of these attributes are SVG-only while others are already shared in CSS, such as font-size...
Preload, prefetch and other link tags
24.4.2019
Ivan Akulov has collected a whole bunch of information and know-how on making things load a bit more quickly with preload and prefetch. That's great in and of itself, but he also points to something new to me – the as attribute:
<link rel="preload" href="/style.css" as="style"...
Inclusively Hidden
19.4.2019
Scott O'Hara recently published "Inclusively Hidden," a nice walkthrough of the different ways to hide things on the web. Nothing is ever cut and dry when it comes to the web! What complicates this is that hidden begs the question: hidden for whom? Different answers to that have different...
Native Lazy Loading
9.4.2019
IntersectionObserver has made lazy loading a lot easier and more efficient than it used to be, but to do it really right you still gotta remove the src and such, which is cumbersome. It's definitely not as easy as:
<img src="celebration.jpg" loading="lazy" alt="..." />
Addy Osmani says...
Planning for Responsive Images
13.3.2019
The first time I made an image responsive, it was as simple as coding these four lines:
img {
max-width: 100%;
height auto; /* default */
}
Though that worked for me as a developer, it wasn’t the best for the audience. What happens if the the image in the src attribute is heavy? On high-end...
Styling Based on Scroll Position
7.3.2019
Rik Schennink documents a system for being able to write CSS selectors that style a page when it has scrolled to a certain point. If you're like me, you're already on the lookout for document.addEventListener('scroll' ... and being terrified about performance. Rik gets to that right away by both...
Text Wrapping & Inline Pseudo Elements
27.2.2019
I love posts like this. It's just about adding a little icon to the end of certain links, but it ends up touching on a million things along the way. I think this is an example of why some people find front-end fun and some people rather dislike it.
Things involved:
Cool [attribute] selectors that...
CSS :placeholder-shown
4.2.2019
One of the first plugins that would hit a new framework in the early days of JavaScript frameworks was a placeholder plugin, which is why we were so excited when HTML5 brought us the placeholder attribute. Then CSS lovers like me were thrilled when the CSS spec allowed us to style placeholders....
How do you figure?
1.2.2019
Scott O'Hara digs into the <figure> and <figcaption> elements. Gotta love a good ol' HTML deep dive.
I use these on just about every blog post here on CSS-Tricks, and as I've suspected, I've basically been doing it wrong forever. My original thinking was that a figcaption was just...
Using Artificial Intelligence to Generate Alt Text on Images
1.2.2019
Web developers and content editors alike often forget or ignore one of the most important parts of making a website accessible and SEO performant: image alt text. You know, that seemingly small image attribute that describes an image:
<img src="/cute/sloth/image.jpg" alt="A brown baby sloth...
Did you know that style and script tags can be set to display: block?
25.7.2018
The other night, Amit Patel mentioned that you can set script tags in HTML to display: block with CSS and then edit that code inline with the contentEditable attribute. This means that you can then see it all update live in the browser as you type. Shortly after, Marius Gundersen replied that...