2022-06-22
3959
#css
Oscar Jite-Orimiono
119740
Jun 22, 2022 ⋅ 14 min read

A complete guide to using CSS filters with SVGs

Oscar Jite-Orimiono I'm a self-taught frontend web developer. I build websites so everyone finds a home online. The digital space is massive, full of endless possibilities — let's explore it together!

Recent posts:

Exploring Nushell, A Rust Powered, Cross Platform Shell

Exploring Nushell, a Rust-powered, cross-platform shell

Nushell is a modern, performant, extensible shell built with Rust. Explore its pros, cons, and how to install and get started with it.

Oduah Chigozie
Apr 23, 2024 ⋅ 6 min read
Exploring Zed, A Newly Open Source Code Editor Written In Rust

Exploring Zed, an open source code editor written in Rust

The Zed code editor sets itself apart with its lightning-fast performance and cutting-edge collaborative features.

Nefe Emadamerho-Atori
Apr 22, 2024 ⋅ 7 min read
Implementing Infinite Scroll In Next Js With Server Actions

Implementing infinite scroll in Next.js with Server Actions

Infinite scrolling in Next.js no longer requires external libraries — Server Actions let us fetch initial data directly on the server.

Rahul Chhodde
Apr 19, 2024 ⋅ 10 min read
Integrating Django Templates With React For Dynamic Webpages

Integrating Django templates with React for dynamic webpages

Create a dynamic demo blog site using Django and React to demonstrate Django’s server-side functionalities and React’s interactive UI.

Kayode Adeniyi
Apr 18, 2024 ⋅ 7 min read
View all posts

7 Replies to "A complete guide to using CSS filters with SVGs"

  1. Very interesting, thanks.
    Last fall, I decided that in my 60s it would be good to learn some other profession and decided that the frontend would be closest to me. Unfortunately, the process does not go so fast, but now I am mastering the CSS. Just here there will be one more point to practice

  2. This isn’t a comment on the article per se, which is awesome btw, just an observation that your print stylesheet has a rule of display:none; for img but for an article like this the images are almost the whole point.
    I sometimes print articles to PDF for later perusal and I had to come back and disable your CSS rule before the article could make complete sense in the PDF.

  3. Thanks,Oscar!it is informativel for me right now as I learn and work on a css animations project. I’m better at it with you.)This is really important when trying to find a simple and clear explanation.

  4. Hey just noticed that the knockout text doesn’t work with just the code you provided. Tested it in Edge and Firefox as of 2/3/2023 using the latest build of each.

    1. Hi, the code provided is just to create the filter. I didn’t include CSS because it is assumed that you already know how to style text with CSS.

      Here’s the CSS I used:

      h1{
      font-family: ‘Poppins’, sans-serif;
      position: absolute;
      width: 1000px;
      padding: 20px;
      font-size: 5rem;
      font-weight: 800;
      filter: url(#knockout);
      }

      Try this; it should work fine on any modern browser, including Firefox and edge. Cheers!

Leave a Reply