Home/CSS-Tricks
Source

CSS-Tricks

2,268 articles from CSS-Tricks.

Frontend — SmolCSS

SmolCSS

A wonderful collection of little layout-related CSS snippets from Stephanie Eckles that serves both as a quick reference and a reminder of how straightforward

CCChris Coyier·February 24, 2021Frontend
Frontend — Hiding Content Responsibly

Hiding Content Responsibly

We've covered the idea of hiding things in CSS many times here, the most recent post being Marko Ilic's "Comparing Various Ways to Hide Things in CSS" which

CCChris Coyier·February 23, 2021Frontend
Design & UX — Getting Deep Into Shadows

Getting Deep Into Shadows

Let’s talk shadows in web design. Shadows add texture, perspective, and emphasize the dimensions of objects. In web design, using light and shadow can add

RORob O'LearyRob O'Leary·February 22, 2021Design & UX
Frontend — Three Ways to Blob with CSS and SVG

Three Ways to Blob with CSS and SVG

Blobs are the smooth, random, jelly-like shapes that have a whimsical quality and are just plain fun. They can be used as illustration elements and background

AMAkash MittalAkash Mittal·February 19, 2021Frontend
Frontend — Barebones CSS for Fluid Images

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

CCChris Coyier·February 18, 2021Frontend
Frontend — Let’s Create a Custom Audio Player

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.

IUIdorenyin UdohIdorenyin Udoh·February 18, 2021Frontend
Engineering — You want...

You want...

I've been enjoying these little "You want..." style posts. Post titles like that are a little more... forceful for my normal taste, but I like the spirit of

CCChris Coyier·February 17, 2021Engineering
Frontend — Things You Can Do With CSS Today

Things You Can Do With CSS Today

Some nice coverage from Andy about CSS things that are truly new. If you haven't looked at new things in CSS in, say, a year, I'd bet pretty much all of this

CCChris Coyier·February 17, 2021Frontend
Frontend — CSS Switch-Case Conditions

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

YEYair Even OrYair Even Or·February 17, 2021Frontend
Engineering — The web didn't change; you did

The web didn't change; you did

I love this piece from Remy Sharp where he argues that the web didn’t get more complicated over the last 20 years, despite what we might think:

RRRobin RendleRobin Rendle·February 16, 2021Engineering
Performance — Netlify

Netlify

High five to Netlify for the ❥ sponsorship. Netlify is a great place to host your static (or not-so-static!) website because of the great speed, DX, pricing,

CCChris Coyier·February 16, 2021Performance
Engineering — The Devil's Albatross

The Devil's Albatross

Nils Binder talks about a technique for spacing between two elements. Picture a header on a large screen with a logo in the upper left and nav in the upper

CCChris Coyier·February 12, 2021Engineering
Security — WordPress 5.7: Big ol' jQuery Update

WordPress 5.7: Big ol' jQuery Update

WordPress core is making the jump from jQuery 1.12.4 to jQuery 3.5.1! This is a big deal for lots of reasons — like modern features, better DX, and security

GGGeoff GrahamGeoff Graham·February 11, 2021Security
Engineering — iframe feedback

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

CCChris Coyier·February 11, 2021Engineering
Frontend — Is CSS float deprecated?

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?

RRRobin RendleRobin Rendle·February 11, 2021Frontend
Engineering — How to Favicon in 2021

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

CCChris Coyier·February 10, 2021Engineering
Frontend — Nested Media Queries

Nested Media Queries

We don't have "regular" nesting in CSS. Maybe this becomes a thing someday, or something like it. That would be cool, although that pre-spec doesn't mention

CCChris Coyier·February 9, 2021Frontend
Frontend — SVG within CSS

SVG within CSS

Stefan Judis has a "Today I Learned" (TIL) post explaining how SVGs filters can be inlined in CSS. The idea is that CSS has the filter property which supports

CCChris Coyier·February 8, 2021Frontend
Engineering — Algolia

Algolia

Algolia is for search. Literally any website can take advantage of Algolia-powered search. You put JSON data ("records") in, and then you can search them at

CCChris Coyier·February 4, 2021Engineering
Engineering — "Cancelable" Smooth Scrolling

"Cancelable" Smooth Scrolling

Here's the situation: Your site offers a "scroll back to top" button, and you've implemented smooth scrolling. As the page scrolls back to the top, users see

CCChris Coyier·February 1, 2021Engineering
Frontend — No-Jank CSS Stripes

No-Jank CSS Stripes

My mind goes immediately to repeating-linear-gradient and hard-stop gradients when thinking of creating stripes in CSS. You make one stripe by using the same

CCChris Coyier·February 1, 2021Frontend