Skip to main content
CSS-Tricks
  • Articles
  • Alamanac
  • Guides
  • Videos
  • Books
  • Newsletter
Search

Articles Tagged
background-image

12 Articles
{
,

}
Direct link to the article Moving Backgrounds
animation background-image background-position

Moving Backgrounds

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 …

Avatar of Saleh Mubashar
Saleh Mubashar on Feb 9, 2023
Direct link to the article Image Illustration Filter
background-image mix-blend-mode repeating gradient

Image Illustration Filter

I like that sorta effect where an image almost looks like it’s an oil painting or an illustration made with a thick, runny ink fountain pen. I got the idea when Scott Vandehey shared his “halftone filter” effect on the …

Avatar of Geoff Graham
Geoff Graham on Sep 27, 2022
Direct link to the article In Praise of Shadows
background-image centering grid object-fit scroll-snap stacking contexts

In Praise of Shadows

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 …

Avatar of Geoff Graham
Geoff Graham on Jul 12, 2022
Direct link to the article The Search For a Fixed Background Effect With Inline Images
background-attachment background-image fixed position images

The Search For a Fixed Background Effect With Inline Images

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 …

Avatar of Alex Lazar
Alex Lazar on Jan 6, 2022 (Updated on Jan 9, 2022)
Direct link to the article Maybe there kinda is background-opacity?
background-image transparency

Maybe there kinda is background-opacity?

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 …

Avatar of Chris Coyier
Chris Coyier on Dec 15, 2021
Direct link to the article More Control Over CSS Borders With background-image
background-image border

More Control Over CSS Borders With background-image

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. …

Avatar of Chris Coyier
Chris Coyier on Aug 7, 2020
Direct link to the article How to Repeat Text as a Background Image in CSS Using element()
background-image element()

How to Repeat Text as a Background Image in CSS Using element()

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 …

Avatar of Ollie Williams
Ollie Williams on Mar 26, 2020
Direct link to the article Creating a Maintainable Icon System with Sass
background-image icons Sass sass maps svg icons

Creating a Maintainable Icon System with Sass

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
…
Avatar of Tracy Rotton
Tracy Rotton on Aug 28, 2019 (Updated on Aug 3, 2021)
Direct link to the article Managing Multiple Backgrounds with Custom Properties
background background-image custom properties multiple backgrounds

Managing Multiple Backgrounds with Custom Properties

One cool thing about CSS custom properties is that they can be a part of a value. Let’s say you’re using multiple backgrounds to pull off a design. Each background will have its own color, image, repeat, position, etc. It …

Avatar of Chris Coyier
Chris Coyier on Jul 15, 2019 (Updated on Jul 16, 2019)
Direct link to the article CSS Basics: Using Multiple Backgrounds
background background-image css basics multiple backgrounds

CSS Basics: Using Multiple Backgrounds

With CSS, you can control the background of elements. You can set a background-color to fill it with a solid color, a background-image to fill it with (you guessed it) an image, or even both:

body {
  background-color: red;
  background-image: 
…
Avatar of Chris Coyier
Chris Coyier on Feb 14, 2018 (Updated on Oct 27, 2018)
Direct link to the article CSS Basics: Using Fallback Colors
background-image css basics

CSS Basics: Using Fallback Colors

Something you very much want to avoid in web design is unreadable text. That can happen when the background color of an element is too close or exactly the color of the text. For instance:

.header {
  background-color: white;
  
…
Avatar of Chris Coyier
Chris Coyier on Feb 13, 2018 (Updated on Feb 21, 2018)
  • 1
  • 2
  • Older

CSS-Tricks is powered by DigitalOcean.

Keep up to date on web dev

with our hand-crafted newsletter

DigitalOcean
  • About DO
  • Cloudways hosting
  • Legal stuff
  • Get free credit!
CSS-Tricks
  • Write for us!
  • Advertise with us
  • Contact us
Social
  • RSS Feeds
  • CodePen
  • Mastodon
  • X
Back to Top