You can style alt text like any other text
https://css-tricks.com/you-can-style-alt-text-like-any-other-text/
https://css-tricks.com/you-can-style-alt-text-like-any-other-text/
CSS-Tricks
You can style alt text like any other text | CSS-Tricks
Clever, clever that Andy Bell. He shares a technique for displaying image alt text when the image fails to load. Well, more precisely, it's a technique to apply styles to the alt when the image doesn't load, offering a nice UI fallback for what would otherwise…
👍1
Better CSS Shapes Using shape() — Part 1: Lines and Arcs
https://css-tricks.com/better-css-shapes-using-shape-part-1-lines-and-arcs/
https://css-tricks.com/better-css-shapes-using-shape-part-1-lines-and-arcs/
CSS-Tricks
Better CSS Shapes Using shape() — Part 1: Lines and Arcs | CSS-Tricks
This is the first part of a series that dives deep into the shape function, starting with shapes that use lines and arcs.
What We Know (So Far) About CSS Reading Order
https://css-tricks.com/what-we-know-so-far-about-css-reading-order/
https://css-tricks.com/what-we-know-so-far-about-css-reading-order/
CSS-Tricks
What We Know (So Far) About CSS Reading Order | CSS-Tricks
The reading-flow and reading-order proposed CSS properties are designed to specify the source order of HTML elements in the DOM tree, or in simpler terms, how accessibility tools deduce the order of elements. You’d use them to make the focus order of focusable…
Better CSS Shapes Using shape() — Part 2: More on Arcs
https://css-tricks.com/better-css-shapes-using-shape-part-2-more-on-arcs/
https://css-tricks.com/better-css-shapes-using-shape-part-2-more-on-arcs/
CSS-Tricks
Better CSS Shapes Using shape() — Part 2: More on Arcs | CSS-Tricks
This is the second part of a series that dives deep into the CSS shape() command, continuing with a more detailed look at the arc command.
Getting Creative With HTML Dialog
https://css-tricks.com/getting-creative-with-html-dialog/
https://css-tricks.com/getting-creative-with-html-dialog/
CSS-Tricks
Getting Creative With HTML Dialog | CSS-Tricks
So, how can you take dialogue box design beyond the generic look of frameworks and templates? How can you style them to reflect a brand’s visual identity and help to tell its stories? Here’s how I do it in CSS using ::backdrop, backdrop-filter, and animations.
Exploring the CSS contrast-color() Function… a Second Time
https://css-tricks.com/exploring-the-css-contrast-color-function-a-second-time/
https://css-tricks.com/exploring-the-css-contrast-color-function-a-second-time/
CSS-Tricks
Exploring the CSS contrast-color() Function… a Second Time | CSS-Tricks
The contrast-color() function doesn’t check color contrast, but rather it outright resolves to either black or white (whichever one contrasts the most with your chosen color). Safari Technology Preview recently implemented it and we explore its possible uses…
The State of CSS 2025 Survey is out!
https://css-tricks.com/the-state-of-css-2025-survey-is-out/
https://css-tricks.com/the-state-of-css-2025-survey-is-out/
CSS-Tricks
The State of CSS 2025 Survey is out! | CSS-Tricks
The State of CSS 2025 Survey dropped a few days ago, and besides anticipating the results, it's exciting to see a lot of the new things shipped to CSS reflected in the questions.
Better CSS Shapes Using shape() — Part 3: Curves
https://css-tricks.com/better-css-shapes-using-shape-part-3-curves/
https://css-tricks.com/better-css-shapes-using-shape-part-3-curves/
CSS-Tricks
Better CSS Shapes Using shape() — Part 3: Curves | CSS-Tricks
This is the third article in a series about the CSS shape() function. We've covered drawing lines and arcs in previous articles and, this time, we look specifically at the curve command and how to use it for drawing complex shapes.
Creating an Auto-Closing Notification With an HTML Popover
https://css-tricks.com/creating-an-auto-closing-notification-with-an-html-popover/
https://css-tricks.com/creating-an-auto-closing-notification-with-an-html-popover/
CSS-Tricks
Creating an Auto-Closing Notification With an HTML Popover | CSS-Tricks
The HTML popover attribute transforms elements into top-layer elements that can be opened and closed with a button or JavaScript. Popovers can be dismissed a number of ways, but there is no option to auto-close them. Preethi has a technique you can use.
Breaking Boundaries: Building a Tangram Puzzle With (S)CSS
https://css-tricks.com/breaking-boundaries-building-a-tangram-puzzle-with-scss/
https://css-tricks.com/breaking-boundaries-building-a-tangram-puzzle-with-scss/
CSS-Tricks
Breaking Boundaries: Building a Tangram Puzzle With (S)CSS | CSS-Tricks
We put it to the test and it turns out Sass can replace JavaScript, at least when it comes to low-level logic and puzzle behavior. With nothing but maps, mixins, functions, and a whole lot of math, we managed to bring our Tangram puzzle to life, no JavaScript…
A Better API for the Resize Observer
https://css-tricks.com/a-better-api-for-the-resize-observer/
https://css-tricks.com/a-better-api-for-the-resize-observer/
CSS-Tricks
A Better API for the Resize Observer | CSS-Tricks
ResizeObserver, MutationObserver, and IntersectionObserver enhance performance over their predecessors. Zell discusses their API similarities, usage steps, refactoring strategies, and advantages with practical examples.
How to Keep Up With New CSS Features
https://css-tricks.com/how-to-keep-up-with-new-css-features/
https://css-tricks.com/how-to-keep-up-with-new-css-features/
CSS-Tricks
How to Keep Up With New CSS Features | CSS-Tricks
How do you stay informed of new CSS features when the language evolves quickly and information is spread all around the web? Sacha Greif has some tips from his work running an annual survey focused on new CSS features.
👍1
A Better API for the Intersection and Mutation Observers
https://css-tricks.com/a-better-api-for-the-intersection-and-mutation-observers/
https://css-tricks.com/a-better-api-for-the-intersection-and-mutation-observers/
CSS-Tricks
A Better API for the Intersection and Mutation Observers | CSS-Tricks
Zell discusses refactoring the Resize, Mutation, and Intersection Observer APIs for easier usage, demonstrating how to implement callback and event listener patterns, while highlighting available options and methods.
Lightly Poking at the CSS if() Function in Chrome 137
https://css-tricks.com/lightly-poking-at-the-css-if-function-in-chrome-137/
https://css-tricks.com/lightly-poking-at-the-css-if-function-in-chrome-137/
CSS-Tricks
Lightly Poking at the CSS if() Function in Chrome 137 | CSS-Tricks
The CSS if() function was recently implemented in Chrome 137, making it the first instance where we have it supported by a mainstream browser. Let's poke at it a bit at a very high level.
Poking at the CSS if() Function a Little More: Conditional Color Theming
https://css-tricks.com/poking-at-the-css-if-function-a-little-more-conditional-color-theming/
https://css-tricks.com/poking-at-the-css-if-function-a-little-more-conditional-color-theming/
CSS-Tricks
Poking at the CSS if() Function a Little More: Conditional Color Theming | CSS-Tricks
The CSS if() function enables us to use values conditionally, but what exactly does if() do? Let's look at a possible real-world use case.
Using CSS Cascade Layers With Tailwind Utilities
https://css-tricks.com/using-css-cascade-layers-with-tailwind-utilities/
https://css-tricks.com/using-css-cascade-layers-with-tailwind-utilities/
CSS-Tricks
Using CSS Cascade Layers With Tailwind Utilities | CSS-Tricks
Being the bad boy I am, I don't take Tailwind's default approach to cascade layers as the "best" one. Over a year experimenting with Tailwind and vanilla CSS, I've come across what I believe is a better solution.
The Gap Strikes Back: Now Stylable
https://css-tricks.com/the-gap-strikes-back-now-stylable/
https://css-tricks.com/the-gap-strikes-back-now-stylable/
CSS-Tricks
The Gap Strikes Back: Now Stylable | CSS-Tricks
Styling the space between layout items — the gap — has typically required some clever workarounds. But a new CSS feature changes all that with just a few simple CSS properties that make it easy, yet also flexible, to display styled separators between your…