Search

Nalezeno "QR code": 1615

Clipping Scrollable Areas On The inline-start Side


On a default left-to-right web page, “hanging” an element off the right side of the page (e.g. position: absolute; right: -100px;) triggers a horizontal scrollbar that scrolls as far as needed to make that whole element visible. But if … The post Clipping Scrollable Areas On...

Let’s Create a Custom Audio Player


HTML has a built-in native audio player interface that we get simply using the <audio> element. Point it to a sound file and that’s all there is to it. We even get to specify multiple files for better browser support, … The post Let’s Create a Custom Audio Player appeared first...

Barebones CSS for Fluid Images


Zach takes a look at some fundamental HTML+CSS usage for fluid, responsive images. Most of it, I’d say, is what you’d expect, but things get weird when srcset gets involved. I poked my way through, and in addition to the … The post Barebones CSS for Fluid Images appeared first...

CSS Switch-Case Conditions


CSS is yet to have a switch rule or conditional if, aside from the specific nature of @media queries and some deep trickery with CSS custom properties. Let’s have a look at why it would be useful if we … The post CSS Switch-Case Conditions appeared first on CSS-Tricks. You can support...

Use CSS Clamp to create a more flexible wrapper utility


I like Andy’s idea here: .wrapper { width: clamp(16rem, 90vw, 70rem); margin-left: auto; margin-right: auto; padding-left: 1.5rem; padding-right: 1.5rem; } Normally I’d just set a max-width there, but as Andy says: This becomes a slight issue in mid-sized viewports, such...

Maximally optimizing image loading for the web in 2021


Malte Ubl’s list for: 8 image loading optimization techniques to minimize both the bandwidth used for loading images on the web and the CPU usage for image display. Fluid width images in CSS, not forgetting the height and width attributes … The post Maximally optimizing image...

Using AbortController as an Alternative for Removing Event Listeners


The idea of an “abortable” fetch came to life in 2017 when AbortController was released. That gives us a way to bail on an API request initiated by fetch() — even multiple calls — whenever we want. Here’s a super … The post Using AbortController as an Alternative for Removing Event Listeners...

Beautiful accessibility with Floating Focus


Imagine if your :focus styles animated from element to element as you tab through a site. Like the focus ring up and flew across the page to the next element. The spirit of it is similar to smooth scrolling: it’s … The post Beautiful accessibility with Floating Focus appeared first...

Don’t put pointer-events: none on form labels


Bruce Lawson with the tip of the day, warning against the use of pointer-events: none on forms labels. We know that pointer-events is used to change how elements respond to click, tap, hover, and active states. But it apparently borks … The post Don’t put pointer-events: none on form labels...

Reconciling Editor Experience and Developer Experience in the CMS


Components are great, aren’t they? They are these reusable sources of truth that you can use to build rock-solid front-ends without duplicating code. You know what else is super cool? Headless content management! Headless content management system (CMS) products offer … The post Reconciling...

Is CSS float deprecated?


An interesting conversation came up at work the other day: Should we use the CSS float property now that we have CSS Grid and Flexbox? The short answer No! Well, mostly. I’d only use it today for wrapping text around … The post Is CSS float deprecated? appeared first on CSS-Tricks. You...

iframe feedback


What if an <iframe had within it another <iframe of the exact same source? Inception, as they say. Baptise Crespy does this all-important research in the name of art and science. Turns out browsers are smart enough to not … The post iframe feedback appeared first on CSS-Tricks. You...

HTML Video Sources Should Be Responsive


Scott Jehl doesn’t mince words here: Removing media support from HTML video was a mistake. It means that for every video we embed in HTML, we’re stuck with the choice of serving source files that are potentially too large or … The post HTML Video Sources Should...

:focus-visible Support Comes to Firefox


Look at that! The :focus-visible pseudo-selector is now supported in Firefox, as of version 85 which shipped yesterday. I had to rush over to the MDN Docs just to confirm, and yep, the :focus-visible page has been updated to … The post :focus-visible Support Comes to Firefox appeared first...

How to Favicon in 2021


I always appreciate someone looking into and re-evaluating the best practices of something that literally every website needs and has a complex set of requirements. Andrey Sitnik has done that here with favicons. The final suggestion: <link rel="icon" href="/favicon.ico" … The post...

A table with both a sticky header and a sticky first column


We’ve covered that individual <table> cells, <th> and <td> can be position: sticky. It’s pretty easy to make the header of a table stick to the top of the screen while scrolling through a bunch or rows (like this … The post A table with both a sticky...

Nahoru
Tento web používá k poskytování služeb a analýze návštěvnosti soubory cookie. Používáním tohoto webu s tímto souhlasíte. Další informace