101.school
CoursesAbout
Search...⌘K
Generate a course with AI...

    Advance CSS

    Receive aemail containing the next unit.
    • CSS Grid Layout
      • 1.1Introduction to grid-based systems
      • 1.2Working with rows and columns
      • 1.3Creating complex, responsive designs
    • CSS Flexbox
      • 2.1Flexbox techniques: alignment and layout
      • 2.2Flexbox controls for UI components
    • Responsive Web Design
      • 3.1Implementing media queries
      • 3.2Employing fluid design principles
    • CSS Preprocessors
      • 4.1Introduction to CSS preprocessors: Sass, Less, and Stylus
      • 4.2Streamlining styling with variables, mixins, and functions
    • CSS Custom Properties (Variables)
      • 5.1Incorporating custom properties in design
      • 5.2Crafting dynamic and themeable styles
    • CSS-in-JS Libraries
      • 6.1Survey of CSS-in-JS solutions
      • 6.2Scoped and encapsulated styles for components
    • Animations and Transitions
      • 7.1Keyframes animations with CSS
      • 7.2Implementing engaging transitions
    • Advanced Selectors and Pseudo-classes
      • 8.1Understanding pseudo-classes
      • 8.2Styling with advanced selectors
    • CSS Architecture and Methodologies
      • 9.1Introduction to BEM and SMACSS
      • 9.2Structuring scalable, organized CSS
    • CSS Transforms and 3D Effects
      • 10.1Introducing CSS transforms
      • 10.2Creating engaging visual effects
    • CSS Filters and Blend Modes
      • 11.1Understanding and applying CSS filters
      • 11.2Creating unique compositions using blend modes
    • Web Fonts and Icon Fonts
      • 12.1Integrating custom web fonts and icon fonts
      • 12.2Enhancing typography and visual elements
    • Accessibility and Inclusive Design
      • 13.1Understanding ARIA roles and attributes
      • 13.2Designing for diverse user needs

    CSS Filters and Blend Modes

    Introduction to CSS Filters

    family of markup languages for displaying information viewable in a web browser

    Family of markup languages for displaying information viewable in a web browser.

    CSS filters are a powerful tool that can be used to change the rendering of an element before it is displayed on the screen. They allow you to apply visual effects to elements, such as blurring, brightening, or even changing the color saturation. This article will provide an overview of what CSS filters are, the different types of filters available, and how to apply them to HTML elements.

    What are CSS Filters?

    CSS filters are a set of graphical effects that you can apply to an element. These effects include blurring, changing contrast, brightness, and more. Filters are applied to the element and its children. However, they do not affect the layout of the element, meaning they won't change the position or size of the element or its children.

    Types of CSS Filters

    There are several types of CSS filters that you can use to manipulate the appearance of an element. Here are some of the most commonly used ones:

    • Blur: This filter applies a Gaussian blur to the element. The value you set will determine the radius of the blur.

    • Brightness: This filter can make the element appear brighter or darker. A value of 0% will create an image that is completely black, while a value of 100% will leave the image unchanged.

    • Contrast: This filter adjusts the contrast of the element. A value of 0% will create an image that is completely gray, while a value of 100% leaves the image unchanged.

    • Drop-shadow: This filter applies a shadow effect to the element. You can control the color, blur radius, and offset of the shadow.

    • Grayscale: This filter converts the element to grayscale, with 100% being completely grayscale and 0% leaving the image unchanged.

    • Hue-rotate: This filter applies a hue rotation on the image. The value you set will determine the degree of rotation of the hue circle.

    • Invert: This filter inverts the colors of the element. A value of 100% is completely inverted, while a value of 0% leaves the image unchanged.

    • Opacity: This filter controls the opacity of the element. A value of 0% is completely transparent, while a value of 100% leaves the image unchanged.

    • Saturate: This filter super-saturates or desaturates the element, depending on the value. A value of 0% is completely un-saturated, while a value of 100% leaves the image unchanged.

    • Sepia: This filter applies a sepia (warm brown) tone to the element. A value of 100% is completely sepia, while a value of 0% leaves the image unchanged.

    Applying CSS Filters to HTML Elements

    Applying a CSS filter to an HTML element is straightforward. You simply use the filter property in your CSS and specify the filter function you want to use. Here's an example of how to apply a blur filter to an image:

    img { filter: blur(5px); }

    In this example, the image will be blurred with a radius of 5 pixels. You can apply multiple filters to an element by separating each filter function with a space:

    img { filter: blur(5px) brightness(150%); }

    In this example, the image will be blurred and its brightness will be increased by 50%.

    CSS filters open up a world of possibilities for manipulating the visual appearance of elements on a webpage. By understanding and applying these filters, you can create unique and engaging designs.

    Test me
    Practical exercise
    Further reading

    My dude, any questions for me?

    Sign in to chat
    Next up: Creating unique compositions using blend modes