Search
Moving Backgrounds
9.2.2023
We often think of background images as texture or something that provides contrast for legible content — in other words, not really content. If it was content, you’d probably reach for an <img> anyway, accessibility and whatnot.
But there are …
Moving Backgrounds originally published...
In Praise of Shadows
12.7.2022
Our dear friend Robin has a new essay called In Praise of Shadows. Now, before you hop over there looking for nuggets on CSS box shadows, text shadows, and shadow filters… this is not that. It’s an essay …
In Praise of Shadows originally published on CSS-Tricks. You should...
Repetition Image Hover Effects
22.2.2022
A simple and fun hover effect with repeated image layers that get scaled up and down.
The post Repetition Image Hover Effects appeared first on Codrops
The Search For a Fixed Background Effect With Inline Images
6.1.2022
I was working on a client project a few days ago and wanted to create a certain effect on an <img>. See, background images can do the effect I was looking for somewhat easily with background-attachment: fixed;. With …
The Search For a Fixed Background Effect With Inline Images...
The Search For a Fixed Background Effect With Inline Images
6.1.2022
I was working on a client project a few days ago and wanted to create a certain effect on an <img>. See, background images can do the effect I was looking for somewhat easily with background-attachment: fixed;. With …
The Search For a Fixed Background Effect With Inline Images...
Maybe there kinda is background-opacity?
15.12.2021
I was reading Jake’s “Cross-fading any two DOM elements is currently impossible” which is a wonderfully nerdy deep dive into how there is no real way to literally cross-fade elements. Yeah, you can animate both of their opacities, but even …
Creating Colorful, Smart Shadows
4.5.2021
A bona fide CSS trick from Kirupa Chinnathambi here. To match a colored shadow with the colors in the background-image of an element, you inherit the background in a pseudo-element, kick it behind the original, then blur and filter it. …
The post Creating Colorful, Smart Shadows appeared...
A Complete Guide to CSS Gradients
17.11.2020
Like how you can use the background-color property in CSS to declare a solid color background, you can use the background-image property not only to declare image files as backgrounds but gradients as well. Using CSS gradients is better for control and performance than using an actual image (of...
zerodivs.com
10.8.2020
Pretty neat little website from Joan Perals, inspired by stuff like Lynn’s A Single Div. With multiple hard-stop background-image gradients, you don’t need extra HTML elements to draw shapes — you can draw as many shapes as you want on a single element. There is even a stacking order...
Nailing the Perfect Contrast Between Light Text and a Background Image
7.8.2020
Have you ever come across a site where light text is sitting on a light background image? If you have, you’ll know how difficult that is to read. A popular way to avoid that is to use a transparent overlay. But this leads to an important question: Just how transparent should that overlay...
More Control Over CSS Borders With background-image
7.8.2020
You can make a typical CSS border dashed or dotted. For example:
.box {
border: 1px dashed black;
border: 3px dotted red;
}
You don’t have all that much control over how big or long the dashes or gaps are. And you certainly can’t give the dashes slants, fading, or animation!...
Fluid Images in a Variable Proportion Layout
3.7.2020
Creating fluid images when they stand alone in a layout is easy enough nowadays. However, with more sophisticated interfaces we often have to place images inside responsive elements, like this card:
For now, let’s say this image is not semantic content, but only decoration. That’s...
How to Create a Motion Hover Effect for a Background Image Grid
10.6.2020
A short tutorial on how to achieve a motion hover effect on a background image grid.
The post How to Create a Motion Hover Effect for a Background Image Grid appeared first on Codrops
Pseudo-Randomly Adding Illustrations with CSS
17.4.2020
Between each post of Eric Meyer’s blog there’s this rather lovely illustration that can randomly be one of these five options:
Eric made each illustration into a separate background image then switches out that image with the nth-of-type CSS property, like this:
.entry:nth-of-type(2n+1)::before...
How to Repeat Text as a Background Image in CSS Using element()
26.3.2020
There’s a design trend I’ve seen popping up all over the place. Maybe you’ve seen it too. It’s this sort of thing where text is repeated over and over. A good example is the price comparison website, GoCompare, who used it in a major multi-channel advertising campaign.
Nike has used it as well...
Flexible Repeating SVG Masks
22.3.2020
Tyler Gaw reminds us that mask-image can repeat, resize, and move just like background-image does, which is fun to combine and play with. I could see it being a fun option for an <hr, like Sara is doing.
CodePen Embed Fallback
Direct Link to Article — Permalink… Read article...
Background Scale Hover Effect with CSS Clip-path
11.3.2020
A simple recreation of the background scale hover effect seen on the DDD Hotel website using CSS clip-path.
Background Scale Hover Effect with CSS Clip-path was written by Mary Lou and published on Codrops
The Amazingly Useful Tools from Yoksel
15.11.2019
I find myself web searching for some tool by Yoksel at least every month. I figured I'd list out some of my favorites here in case you aren't aware of them.
Need to duo-tone an image? SVG filters can do that. Lentie Ward wrote about it for us, and Yoksel has a tool to create the filters...
Creating a Maintainable Icon System with Sass
28.8.2019
One of my favorite ways of adding icons to a site is by including them as data URL background images to pseudo-elements (e.g. ::after) in my CSS. This technique offers several advantages:
They don't require any additional HTTP requests other than the CSS file.
Using the background-size property...
Smooth Scrolling Image Effects
23.7.2019
A small set of ideas on animating images and other elements while smooth scrolling a page.
Smooth Scrolling Image Effects was written by Mary Lou and published on Codrops